-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavalon.mobile.shim.min.js
3 lines (3 loc) · 68.8 KB
/
avalon.mobile.shim.min.js
1
2
3
!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(){avalon.config.debug&&console.log.apply(console,arguments)}function a(){return Object.create(null)}function r(e){return Function.apply(i,e)}function i(){}function o(e,t){"string"==typeof e&&(e=e.match(qt)||[]);for(var n={},a=void 0!==t?t:1,r=0,i=e.length;i>r;r++)n[e[r]]=a;return n}function l(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0/0}function s(e){if(e&&"object"==typeof e){var t=e.length,n=zt.call(e);if(/(Array|List|Collection|Map|Arguments)\]$/.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}function c(e,t){if(e&&e.childNodes)for(var n,a=e.childNodes,r=0;n=a[r++];)if(n.tagName){var i=Ht.createElementNS(ln,n.tagName.toLowerCase());Wt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),c(n,i),t.appendChild(i)}}function u(e){for(var t in e)if(Xt.call(e,t)){var n=e[t];"function"==typeof u.plugins[t]?u.plugins[t](n):"object"==typeof u[t]?avalon.mix(u[t],n):u[t]=n}return this}function f(e){return(e+"").replace(hn,"\\$&")}function d(e,t){var n=this.$events||(this.$events={}),a=n[e]||(n[e]=[]);if("function"==typeof t){var r=t;r.uniqueNumber=Math.random(),t={element:Zt,type:"user-watcher",handler:i,vmodels:[this],expr:e,uniqueNumber:r.uniqueNumber},t.wildcard=/\*/.test(e)}if(t.update)t.oneTime||avalon.Array.ensure(a,t);else{if(/\w\.*\B/.test(e)){t.getter=i;var o=this;t.update=function(){var e=this.fireArgs||[];e[2]&&t.handler.apply(o,e),delete this.fireArgs},a.sync=!0,avalon.Array.ensure(a,t)}else avalon.injectBinding(t);r&&(t.handler=r)}return function(){t.update=t.getter=t.handler=i,t.element=Ht.createElement("a")}}function v(e,t){var n=this.$events;if(n&&n[e]){t&&(t[2]=e);var a=n[e];h(a,t);var r=this.$up;r&&(this.$pathname&&v.call(r,this.$pathname+"."+e,t),v.call(r,"*."+e,t))}else{if(r=this.$up,this.$ups){for(var i in this.$ups)v.call(this.$ups[i],i+"."+e,t);return}if(r){var o=this.$pathname;""===o&&(o="*");var l=o+"."+e;a=l.split("."),-1===a.indexOf("*")?(v.call(r,l,t),a[1]="*",v.call(r,a.join("."),t)):v.call(r,l,t)}}}function p(e,t){for(;;){if(e.$watch){var n=e.$events||(e.$events={}),a=n[t]||(n[t]=[]);return void Tn.collectDependency(a)}if(e=e.$up,!e)break;t=e.$pathname+"."+t}}function h(e,t){if(e){new Date-Nn>444&&"object"==typeof e[0]&&D();for(var n,a=[],r=[],i=0;n=e[i++];)"user-watcher"===n.type?a.push(n):r.push(n);if(u.async){for(ha.render(),i=0;n=r[i++];)if(n.update){var o=S(n);ha.queue[o]||(ha.queue[o]=1,ha.queue.push(n))}}else for(i=0;n=r[i++];)n.update&&n.update();for(i=0;n=a[i++];)(t&&t[2]===n.expr||n.wildcard)&&(n.fireArgs=t),n.update()}}function m(e,t){return t=t||{},t.watch=!0,y(e,t)}function g(){}function y(e,t){function a(e){return u[e]===!0}if(!e||e.$id&&e.$accessors||e.nodeName&&e.nodeType>0)return e;t=t||Bt;var r=t.force||Bt,i=t.old,l=i&&i.$accessors||Bt,s=new g,c={},u={},f=[],p=[],h={};e.$skipArray&&(h=o(e.$skipArray),delete e.$skipArray);var m=e.$computed;if(m){delete e.$computed;for(var y in m)u[y]=!0,function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,m[y])}for(y in e){var w=e[y];yn[y]||(u[y]=!0),"function"==typeof w||w&&w.nodeName&&w.nodeType>0||!r[y]&&("$"===y.charAt(0)||yn[y]||h[y])?f.push(y):b(w)?(n("warning:计算属性建议放在$computed对象中统一定义"),function(e,t){var n;c[e]={get:function(){return n=t.get.call(this)},set:function(a){if("function"==typeof t.set){var r=n;t.set.call(this,a);var i=this[e];this.$fire&&i!==r&&this.$fire(e,i,r)}},enumerable:!0,configurable:!0}}(y,w)):(p.push(y),c[y]=l[y]?l[y]:$(y,w))}c.$model=bn,s=Object.defineProperties(s,c,e),f.forEach(function(t){s[t]=e[t]}),C(s,"$ups",null),C(s,"$id","anonymous"),C(s,"$up",i?i.$up:null),C(s,"$track",Object.keys(u)),C(s,"$active",!1),C(s,"$pathname",i?i.$pathname:""),C(s,"$accessors",c),C(s,"hasOwnProperty",a),t.watch&&(C(s,"$watch",function(){return d.apply(s,arguments)}),C(s,"$fire",function(e,t){if(0===e.indexOf("all!")){var n=e.slice(4);for(var a in avalon.vmodels){var r=avalon.vmodels[a];r.$fire&&r.$fire.apply(r,[n,t])}}else v.call(s,e,[t])})),p.forEach(function(t){var n=i&&i[t],a=s[t]=e[t];a&&"object"==typeof a&&(a.$up=s,a.$pathname=t),v.call(s,t,[a,n])});for(y in m)w=s[y];return s.$active=!0,s}function b(e){if(e&&"object"==typeof e){for(var t in e)if("get"!==t&&"set"!==t)return!1;return"function"==typeof e.get}}function $(e,t){var n,t=0/0;return{get:function(){return this.$active&&p(this,e),t},set:function(a){if(t!==a){var r=t;n=w(a,t),n?t=n:(n=void 0,t=a),Object(n)===n&&(n.$pathname=e,n.$up=this),this.$active&&v.call(this,e,[t,r])}},enumerable:!0,configurable:!0}}function w(e,t,n,a){if(Array.isArray(e))return x(e,t,a);if(avalon.isPlainObject(e)){if(t&&"object"==typeof t){var r=Object.keys(e),i=Object.keys(t);if(r.join(";")===i.join(";")){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}t.$active=!1}return y(e,{old:t,watch:a})}return n?e:void 0}function x(e,t,n){if(t){var a=[0,t.length].concat(e);return t.splice.apply(t,a),t}for(var r in xn)e[r]=xn[r];C(e,"$up",null),C(e,"$pathname",""),C(e,"$track",E(e.length)),e._=y({length:0/0},{watch:!0}),e._.length=e.length,e._.$watch("length",function(t,n){v.call(e.$up,e.$pathname+".length",[t,n])}),n&&C(e,"$watch",function(){return d.apply(e,arguments)}),Object.defineProperty(e,"$model",bn);for(var i=0,o=e.length;o>i;i++){var l=e[i]=w(e[i],0,1,1);Object(l)===l&&(l.$up=e)}return e}function C(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function T(e){var t=avalon.type(e);if("array"===t){for(var n=[],a=0;a<e.length;a++)n[a]=T(e[a]);return n}if("object"===t){var r={};for(a in e)if(e.hasOwnProperty(a)){var i=e[a];r[a]=i&&i.nodeType?i:T(i)}return r}return e}function k(e,t){for(var n={},a=0,r=t.length;r>a;a++){n[a]=e[a];var i=t[a];i in n?(e[a]=n[i],delete n[i]):e[a]=e[i]}}function E(e){for(var t=[],n=0;e>n;n++)t[n]=Qt("$proxy$each");return t}function N(e,t,n){switch(t){case"push":case"unshift":n=E(n.length);break;case"splice":if(n.length>2){{n[1],n.length-2}n=[n[0],n[1]].concat(E(n.length-2))}}Array.prototype[t].apply(e,n)}function A(e,t){t.oneTime||e&&avalon.Array.ensure(e,t)&&t.element&&(O(t,e),new Date-Nn>444&&D())}function M(e,t){for(var n,a=[],r=0;n=e[r++];)a.push(t?n.$id:n.$key);return a.join(";")}function S(e){if(!e.uniqueNumber){var t=e.element;e.uniqueNumber=t?1!==t.nodeType?e.type+"-"+S(t.parentNode)+"-"+ ++kn:e.name+"-"+S(t):++kn}return e.uniqueNumber}function O(e,t){var n=e.lists||(e.lists=[]),a=S(e);avalon.Array.ensure(n,t),t.$uuid=t.$uuid||Qt(),En[a]||(En[a]=1,En.push(e))}function D(e){for(var t=En.length,n=t,a=[],r={},i={};e=En[--t];){var o=e.type;i[o]?i[o]++:(i[o]=1,a.push(o))}var l=!1;if(a.forEach(function(e){An[e]!==i[e]&&(r[e]=1,l=!0)}),t=n,l)for(;e=En[--t];)if(null!==e.element){if(r[e.type]&&j(e.element)){En.splice(t,1),delete En[e.uniqueNumber];for(var s,c=e.lists,u=0;s=c[u++];)avalon.Array.remove(c,s),avalon.Array.remove(s,e);L(e)}}else En.splice(t,1);An=i,Nn=new Date}function L(e){delete En[e.uniqueNumber],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function j(e){try{{e.parentNode.nodeType}}catch(t){return!0}return e.ifRemove&&!Zt.contains(e.ifRemove)&&Rt===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:1===e.nodeType?!Zt.contains(e):!avalon.contains(Zt,e)}function H(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function P(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function R(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:Hn.test(e)?JSON.parse(e):e}catch(t){}return e}function F(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView:!1}function B(e,t){if(e.offsetWidth<=0){var n=getComputedStyle(e,null);if(qn.test(n.display)){var a={node:e};for(var r in Bn)a[r]=n[r],e.style[r]=Bn[r];t.push(a)}var i=e.parentNode;i&&1===i.nodeType&&B(i,t)}}function q(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function _(e,t){var n=[],a=!!t;t=t||0;for(var i="unknown",o="",l=0;l<e.length;l++){var s=e.charAt(l);if("'"===s||'"'===s)"unknown"===i?i=s:i===s&&(i="unknown");else if("\\"===s)("'"===i||'"'===i)&&l++;else if(Yn.test(s))"unknown"===i?(i="variable",o=s):"maybePath"===i?(o=n.pop(),o+="."+s,i="variable"):"variable"===i&&(o+=s);else if(/\w/.test(s))"variable"===i&&(o+=s);else if("."===s)"variable"===i&&o&&(n.push(o),o="",i="maybePath");else if("["===s){if("variable"===i||"maybePath"===i){o&&(n.push(o),o="");var c=n.length,u=n[c-1],f=_(e.slice(l),l);if(f.length)n[c-1]=u+".*",n=f.concat(n);else{var d=e.slice(l+1,f.i);try{var v=r(["return "+d])();n[c-1]=u+"."+v}catch(p){}}i="maybePath",l=f.i}}else if("]"===s){if(a)return n.i=l+t,V(n,o),n}else Xn.test(s)&&"\r"!==s&&"\n"!==s?"variable"===i&&(V(n,o)&&(i="maybePath"),o=""):(V(n,o),i="unknown",o="")}return V(n,o),n}function V(e,t){return t&&!Vn[t]?(e.push(t),!0):void 0}function I(e,t,n,a){for(var r,i=[],o=" = "+n+".",l=e.length;r=e[--l];)for(var s,c=r.split("."),u=c[0];s=c.shift();)t.hasOwnProperty(s)&&(i.push(u+o+u),a.observers.push({v:t,p:r}),e.splice(l,1));return i}function Y(e){e=e.trim();var t=Wn.get(e);if(t)return t.concat();for(var n,a=_(e),r={},i=[],o=0;n=a[o++];)r[n]||(r[n]=1,i.push(n));return Wn.put(e,i).concat()}function X(e,t,n){var a=n.filters;"string"==typeof a&&a.trim()&&!n._filters&&(n._filters=W(a.trim()));var i=Y(e),o=new Date-0,l=[],s=[],c=[];n.observers=[];for(var u=0,f=t.length;f>u;u++)if(i.length){var d="vm"+o+"_"+u;s.push(d),c.push(t[u]),l.push.apply(l,I(i,t[u],d,n))}n.args=c;var v=n.type,p=t.map(function(e){return String(e.$id).replace(zn,"$1")})+e+v,h=Un.get(p);if(h){if("duplex"===v){var m=Un.get(p+"setter");n.setter=m.apply(m,n.args)}return n.getter=h}if(l.length||l.push("fix"+o),"duplex"===v){var g={};l.forEach(function(e){var t=e.split("=");g[t[0].trim()]=t[1].trim()}),e=e.replace(/[\$\w]+/,function(e){return g[e]?g[e]:e});var y=r(s.concat("'use strict';return function(vvv){"+e+" = vvv\n}\n"));Un.put(p+"setter",y),n.setter=y.apply(y,n.args)}if("on"===v){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),s.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),$=e.slice(0,b),w=e.slice(b);e=$+"\n"+w}else e="\nreturn "+e+";";return h=r(s.concat("'use strict';\nvar "+l.join(",\n")+e)),Un.put(p,h)}function z(e){var t=dn.test(e);if(t){var n=rt(e);return 1===n.length?n[0].expr:n.map(function(e){return e.type?"("+e.expr+")":ea(e.expr)}).join(" + ")}return e}function W(e){return e=e.replace(Gn,"").replace(Zn,function(){return"],|"}).replace(Jn,function(e,t){return"["+ea(t)}).replace(Kn,function(){return'"],["'}).replace(Qn,function(){return'",'})+"]",r(["return ["+e+"]"])()}function U(e,t,n){var a=setTimeout(function(){var r=e.innerHTML;clearTimeout(a),r===n?t():U(e,t,r)})}function G(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events&&(t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]')}function Z(e,t){for(var n,a=0;n=e[a++];)n.vmodels=t,rn[n.type].init(n),avalon.injectBinding(n),n.getter&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function J(e,t){return e.priority-t.priority}function K(e,t){for(var n,a=e.attributes,r={},i=0;n=a[i++];){var o=n.name;if(n.specified&&!sa.test(o)){var l=P(n.name);r[l]=/^on\-[\w-]+$/.test(o)?na(e,o,t):R(n.value)}}return r}function Q(e,t,a){var r=!0;if(t.length){for(var i,o=e.attributes,l=[],s={},c=0;i=o[c++];){var u=i.name;if(!s[u]&&(s[u]=1,i.specified&&(a=u.match(ia)))){var f=a[1],d=a[2]||"",v=i.value;if(oa[f]?(d=f,f="on"):la[f]&&(d=f,f="attr",u="ms-"+f+"-"+d,n("warning!请改用"+u+"代替"+i.name+"!")),rn[f]){var p=v.replace(ra,""),h=v!==p,m={type:f,param:d,element:e,name:u,expr:p,oneTime:h,priority:(rn[f].priority||10*f.charCodeAt(0))+(Number(d.replace(/\D/g,""))||0)};if("html"===f||"text"===f){var g=at(v).filters;m.expr=m.expr.replace(g,""),m.filters=g.replace(fa,function(){return m.type="html",m.group=1,""}).trim()}else if("duplex"===f)var y=u;else if("ms-if-loop"===u)m.priority+=100;else if("ms-attr-value"===u)var b=u;l.push(m)}}}if(l.length){for(l.sort(J),y&&b&&"text"===e.type&&n("warning!一个控件不能同时定义ms-attr-value与"+y),c=0;m=l[c];c++){if(f=m.type,ca.test(f))return Z(l.slice(0,c+1),t);r&&(r=!ua.test(f))}Z(l,t)}}r&&!ta[e.tagName]&&(aa&&aa(e),et(e,t))}function et(e,t){var n=avalon.slice(e.childNodes);tt(n,t)}function tt(e,t){for(var n,a=0;n=e[a++];)switch(n.nodeType){case 1:var r=n;if(!r.msResolved&&r.parentNode&&1===r.parentNode.nodeType){var i=lt(r);if(i){var o=r.localName?r.localName.replace(i+":",""):r.nodeName,l=i+":"+P(o);ma.push({library:i,element:r,fullName:l,widget:o,vmodels:t,name:"widget"}),avalon.components[l]&&!function(e){setTimeout(function(){avalon.component(e)})}(l)}}nt(n,t),n.msHasEvent&&avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent});break;case 3:dn.test(n.nodeValue)&&it(n,t,a)}}function nt(e,t,n){var a=e.getAttribute("ms-skip"),r=e.getAttributeNode("ms-important"),i=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(n=r||i){var o=avalon.vmodels[n.value];if(!o)return;t=n===r?[o]:[o].concat(t),e.removeAttribute(n.name),e.classList.remove(n.name),G(e,o)}Q(e,t)}}function at(e){if(e.indexOf("|")>0){var t=e.replace(va,function(e){return Array(e.length+1).join("1")}),n=t.replace(da,"ᄢ㍄").indexOf("|");if(n>-1)return{type:"text",filters:e.slice(n).trim(),expr:e.slice(0,n)}}return{type:"text",expr:e,filters:""}}function rt(e){for(var t,n,a=[],r=0;;){if(n=e.indexOf(un,r),-1===n)break;if(t=e.slice(r,n),t&&a.push({expr:t}),r=n+un.length,n=e.indexOf(fn,r),-1===n)break;t=e.slice(r,n),t&&a.push(at(t,r)),r=n+fn.length}return t=e.slice(r),t&&a.push({expr:t}),a}function it(e,t,n){var a=[],r=rt(e.data);if(r.length){for(var i,o=0;i=r[o++];){var l=Ht.createTextNode(i.expr);i.type&&(i.expr=i.expr.replace(ra,function(){return i.oneTime=!0,""}),i.element=l,i.filters=i.filters.replace(fa,function(){return i.type="html",""}),i.pos=1e3*n+o,a.push(i)),Jt.appendChild(l)}e.parentNode.replaceChild(Jt,e),a.length&&Z(a,t)}}function ot(e,t){if(t)for(var n,a=0;n=e[a++];)if(n.hasOwnProperty(t)&&"object"==typeof n[t]){var r=n[t];return r.$model||r}return{}}function lt(e){if(e.scopeName&&"HTML"!==e.scopeName)return e.scopeName;var t=e.nodeName.toLowerCase(),n=t.indexOf(":");return n>0?t.slice(0,n):void 0}function st(e){return null==e?"":e}function ct(e,t,n){return t.param.replace(_t,function(a){var r=avalon.duplexHooks[a];r&&"function"==typeof r[n]&&(e=r[n](e,t))}),e}function ut(){for(var e=Aa.length-1;e>=0;e--){var t=Aa[e];t()===!1&&Aa.splice(e,1)}Aa.length||clearInterval(Na)}function ft(e,t){if(!e||1!==e.nodeType)return null;if(t)var n=t.effectName,a=t.effectDriver;else n=e.getAttribute("data-effect-name"),a=e.getAttribute("data-effect-driver");if(!n||!a)return null;var r=Pa.pop()||new pt;return r.el=e,r.driver=a,r.useCss="j"!==a,r.useCss&&(t&&avalon(e).addClass(t.effectClass),r.cssEvent="t"===a?Sa:Oa),r.name=n,r.callbacks=avalon.effects[n]||{},r}function dt(e,t){var n=e.getAttribute("data-effect-name");if(n){t.effectName=n,t.effectDriver=e.getAttribute("data-effect-driver");var a=+e.getAttribute("data-effect-stagger");t.effectLeaveStagger=+e.getAttribute("data-effect-leave-stagger")||a,t.effectEnterStagger=+e.getAttribute("data-effect-enter-stagger")||a,t.effectClass=e.className||0/0}}function vt(e){return e.replace(/^[\S]/g,function(e){return e.toUpperCase()})}function pt(){}function ht(e,t){var n=e.callbacks[t+"Class"];return"string"==typeof n?n:"function"==typeof n?n():e.name+"-"+t}function mt(e,t,n){var a=e.callbacks[t];a&&a.call(e,e.el,n)}function gt(e,t,n){var a=e.templateCache&&e.templateCache[t];if(a){for(var r,i=Ht.createDocumentFragment();r=a.firstChild;)i.appendChild(r);return i}return avalon.parseHTML(n)}function yt(e){for(var t=Ht.createDocumentFragment(),n=0,a=e.length;a>n;n++)t.appendChild(e[n]);return t}function bt(e,t,n){for(var a,r=0;a=e[r++];)a.className===n.effectClass&&avalon.effect.apply(a,t,i,i,n)}function $t(e,t,n){return e?setTimeout(t,++n*e):t(),n}function wt(e,t){for(var n=Jt.cloneNode(!1),a=e,r=a.nodeValue,o=t&&Math.max(+t.staggerIndex,0),l=avalon.slice(a.parentNode.childNodes),s=l.indexOf(a);;){var c=l[--s];if(!c||0===String(c.nodeValue).indexOf(r))break;t&&c.className===t.effectClass?(e=c,function(e){t.staggerIndex=$t(t.effectLeaveStagger,function(){avalon.effect.apply(e,0,i,function(){n.appendChild(e)},t)},o)}(c)):n.insertBefore(c,n.firstChild)}return n.appendChild(a),n}function xt(e,t,n,a,r){var i=e.template.cloneNode(!0),o=avalon.slice(i.childNodes);i.appendChild(n.$anchor),r&&t.appendChild(i);var l=[n].concat(e.vmodels),s={nodes:o,vmodels:l,content:i};a.push(s)}function Ct(e){var t="object"===e.xtype?Nt:Tt,n=t(e),a=n.$anchor||(n.$anchor=e.element.cloneNode(!1));return a.nodeValue=e.signature,n.$outer=e.$outer,n}function Tt(e,t){for(var n=e.param||"el",a=0,r=Ia.length;r>a;a++){var i=Ia[a];if(i&&i.hasOwnProperty(n)){Ia.splice(a,1),t=i;break}}return t||(t=kt(n)),t}function kt(e){var t={$outer:{},$index:0,$oldIndex:0,$anchor:null,$first:!1,$last:!1,$remove:avalon.noop};t[e]=0/0;var n={$last:1,$first:1,$index:1};n[e]=1;var a=m(t,{force:n});return a.$id=Qt("$proxy$each"),a}function Et(e,t,n){if("array"===n){e.$remove=function(){t.$repeat.removeAt(e.$index)};var a=t.param;e.$watch(a,function(n){var a=e.$index;t.$repeat[a]=n})}else e.$watch("$val",function(n){t.$repeat[e.$key]=n})}function Nt(){return Ya.pop()||At()}function At(){var e=m({$key:"",$val:0/0,$index:0,$oldIndex:0,$outer:{},$anchor:null},{force:{$key:1,$val:1,$index:1}});return e.$id=Qt("$proxy$with"),e}function Mt(e,t,n){var a=e[t];if(a){var r=0===a.$id.indexOf("$proxy$each")?Ia:Ya;a.$outer={};for(var i in a.$events){var o=a.$events[i];Array.isArray(o)&&(o.length=0,i===n?a[n]=0/0:"$val"===i&&(a.$val=0/0))}r.unshift(a)>u.maxRepeatSize&&r.pop(),delete e[t]}}function St(e,t){var n="_"+e;if(!St[n]){var a=Ht.createElement(e);Zt.appendChild(a),t=Gt?getComputedStyle(a,null).display:a.currentStyle.display,Zt.removeChild(a),St[n]=t}return St[n]}function Ot(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=a||",",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(r,i):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length<i&&(s[1]=s[1]||"",s[1]+=new Array(i-s[1].length+1).join("0")),s.join(l)}function Dt(){return/iPad|iPhone|iPod/i.test(tr)&&!e.MSStream?"backdropFilter"in document.documentElement.style?9:e.indexedDB?8:e.SpeechSynthesisUtterance?7:e.webkitAudioContext?6:e.matchMedia?5:e.history&&"pushState"in e.history?4:3:0/0}function Lt(e,t){return t&&ir.forEach(function(n){e[n]=t[n]}),e}var jt=Date.now(),Ht=e.document,Pt=Ht.head;Pt.insertAdjacentHTML("afterBegin",'<avalon ms-skip class="avalonHide"><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>');var Rt=Pt.firstChild,Ft="$"+jt,Bt={},qt=/[^, ]+/g,_t=/\w+/g,Vt=/^\[object SVG\w*Element\]$/,It=/^\[object (?:Window|DOMWindow|global)\]$/,Yt=Object.prototype,Xt=Yt.hasOwnProperty,zt=Yt.toString,Wt=Array.prototype,Ut=Wt.slice,Gt=e.dispatchEvent,Zt=Ht.documentElement,Jt=Ht.createDocumentFragment(),Kt=(Ht.createElement("div"),{});"Boolean Number String Function Array Date RegExp Object Error".replace(qt,function(e){Kt["[object "+e+"]"]=e.toLowerCase()});var Qt=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},en=l();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=r.length,t=0;e>t;t++)r[t]();r=r.slice(e)}var n=e.setImmediate,a=e.MutationObserver;if(n)return n.bind(e);var r=[];if(a){var i=document.createTextNode("avalon");new a(t).observe(i,{characterData:!0});var o=!1;return function(e){r.push(e),o=!o,i.data=o}}return function(e){setTimeout(e,4)}},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?Kt[zt.call(e)]||"object":typeof e};var tn=function(e){return"[object Function]"===zt.call(e)};avalon.isFunction=tn,avalon.isWindow=function(e){return It.test(zt.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===zt.call(e)&&Object.getPrototypeOf(e)===Yt},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||tn(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e)n=o[t],a=e[t],o!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,a)):void 0!==a&&(o[t]=a));return o},avalon.mix({rword:qt,subscribers:Ft,version:1.55,ui:{},log:n,slice:function(e,t,n){return Ut.call(e,t,n)},noop:i,error:function(e,t){throw new(t||Error)(e)},oneObject:o,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),i=new Array(r);++a<r;)i[a]=e,e+=n;return i},eventHooks:{},bind:function(e,t,n,a){var r=avalon.eventHooks,i=r[t];return"object"==typeof i&&(t=i.type||t,a=i.phase||!!a,n=i.fn?i.fn(e,n):n),e.addEventListener(t,n,a),n},unbind:function(e,t,n,a){var r=avalon.eventHooks,o=r[t],l=n||i;"object"==typeof o&&(t=o.type||t,a=o.phase||!!a),e.removeEventListener(t,l,a)},css:function(e,t,n){e instanceof avalon&&(e=e[0]);var a,r=/[_-]/.test(t)?P(t):t;if(t=avalon.cssName(r)||r,void 0===n||"boolean"==typeof n){a=Pn[r+":get"]||Pn["@:get"],"background"===t&&(t="backgroundColor");var i=a(e,t);return n===!0?parseFloat(i)||0:i}if(""===n)e.style[t]="";else{if(null==n||n!==n)return;isFinite(n)&&!avalon.cssNumber[r]&&(n+="px"),a=Pn[r+":set"]||Pn["@:set"],a(e,t,n)}},each:function(e,t){if(e){var n=0;if(s(e))for(var a=e.length;a>n&&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(),a={};for(var r in n)0===r.indexOf(t)&&(a[r.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[r]);return a},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 nn=avalon.bindingHandlers={},an=avalon.bindingExecutors={},rn=avalon.directives={};avalon.directive=function(e,t){return nn[e]=t.init=t.init||i,an[e]=t.update=t.update||i,rn[e]=t};var on=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,delete this._keymap[e.key])},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(Ht.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}},e.SVGElement){var ln="http://www.w3.org/2000/svg",sn=Ht.createElementNS(ln,"svg");sn.innerHTML='<circle cx="50" cy="50" r="40" fill="red" />',Vt.test(sn.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:function(){return(new XMLSerializer).serializeToString(this)},set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,a=avalon.parseHTML(e);if("svg"===t)n.insertBefore(a,this);else{var r=Ht.createDocumentFragment();c(a,r),n.insertBefore(r,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("</"+this.nodeName+">$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);c(t,this)}}}})}var cn=avalon.eventHooks;"onmouseenter"in Zt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){cn[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(t,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!cn.animationend&&(cn.animationend={type:n})}),void 0===Ht.onmousewheel&&(cn.mousewheel={type:"wheel",fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n.deltaY>0?-120:120,n.wheelDeltaX=0,Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}});var un,fn,dn,vn,pn,hn=/[-.*+?^${}()|[\]\/\\]/g,mn={interpolate:function(e){if(un=e[0],fn=e[1],un===fn){throw new SyntaxError("openTag!==closeTag")}u.openTag=un,u.closeTag=fn;var t=f(un),n=f(fn);dn=new RegExp(t+"(.*?)"+n),vn=new RegExp(t+"(.*?)"+n,"g"),pn=new RegExp(t+".*?"+n+"|\\sms-")}};u.async=!0,u.debug=!0,u.plugins=mn,u.plugins.interpolate(["{{","}}"]),u.paths={},u.shim={},u.maxRepeatSize=100,avalon.config=u;var gn=avalon.vmodels={};avalon.define=function(e){var t=e.$id;t||n("warning: vm必须指定$id");var a=m(e);return a.$id=t,gn[t]=a};var yn=o("$id,$watch,$fire,$events,$model,$skipArray,$active,$pathname,$up,$ups,$track,$accessors"),bn={get:function(){return T(this)},set:i,enumerable:!1,configurable:!0},$n=["push","pop","shift","unshift","splice"],wn=Array.prototype,xn={notify:function(){v.call(this.$up,this.$pathname)},set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");v.call(this.$up,this.$pathname+".*",[t,this[e]]),this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},size:function(){return this._.length},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)-1!==e.indexOf(this[t])&&(Cn.call(this.$track,t,1),Cn.call(this,t,1));else if("function"==typeof e)for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&(Cn.call(this.$track,t,1),Cn.call(this,t,1))}else Cn.call(this.$track,0,this.length),Cn.call(this,0,this.length);Gt||(this.$model=T(this)),this.notify(),this._.length=this.length},clear:function(){return this.removeAll()}},Cn=wn.splice;$n.forEach(function(e){var t=wn[e];xn[e]=function(){for(var n=[],a=0,r=arguments.length;r>a;a++)n[a]=w(arguments[a],0,1,1);var i=t.apply(this,n);return N(this.$track,e,n),Gt||(this.$model=T(this)),this.notify(),this._.length=this.length,i}}),"sort,reverse".replace(qt,function(e){xn[e]=function(){var t=this.concat(),n=this,a=Math.random(),r=[],i=!1;wn[e].apply(n,arguments);for(var o=0,l=t.length;l>o;o++){var s=n[o],c=t[o];if(s===c)r.push(o);else{var u=t.indexOf(s);r.push(u),t[u]=a,i=!0}}return i&&(k(this.$track,r),Gt||(this.$model=T(this)),this.notify()),this}});var Tn=function(){var e,t=[];return{begin:function(n){t.push(e),e=n},end:function(){e=t.pop()},collectDependency:function(t){e&&e.callback(t)}}}();avalon.injectBinding=function(e){e.handler=e.handler||rn[e.type].update||i,e.update=function(){var t=!1;e.getter||(t=!0,Tn.begin({callback:function(t){A(t,e)}}),e.getter=X(e.expr,e.vmodels,e),e.observers.forEach(function(t){t.v.$watch(t.p,e)}),delete e.observers);try{var a,r,i=e.fireArgs;if(delete e.fireArgs,i?(a=i[0],r=i[1]):a="on"===e.type?e.getter+"":e.getter.apply(0,e.args),r="undefined"==typeof r?e.oldValue:r,e._filters&&(a=Ja.$filter.apply(0,[a].concat(e._filters))),e.signature){var o=avalon.type(a);if("array"!==o&&"object"!==o)throw Error("warning:"+e.expr+"只能是对象或数组");e.xtype=o;var l=M(e.proxies||[],o),s=a.$track||("array"===o?E(a.length):Object.keys(a));e.track=s,l!==s.join(";")&&(e.handler(a,r),e.oldValue=1)}else(Array.isArray(a)?a.length===(r&&r.length):1)?"oldValue"in e&&a===r||(e.handler(a,r),e.oldValue=a):(e.handler(a,r),e.oldValue=a.concat())}catch(c){delete e.getter,n("warning:exception throwed in [avalon.injectBinding] ",c);var u=e.element;u&&3===u.nodeType&&(u.nodeValue=un+(e.oneTime?"::":"")+e.expr+fn)}finally{t&&Tn.end()}},e.update()};var kn=0,En=avalon.$$subscribers=[],Nn=new Date,An={},Mn=new function(){avalon.mix(this,{option:Ht.createElement("select"),thead:Ht.createElement("table"),td:Ht.createElement("tr"),area:Ht.createElement("map"),tr:Ht.createElement("tbody"),col:Ht.createElement("colgroup"),legend:Ht.createElement("fieldset"),_default:Ht.createElement("div"),g:Ht.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(qt,function(e){Mn[e]=Mn.g});var Sn=/<([\w:]+)/,On=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Dn=o(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Ln=Ht.createElement("script"),jn=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Jt.cloneNode(!1);if("string"!=typeof e)return t;if(!jn.test(e))return t.appendChild(Ht.createTextNode(e)),t;e=e.replace(On,"<$1></$2>").trim();var n,a=(Sn.exec(e)||["",""])[1].toLowerCase(),r=Mn[a]||Mn._default;r.innerHTML=e;var i=r.getElementsByTagName("script");if(i.length)for(var o,l=0;o=i[l++];)if(Dn[o.type]){var s=Ln.cloneNode(!1);Wt.forEach.call(o.attributes,function(e){s.setAttribute(e.name,e.value)}),s.text=o.text,o.parentNode.replaceChild(s,o)}for(;n=r.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},"add,remove".replace(qt,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){n.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){for(var n,a=0,r=String(e).split(/\s+/),i="boolean"==typeof t;n=r[a++];){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-"+H(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return R(n);case 0:var a={};return Wt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=P(e.slice(5)),a[e]=R(t.value)))}),a}},removeData:function(e){return e="data-"+H(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 a=avalon.css(this,e,t);return void 0!==a?a:this},position:function(){var e,t,n=this[0],a={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.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||Zt)},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,a=n?":get":":set",r=_n[q(t)+a];if(r)var i=r(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}}),Zt.dataset&&(avalon.fn.data=function(e,t){e=e&&P(e);var n=this[0].dataset;switch(arguments.length){case 2:return n[e]=t,this;case 1:return t=n[e],R(t);case 0:var r=a();for(e in n)r[e]=R(n[e]);return r}});var Hn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;avalon.parseJSON=JSON.parse,avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var a=this[0]||{},r=F(a),i="scrollTop"===e;return arguments.length?void(r?r.scrollTo(i?r[t]:n,i?n:r[t]):a[e]=n):r?r[t]:a[e]}});var Pn=avalon.cssHooks=a(),Rn=["","-webkit-","-moz-","-ms-"],Fn={"float":"cssFloat"};avalon.cssNumber=o("animationIterationCount,animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(Fn[e])return Fn[e];t=t||Zt.style;for(var a=0,r=Rn.length;r>a;a++)if(n=P(Rn[a]+e),n in t)return Fn[e]=n;return null},Pn["@:set"]=function(e,t,n){e.style[t]=n},Pn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},Pn["opacity:get"]=function(e){var t=Pn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(qt,function(e){Pn[e+":get"]=function(t){var n=Pn["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Bn={position:"absolute",visibility:"hidden",display:"block"},qn=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(qt,function(e){var t=e.toLowerCase(),n="client"+e,a="scroll"+e,r="offset"+e;Pn[t+":get"]=function(t,n,a){var i=-4;"number"==typeof a&&(i=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[r];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)},Pn[t+"&get"]=function(e){var n=[];B(e,n);for(var a,r=Pn[t+":get"](e),i=0;a=n[i++];){e=a.node;for(var o in a)"string"==typeof a[o]&&(e.style[o]=a[o])}return r},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[a],l[a],o.body[r],l[r],l[n])}return Pn[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return Pn[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return Pn[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(i){return{left:0,top:0}}};var _n={"select:get":function(e,t){for(var n,a=e.options,r=e.selectedIndex,i="select-one"===e.type||0>r,o=i?null:[],l=i?r+1:a.length,s=0>r?l:i?r:0;l>s;s++)if(n=a[s],(n.selected||s===r)&&!n.disabled){if(t=n.value,i)return t;o.push(t)}return o},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Vn={},In=["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(",");In.replace(/\w+/g,function(e){Vn[e]=!0});var Yn=/[a-z_$]/i,Xn=/[\s\uFEFF\xA0]/,zn=/(\$proxy\$[a-z]+)\d+$/,Wn=new on(218),Un=new on(128);avalon.normalizeExpr=z,avalon.parseExprProxy=X;var Gn=/\)\s*$/,Zn=/\)\s*\|/g,Jn=/\|\s*([$\w]+)/g,Kn=/"\s*\["/g,Qn=/"\s*\(/g,ea=JSON.stringify;avalon.scan=function(e,t){e=e||Zt;var n=t?[].concat(t):[];nt(e,n)};var ta=o("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),na=function(e,t,n){var a=e.getAttribute(t);if(a)for(var r,i=0;r=n[i++];)if(r.hasOwnProperty(a)&&"function"==typeof r[a])return r[a]},aa=en&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var a=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=a}}:0,ra=/^\s*::/,ia=/ms-(\w+)-?(.*)/,oa=o("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),la=o("value,title,alt,checked,selected,disabled,readonly,enabled,href,src"),sa=/^(ms-\S+|data-\S+|on[a-z]+|id|style|class)$/,ca=/^if|widget|repeat$/,ua=/^each|with|html|include$/,fa=/\|\s*html(?:\b|$)/,da=/\|\|/g,va=/(['"])(\\\1|.)+?\1/g,pa=function(){this.queue=[]};pa.prototype={render:function(e){if(!this.locked){this.locked=e?Zt.offsetHeight+10:1;var t=this;avalon.nextTick(function(){t.flush()})}},flush:function(){for(var e,t=0;e=this.queue[t++];)e.update&&e.update();this.locked=0,this.queue=[]}};var ha=new pa,ma=[],ga=[],ya={$construct:function(){return avalon.mix.apply(null,arguments)},$ready:i,$init:i,$dispose:i,$container:null,$childReady:i,$replace:!1,$extend:null,$$template:function(e){return e}};avalon.components={},avalon.component=function(t,n){n&&(avalon.components[t]=avalon.mix({},ya,n));for(var a,r=0;a=ma[r];r++)t===a.fullName&&(ma.splice(r,1),r--,function(n,a,r,i){var o=1,l=n.library,s=avalon.libraries[l]||ya,c=K(r,n.vmodels),u=ot(n.vmodels,c.config||n.widget),f=c.$id||c.identifier||Qt(i);delete c.config,delete c.$id,delete c.identifier;var d={},v=avalon.components[a.$extend];v?(avalon.mix(!0,d,v),d=v.$construct.call(r,d,{},{})):avalon.mix(!0,d,a),d=avalon.components[t].$construct.call(r,d,u,c),d.$refs={},d.$id=f;var p=d.$slot,h=d.$replace,m=d.$container,g=d.$template;delete d.$slot,delete d.$replace,delete d.$container,delete d.$construct;var y=avalon.define(d)||{};r.msResolved=1,y.$init(y,r),s.$init(y,r);for(var b,$,w=r.childNodes,x={},C=0;$=w[C++];){var T=1===$.nodeType&&$.getAttribute("slot")||p;T&&(x[T]?x[T].push($):x[T]=[$])}y.$$template&&(avalon.clearHTML(r),r.innerHTML=y.$$template(g));for(C in x)if(y.hasOwnProperty(C)){var k=x[C];if(k.length){for(var E=Jt.cloneNode(!0),N=0;b=k[N++];)E.appendChild(b);y[C]=E}x[C]=null}x=null;var A=r.children[0]||r.firstChild;if(h){r.parentNode.replaceChild(A,r),A.msResolved=1;var M=r.style.cssText,S=r.className;r=n.element=A,r.style.cssText=M,S&&avalon(r).addClass(S)}m&&m.appendChild(r),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:1});var L=0,j=avalon.bind(r,"datasetchanged",function(t){if(t.childReady&&t.library===l&&(o+=t.childReady,y!==t.vm&&(y.$refs[t.vm.$id]=t.vm,-1===t.childReady&&(L++,y.$childReady(y,r,t)),t.stopPropagation())),0===o){var a=setTimeout(function(){clearTimeout(a),y.$ready(y,r,n.vmodels),s.$ready(y,r,n.vmodels)},L?Math.max(17*L,100):17);avalon.unbind(r,"datasetchanged",j),n.rollback=function(){try{y.$dispose(y,r),s.$dispose(y,r)}catch(e){}delete avalon.vmodels[y.$id]},O(n,ga),e.chrome&&r.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(D)})}});if(nt(r,[y].concat(n.vmodels)),avalon.vmodels[y.$id]=y,r.childNodes.length)var H=setTimeout(function(){clearTimeout(H),avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})},17);else avalon.fireDom(r,"datasetchanged",{library:l,vm:y,childReady:-1})}(a,avalon.components[t],a.element,a.widget))},avalon.fireDom=function(e,t,n){if(Ht.createEvent){var a=Ht.createEvent("Events");a.initEvent(t,!0,!0,n),avalon.mix(a,n),e.dispatchEvent(a)}else Zt.contains(e)&&(a=Ht.createEventObject(),avalon.mix(a,n),e.fireEvent("on"+t,a))},avalon.libraries=[],avalon.library=function(e,t){Ht.namespaces&&Ht.namespaces.add(e,"http://www.w3.org/1999/xhtml"),avalon.libraries[e]=avalon.mix({$init:i,$ready:i,$dispose:i},t||{})},avalon.library("ms");var ba=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),$a={};ba.replace(qt,function(e){$a[e.toLowerCase()]=e});var wa={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},xa=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");xa.replace(qt,function(e){wa[e.toLowerCase()]=e});var Ca=avalon.directive("attr",{init:function(e){if(e.expr=z(e.expr.trim()),"include"===e.type){var t=e.element;dt(t,e),e.includeRendered=na(t,"data-include-rendered",e.vmodels),e.includeLoaded=na(t,"data-include-loaded",e.vmodels);var n=e.includeReplace=!!avalon(t).data("includeReplace");avalon(t).data("includeCache")&&(e.templateCache={}),e.start=Ht.createComment("ms-include"),e.end=Ht.createComment("ms-include-end"),n?(e.element=e.end,e._element=t,t.parentNode.insertBefore(e.start,t),t.parentNode.insertBefore(e.end,t.nextSibling)):(t.insertBefore(e.start,t.firstChild),t.appendChild(e.end))}},update:function(t){var n=this.element,a=this.param;if("href"===a||"src"===a){if("string"!=typeof t||Zt.hasAttribute||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var r=n.parentNode,i=document.createComment("ms-src");r.replaceChild(i,n),r.replaceChild(n,i)}}else{var o=t===!1||null===t||void 0===t;!Gt&&wa[a]&&(a=wa[a]);var l=$a[a];if("boolean"==typeof n[l]&&(n[l]=!!t,t||(o=!0)),o)return n.removeAttribute(a);var s=Vt.test(n)?!1:Ht.namespaces&&isVML(n)?!0:a in n.cloneNode(!1);s?n[a]=t+"":n.setAttribute(a,t)}}});"title,alt,src,value,css,include,href".replace(qt,function(e){rn[e]=Ca}),avalon.directive("class",{init:function(e){var t=e.param,a=e.type;if(!t||isFinite(t)?(e.param="",rn.effect.init(e)):(n("ms-"+a+'-xxx="yyy"这种用法已经过时,请使用ms-'+a+'="xxx:yyy"'),e.expr="["+ea(t)+","+e.expr+"]",e.oldStyle=t),"hover"===a||"active"===a){if(!e.hasBindEvent){var r=e.element,i=avalon(r),o="mouseenter",l="mouseleave";if("active"===a){r.tabIndex=r.tabIndex||-1,o="mousedown",l="mouseup";var s=i.bind("mouseleave",function(){e.toggleClass&&i.removeClass(e.newClass)})}}var c=i.bind(o,function(){e.toggleClass&&i.addClass(e.newClass)}),u=i.bind(l,function(){e.toggleClass&&i.removeClass(e.newClass)});e.rollback=function(){i.unbind("mouseleave",s),i.unbind(o,c),i.unbind(l,u)},e.hasBindEvent=!0}},update:function(e){var t=this,n=avalon(this.element);t.newClass=e[0],t.toggleClass=!!e[1],t.oldClass&&t.newClass!==t.oldClass&&n.removeClass(t.oldClass),t.oldClass=t.newClass,"class"===t.type&&(t.oldStyle?n.toggleClass(t.oldStyle,!!e[1]):n.toggleClass(t.newClass,t.toggleClass))}}),"hover,active".replace(qt,function(e){rn[e]=rn["class"]}),avalon.directive("css",{init:rn.attr.init,update:function(e){avalon(this.element).css(this.param,e)}}),avalon.directive("data",{priority:100,update:function(e){var t=this.element,n="data-"+this.param;e&&"object"==typeof e?t[n]=e:t.setAttribute(n,String(e))}});{var Ta=/^(?:checkbox|radio)$/,ka=/^(?:radio|checked)$/,Ea=/^(file|button|reset|submit|checkbox|radio|range)$/;avalon.directive("duplex",{priority:2e3,init:function(e,t){function a(t){e.changed.call(this,t,e)}function r(){d=!0}function l(){d=!1}var s=e.element,c=e.vmodels;e.changed=na(s,"data-duplex-changed",c)||i;var u=[],f=o("string,number,boolean,checked");"radio"===s.type&&""===e.param&&(e.param="checked"),e.param.replace(_t,function(a){Ta.test(s.type)&&ka.test(a)&&("radio"===a&&n("ms-duplex-radio已经更名为ms-duplex-checked"),a="checked",e.isChecked=!0,e.xtype="radio"),"bool"===a?(a="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===a&&(a="string",n("ms-duplex-text已经更名为ms-duplex-string")),f[a]&&(t=!0),avalon.Array.ensure(u,a)}),t||u.push("string"),e.param=u.join("-"),e.xtype||(e.xtype="SELECT"===s.tagName?"select":"checkbox"===s.type?"checkbox":"radio"===s.type?"radio":/^change/.test(s.getAttribute("data-duplex-event"))?"change":"input"),e.bound=function(t,n){s.addEventListener(t,n,!1);var a=e.rollback;e.rollback=function(){s.avalonSetter=null,avalon.unbind(s,t,n),a&&a()}};var d=!1,v=function(){var t=s.value;if(!d&&t!==e.oldValue&&null!==e.pipe){var n=e.pipe(t,e,"get");e.setter(n),a.call(s,n)}};switch(e.xtype){case"radio":e.bound("click",function(){var t=e.pipe(s.value,e,"get");e.setter(t),a.call(s,t)});break;case"checkbox":e.bound("change",function(){var t=s.checked?"ensure":"remove",r=e.getter.apply(0,e.vmodels);Array.isArray(r)||(n("ms-duplex应用于checkbox上要对应一个数组"),r=[r]);var i=e.pipe(s.value,e,"get");avalon.Array[t](r,i),a.call(s,r)});break;case"change":e.bound("change",v);break;case"input":en?e.bound("input",v):(e.bound("input",v),e.bound("compositionstart",r),e.bound("compositionend",l),e.bound("DOMAutoComplete",v));break;case"select":e.bound("change",function(){var t=avalon(s).val();if(t=Array.isArray(t)?t.map(function(t){return e.pipe(t,e,"get")}):e.pipe(t,e,"get"),t+""!==e.oldValue)try{e.setter(t)}catch(a){n(a)}}),e.bound("datasetchanged",function(t){if("selectDuplex"===t.bubble){var n=e._value,r=Array.isArray(n)?n.map(String):n+"";avalon(s).val(r),s.oldValue=r+"",a.call(s,r)}})}"input"!==e.xtype||Ea.test(s.type)||("hidden"!==s.type&&(e.bound("focus",function(){s.msFocus=!0}),e.bound("blur",function(){s.msFocus=!1})),s.avalonSetter=v,Ma(function(){if(Zt.contains(s))s.msFocus||e.oldValue===s.value||v();else if(!s.msRetain)return!1}))},update:function(e){var t,n=this.element,a=this;if(!this.init){for(var r in avalon.vmodels){var i=avalon.vmodels[r];i.$fire("avalon-ms-duplex-init",a)}var o=a.pipe||(a.pipe=ct);o(null,a,"init"),this.init=1}switch(this.xtype){case"input":case"change":if(t=this.pipe(e,this,"set"),t!==this.oldValue){var l=!1;if(n.msFocus)try{var s=n.selectionStart,c=n.selectionEnd;if(s===c){var u=s;l=!0}}catch(f){}n.value=this.oldValue=t,l&&(n.selectionStart=n.selectionEnd=u)}break;case"radio":t=a.isChecked?!!e:e+""===n.value,n.checked=t;break;case"checkbox":var d=[].concat(e);t=this.pipe(n.value,this,"get"),n.checked=d.indexOf(t)>-1;break;case"select":a._value=e,n.msHasEvent?avalon.fireDom(n,"datasetchanged",{bubble:n.msHasEvent}):n.msHasEvent="selectDuplex"}}})}avalon.duplexHooks={checked:{get:function(e,t){return!t.oldValue}},string:{get:function(e){return e},set:st},"boolean":{get:function(e){return"true"===e},set:st},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;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:st}};var Na,Aa=[];avalon.tick=function(e){1===Aa.push(e)&&(Na=setInterval(ut,60))};var Ma=i;!new function(){function e(e){t[this.tagName].call(this,e),!this.msFocus&&this.avalonSetter&&this.avalonSetter()}try{var t={},n=HTMLInputElement.prototype,a=HTMLTextAreaElement.prototype,r=HTMLInputElement.prototype;Object.getOwnPropertyNames(r),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(a,"value").set,Object.defineProperty(a,"value",{set:e})}catch(i){Ma=avalon.tick}},avalon.directive("effect",{priority:5,init:function(e){var t,n,a=e.expr,r=a.replace(vn,function(e){return e.replace(/./g,"0")}).indexOf(":");-1===r?(t=a,n=!0):(t=a.slice(0,r),n=a.slice(r+1)),t=dn.test(a)?z(t):ea(t),e.expr="["+t+","+n+"]"},update:function(t){var n=t[0],a=this.element;if(a.getAttribute("data-effect-name")!==n){a.removeAttribute("data-effect-driver");var r=a.style,i=e.getComputedStyle?e.getComputedStyle(a):null,o=!1;if(i&&(Da||La)){var l=r[ja]||i[ja];l&&"0s"!==l&&(a.setAttribute("data-effect-driver","t"),o=!0),o||(l=r[Ha]||i[Ha],l&&"0s"!==l&&(a.setAttribute("data-effect-driver","a"),o=!0))}o||avalon.effects[n]&&(a.setAttribute("data-effect-driver","j"),o=!0),o&&a.setAttribute("data-effect-name",n)}}}),avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t};var Sa,Oa,Da=!1,La=!1,ja=avalon.cssName("transition-duration"),Ha=avalon.cssName("animation-duration");!new function(){var t,n={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"};for(var a in n){if(e[a]){t=n[a];break}try{{document.createEvent(a)}t=n[a];break}catch(r){}}"string"==typeof t&&(Da=!0,Sa=t),n={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var i;for(a in n)if(e[a]){i=n[a];break}"string"==typeof i&&(Da=!0,Oa=i)};var Pa=[],Ra=new pa;pt.prototype={contrustor:pt,enterClass:function(){return ht(this,"enter")},leaveClass:function(){return ht(this,"leave")},actionFun:function(e,t,n){if(!document.hidden){var a=this,r=a.el,i="leave"===e;e=i?"leave":"enter";var o=i?"enter":"leave";mt(a,"abort"+vt(o)),mt(a,"before"+vt(e)),i||t(r);var l=function(o){r.removeEventListener(a.cssEvent,a.cssCallback),i?(t(r),avalon(r).removeClass(a.cssClass)):"a"===a.driver&&avalon(r).removeClass(a.cssClass),o!==!0&&(mt(a,"after"+vt(e)),n&&n(r)),a.dispose()};a.useCss?(a.cssCallback&&a.cssCallback(!0),a.cssClass=ht(a,e),a.cssCallback=l,a.update=function(){r.addEventListener(a.cssEvent,a.cssCallback),i||"t"!==a.driver||avalon(r).removeClass(a.cssClass)},avalon(r).addClass(a.cssClass),Ra.render(!0),Ra.queue.push(a)):mt(a,e,l)}},enter:function(){this.actionFun.apply(this,["enter"].concat(avalon.slice(arguments)))},leave:function(){this.actionFun.apply(this,["leave"].concat(avalon.slice(arguments)))},dispose:function(){this.update=this.cssCallback=null,Pa.unshift(this)>100&&Pa.pop()}};var Fa=function(e,t){var n=Ut.call(arguments,0);"function"!=typeof n[2]&&n.splice(2,0,i),"function"!=typeof n[3]&&n.splice(3,0,i);var a=n[2],r=n[3],o=n[4],l=ft(e,o);if(!l)return a(),r(),!1;var s=t?"enter":"leave";l[s](a,r)};avalon.mix(avalon.effect,{apply:Fa,append:function(e,t,n,a){return Fa(e,1,function(){t.appendChild(e)},n,a)},before:function(e,t,n,a){return Fa(e,1,function(){t.parentNode.insertBefore(e,t)},n,a)},remove:function(e,t,n,a){return Fa(e,0,function(){e.parentNode===t&&t.removeChild(e)},n,a)}}),avalon.directive("html",{update:function(e){var t=this,n=this.element,a=1!==n.nodeType,r=a?n.parentNode:n;if(r){if(e=null==e?"":e,3===n.nodeType){var i=Qt("html");r.insertBefore(Ht.createComment(i),n),t.element=Ht.createComment(i+":end"),r.replaceChild(t.element,n),n=t.element}if("object"!=typeof e)var o=avalon.parseHTML(String(e));else if(11===e.nodeType)o=e;else if(1===e.nodeType||e.item){var l=1===e.nodeType?e.childNodes:e.item;for(o=Jt.cloneNode(!0);l[0];)o.appendChild(l[0])}if(l=avalon.slice(o.childNodes),a){for(var s=n.nodeValue.slice(0,-4);;){var c=n.previousSibling;if(!c||8===c.nodeType&&c.nodeValue===s)break;r.removeChild(c)}r.insertBefore(o,n)}else avalon.clearHTML(n).appendChild(o);tt(l,t.vmodels)}}}),avalon.directive("if",{priority:10,update:function(e){function t(){r.getAttribute(a.name)&&(r.removeAttribute(a.name),Q(r,a.vmodels)),a.rollback=null}var n,a=this,r=this.element,i=a.stamp=+new Date,o=function(){i===a.stamp&&(a.recoverNode=null)};a.recoverNode&&a.recoverNode();try{if(!r.parentNode)return;n=r.parentNode}catch(l){return}if(e){if(8===r.nodeType){var s=a.keep,c=avalon.effect.apply(s,1,function(){i===a.stamp&&(r.parentNode.replaceChild(s,r),r=a.element=s,s.getAttribute("_required")&&(r.required=!0,r.removeAttribute("_required")),r.querySelectorAll&&avalon.each(r.querySelectorAll("[_required=true]"),function(e){e.required=!0,e.removeAttribute("_required")}),t())},o);c=c===!1}c||t()}else if(1===r.nodeType){r.required===!0&&(r.required=!1,r.setAttribute("_required","true"));try{avalon.each(r.querySelectorAll(":required"),function(e){r.required=!1,e.setAttribute("_required","true")})}catch(l){}var u=a.element=Ht.createComment("ms-if"),f=r.nextSibling;a.recoverNode=function(){a.recoverNode=null,u.parentNode!==n&&(n.insertBefore(u,f),a.keep=r)},avalon.effect.apply(r,0,function(){a.recoverNode=null,i===a.stamp&&(r.parentNode.replaceChild(u,r),a.keep=r,Rt.appendChild(r),a.rollback=function(){r.parentNode===Rt&&Rt.removeChild(r)})},o)}}});var Ba=function(){return new e.XMLHttpRequest},qa=avalon.templateCache={};avalon.directive("include",{init:rn.attr.init,update:function(e){var t=this,a=this.element,r=t.vmodels,i=t.includeRendered,o=t.effectName&&t.effectClass,l=t.templateCache,s=t.includeReplace,c=t.includeLoaded,u=s?a.parentNode:a,f=t._element;t.recoverNodes=t.recoverNodes||avalon.noop;var d=function(n){var d=t._stamp=+new Date;if(c){var v=c.apply(u,[n].concat(r));"string"==typeof v&&(n=v)}i&&U(u,function(){i.call(u)},0/0);var p=t.includeLastID||"_default";t.includeLastID=e;var h=l&&l[p]||Ht.createElement(a.tagName||t._element.tagName);o&&(h.className=o,u.insertBefore(h,t.start)),(l||{})[p]=h;var m=t.recoverNodes();for(m&&u.insertBefore(m,t.end);;){var g=t.start.nextSibling;if(!g||g===h||g===t.end)break;h.appendChild(g)}avalon.effect.remove(h,u,function(){l&&d===t._stamp&&Rt.appendChild(h)},t);var y=u,b=avalon.noop,$=avalon.noop,w=gt(t,e,n),x=avalon.slice(w.childNodes);s&&o?(y=f,y.innerHTML="",y.setAttribute("ms-skip","true"),u.insertBefore(y,t.end.nextSibling),b=function(){y.insertBefore(w,null)},$=function(){t.recoverNodes=avalon.noop,d===t._stamp&&(w=yt(x),u.insertBefore(w,t.end),tt(x,r)),y.parentNode===u&&u.removeChild(y)},t.recoverNodes=function(){return t.recoverNodes=avalon.noop,yt(x)}):b=function(){u.insertBefore(w,t.end),tt(x,r)},avalon.effect.apply(y,"enter",b,$)};if("src"===t.param)if("string"==typeof qa[e])avalon.nextTick(function(){d(qa[e])});else if(Array.isArray(qa[e]))qa[e].push(d);else{var v=Ba();v.onload=function(){for(var t,n=v.responseText,a=0;t=qa[e][a++];)t(n);qa[e]=n},v.onerror=function(){n("ms-include load ["+e+"] error")},qa[e]=[d],v.open("GET",e,!0),"withCredentials"in v&&(v.withCredentials=!0),v.setRequestHeader("X-Requested-With","XMLHttpRequest"),v.send(null)}else{var p=e&&1===e.nodeType?e:Ht.getElementById(e);p&&avalon.nextTick(function(){d(p.value||p.innerText||p.innerHTML)})}}});var _a=/\(([^)]*)\)/,Va=avalon.directive("on",{priority:3e3,init:function(e){var t=e.expr;e.type="on";var n=e.param.replace(/-\d+$/,"");if("function"==typeof Va[n+"Hook"]&&Va[n+"Hook"](e),t.indexOf("(")>0&&t.indexOf(")")>-1){var a=(t.match(_a)||["",""])[1].trim();(""===a||"$event"===a)&&(t=t.replace(_a,""))}e.expr=t},update:function(e){var t=this,n=this.element;e=function(e){var n=t.getter||i;return n.apply(this,t.args.concat(e))};var a=t.param.replace(/-\d+$/,"");if("scan"===a)e.call(n,{type:a});else if("function"==typeof t.specialBind)t.specialBind(n,e);else var r=avalon.bind(n,a,e);t.rollback=function(){"function"==typeof t.specialUnbind?t.specialUnbind():avalon.unbind(n,a,r)}}});avalon.directive("repeat",{priority:90,init:function(e){var t=e.type;e.cache={},e.enterCount=0;var n=e.element;if(1===n.nodeType){n.removeAttribute(e.name),dt(n,e),e.param=e.param||"el",e.sortedCallback=na(n,"data-with-sorted",e.vmodels);var a=na(n,"data-"+t+"-rendered",e.vmodels),r=Qt(t),i=Ht.createComment(r+":start"),o=e.element=Ht.createComment(r+":end");if(e.signature=r,e.start=i,e.template=Jt.cloneNode(!1),"repeat"===t){var l=n.parentNode;l.replaceChild(o,n),l.insertBefore(i,o),e.template.appendChild(n)}else{for(;n.firstChild;)e.template.appendChild(n.firstChild);n.appendChild(i),n.appendChild(o),l=n}if(e.element=o,a)var s=avalon.bind(l,"datasetchanged",function(){a.apply(l,l.args),avalon.unbind(l,"datasetchanged",s),l.msRendered=a})}},update:function(e,t){var n=this,a=this.xtype;this.enterCount+=1;var r=!t;if(r){n.$outer={};var i="$key",o="$val";"array"===a&&(i="$first",o="$last");for(var l,s=0;l=n.vmodels[s++];)if(l.hasOwnProperty(i)&&l.hasOwnProperty(o)){n.$outer=l;break}}var c=this.track;if(n.sortedCallback){var f=n.sortedCallback.call($,c);f&&Array.isArray(f)&&(c=f)}var d="move";n.$repeat=e;var v=[],p=r&&Jt.cloneNode(!1),h=[],m=this.param,g=avalon.mix({},this.cache),y=this.element,b=c.length,$=y.parentNode;for(s=0;b>s;s++){var w=c[s],x=g[w];if(x)v.push({}),g[w]=!0;else{if(x=Ct(this),x.$up=null,"array"===a){d="add",x.$id=w;var C=e[s];x[m]=C,Object(C)===C&&(C.$ups=C.$ups||{},C.$ups[m]=x)}else d="append",x.$key=w,x.$val=e[w];this.cache[w]=x;var k=x.$anchor||(x.$anchor=y.cloneNode(!1));k.nodeValue=this.signature,xt(n,p,x,v,r&&!n.effectDriver),Et(x,n,a)}1===this.enterCount&&(x.$active=!1,x.$oldIndex=x.$index,x.$active=!0,x.$index=s),"array"===a?(x.$first=0===s,x.$last=s===b-1):x.$val=T(e[w]),h.push(x)}if(this.proxies=h,r&&!n.effectDriver)$.insertBefore(p,y),v.forEach(function(e){tt(e.nodes||[],e.vmodels),e.nodes=e.vmodels=null});else{var E=n.staggerIndex=0;for(w in g)g[w]!==!0&&(d="del",wt(g[w].$anchor,n),Mt(this.cache,w,m),g[w]=null);for(s=0;b>s;s++){x=h[s],w="array"===a?x.$id:x.$key;var N=h[s-1],A=N?N.$anchor:n.start;g[w]?x.$index!==x.$oldIndex&&!function(e,t){E=$t(n.effectEnterStagger,function(){var a=wt(e.$anchor),r=avalon.slice(a.childNodes);$.insertBefore(a,t.nextSibling),bt(r,1,n)},E)}(x,A):!function(e,t){var a=e.nodes,r=e.vmodels;a&&(E=$t(n.effectEnterStagger,function(){$.insertBefore(e.content,t.nextSibling),tt(a,r),bt(a,1,n)},E)),e.nodes=e.vmodels=null}(v[s],A)}}if(!e.$track)for(w in this.cache)Mt(this.cache,w,m);!function(e){$.args=e,$.msRendered&&$.msRendered.apply($,e)}(u.newWatch?arguments:[d]);var M=setTimeout(function(){clearTimeout(M),avalon.fireDom($,"datasetchanged",{bubble:$.msHasEvent})});this.enterCount-=1}}),"with,each".replace(qt,function(e){rn[e]=avalon.mix({},rn.repeat,{priority:1400})});var Ia=[],Ya=[];avalon.directive("text",{update:function(e){var t=this.element;if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else t.textContent=e}}),avalon.parseDisplay=St,avalon.directive("visible",{init:function(e){dt(e.element,e)},update:function(e){var t,n=this,a=this.element,r=!this.effectName;return this.stamp?(t=this.stamp=+new Date,void(e?avalon.effect.apply(a,1,function(){if(t===n.stamp){var e=a.getAttribute("data-effect-driver")||"a";r&&(a.style.display=n.display||""),("a"===e||"t"===e)&&"none"===avalon(a).css("display")&&(a.style.display=n.display||St(a.nodeName))}}):avalon.effect.apply(a,0,function(){t===n.stamp&&(a.style.display="none")}))):(t=this.stamp=+new Date,void(e?(a.style.display=n.display||"","none"===avalon(a).css("display")&&(a.style.display=n.display=St(a.nodeName))):a.style.display="none"))}});var Xa=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,za=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Wa=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,Ua={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},Ga=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Za=/([^\#-~| |!])/g,Ja=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof 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 a=arguments[t],r=avalon.filters[a[0]];if("function"==typeof r){var i=[e].concat(a.slice(1));e=r.apply(null,i)}}return e},camelize:P,sanitize:function(e){return e.replace(Xa,"").replace(Wa,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=Ua[t[1]];n&&(e=e.replace(n,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(za," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(Ga,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(Za,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")},currency:function(e,t,n){return(t||"¥")+Ot(e,isFinite(n)?n:2)},number:Ot};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),a+e}function n(e,n,a,r){return function(i){var o=i["get"+e]();return(a>0||o>-a)&&(o+=a),0===o&&-12===a&&(o=12),t(o,n,r)}}function a(e,t){return function(n,a){var r=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return a[i][r]}}function r(e){var n=-1*e.getTimezoneOffset(),a=n>=0?"+":"";return a+=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:a("Month"),MMM:a("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:a("Day"),EEE:a("Day",!0),a:i,Z:r},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;Ja.date=function(t,n){var a,r,i=Ja.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(),d=[0,0,0,0,0,0,0],v=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,a,r){var i=4===r.length?[r,n,a]:[n,a,r];return d[0]=e(i[0]),d[1]=e(i[1])-1,d[2]=e(i[2]),""});var p=v.setFullYear,h=v.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,a,r,i){return d[3]=e(n),d[4]=e(a),d[5]=e(r),i&&(d[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,a,r){return p=v.setUTCFullYear,h=v.setUTCHours,n&&(m=e(n+a),g=e(n+r)),""}),d[3]-=m,d[4]-=g,p.apply(v,d.slice(0,3)),h.apply(v,d.slice(3)),t=v}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)r=l.exec(n),r?(u=u.concat(r.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){a=o[e],c+=a?a(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,Ja.date.locate=c};var Ka,Qa=[],er=function(e){Ka=!0;var t=avalon.require;for(t&&t.checkDeps&&(modules["domReady!"].state=4,t.checkDeps());e=Qa.shift();)e(avalon)};"complete"===Ht.readyState?setTimeout(er):Ht.addEventListener("DOMContentLoaded",er),e.addEventListener("load",er),avalon.ready=function(e){Ka?e(avalon):Qa.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(Ht.body)});var tr=navigator.userAgent.toLowerCase(),nr=tr.indexOf("android")>0,ar=Dt(),rr=avalon.gestureHooks={pointers:{},start:function(e,t){for(var n=0;n<e.changedTouches.length;n++){var a=e.changedTouches[n],r={startTouch:Lt({},a),startTime:Date.now(),status:"tapping",element:e.target};rr.pointers[a.identifier]=r,t(r,a)}},move:function(e,t){for(var n=0;n<e.changedTouches.length;n++){var a=e.changedTouches[n],r=rr.pointers[a.identifier];if(!r)return;"lastTouch"in r||(r.lastTouch=r.startTouch,r.lastTime=r.startTime,r.deltaX=r.deltaY=r.duration=r.distance=0);var i=Date.now()-r.lastTime;if(i>0){var o=70;i>o&&(i=o),r.duration+i>o&&(r.duration=o-i),r.duration+=i,r.lastTouch=Lt({},a),r.lastTime=Date.now(),r.deltaX=a.clientX-r.startTouch.clientX,r.deltaY=a.clientY-r.startTouch.clientY;var l=r.deltaX*r.deltaX,s=r.deltaY*r.deltaY;r.distance=Math.sqrt(l+s),r.isVertical=s>l,t(r,a)
}}},end:function(e,t){for(var n=0;n<e.changedTouches.length;n++){var a=e.changedTouches[n],r=a.identifier,i=rr.pointers[r];i&&(t(i,a),delete rr.pointers[r])}},fire:function(e,t,n){if(e){var a=document.createEvent("Events");a.initEvent(t,!0,!0),avalon.mix(a,n),e.dispatchEvent(a)}},add:function(e,t){function n(e){t.touchmove(e)}function a(e){t.touchend(e),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",a),document.removeEventListener("touchcancel",r)}function r(e){t.touchcancel(e),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",a),document.removeEventListener("touchcancel",r)}t.events.forEach(function(i){avalon.eventHooks[i]={fn:function(i,o){return i["touch-"+e]||(i["touch-"+e]="1",i.addEventListener("touchstart",function(e){t.touchstart(e),document.addEventListener("touchmove",n),document.addEventListener("touchend",a),document.addEventListener("touchcancel",r)})),o}}})}},ir=["screenX","screenY","clientX","clientY","pageX","pageY"],or=!!navigator.pointerEnabled||!!navigator.msPointerEnabled;or&&(Zt.style.msTouchAction=Zt.style.touchAction="none");var lr={events:["tap"],touchBoundary:10,tapDelay:200,needClick:function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(ar&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return!1},needFocus:function(e){switch(e.nodeName.toLowerCase()){case"textarea":case"select":return!0;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return!1}},focus:function(e){var t,n=e.type;ar&&e.setSelectionRange&&0!==n.indexOf("date")&&"time"!==n&&"month"!==n?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},findControl:function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},fixTarget:function(t){return 3===t.nodeType?t.parentNode:e.SVGElementInstance&&t instanceof SVGElementInstance?t.correspondingUseElement:t},updateScrollParent:function(e){var t=e.tapScrollParent;if(!t||!t.contains(e)){var n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.tapScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.lastScrollTop=t.scrollTop)},touchHasMoved:function(e){var t=e.changedTouches[0],n=lr.touchBoundary;return Math.abs(t.pageX-lr.touchStartX)>n||Math.abs(t.pageY-lr.touchStartY)>n},findType:function(e){return nr&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},sendClick:function(t,n){rr.fire(t,"tap",{touchEvent:n});var a,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=n.changedTouches[0],a=document.createEvent("MouseEvents"),a.initMouseEvent(lr.findType(t),!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),a.touchEvent=n,t.dispatchEvent(a)},touchstart:function(t){if(1!==t.targetTouches.length)return!0;var n=lr.fixTarget(t.target),a=t.targetTouches[0];if(ar){var r=e.getSelection();if(r.rangeCount&&!r.isCollapsed)return!0;var i=a.identifier;if(i&&isFinite(lr.lastTouchIdentifier)&&lr.lastTouchIdentifier===i)return t.preventDefault(),!1;lr.lastTouchIdentifier=i,lr.updateScrollParent(n)}lr.status="tapping",lr.startTime=Date.now(),lr.element=n,lr.pageX=a.pageX,lr.pageY=a.pageY,lr.startTime-lr.lastTime<lr.tapDelay&&t.preventDefault()},touchmove:function(e){return"tapping"!==lr.status?!0:void((lr.element!==lr.fixTarget(e.target)||lr.touchHasMoved(e))&&(lr.status=lr.element=0))},touchend:function(t){var n=lr.element,a=Date.now();if(!n||a-lr.startTime>lr.tapDelay)return!0;lr.lastTime=a;var r=lr.startTime;if(lr.status=lr.startTime=0,targetTagName=n.tagName.toLowerCase(),"label"===targetTagName){rr.fire(n,"tap",{touchEvent:t});var i=lr.findControl(n);i&&(lr.focus(n),n=i)}else if(lr.needFocus(n))return a-r>100||ar&&e.top!==e&&"input"===targetTagName?(lr.element=0,!1):(lr.focus(n),nr&&lr.sendClick(n,t),!1);if(ar){var o=n.tapScrollParent;if(o&&o.lastScrollTop!==o.scrollTop)return!0}lr.needClick(n)||(t.preventDefault(),lr.sendClick(n,t))},touchcancel:function(){lr.startTime=lr.element=0}};rr.add("tap",lr);var sr={events:["longtap","doubletap"],cancelPress:function(e){clearTimeout(e.pressingHandler),e.pressingHandler=null},touchstart:function(e){rr.start(e,function(t,n){t.pressingHandler=setTimeout(function(){"tapping"===t.status&&rr.fire(e.target,"longtap",{touch:n,touchEvent:e}),sr.cancelPress(t)},500),1!==e.changedTouches.length&&(t.status=0)})},touchmove:function(e){rr.move(e,function(e){e.distance>10&&e.pressingHandler&&(sr.cancelPress(e),"tapping"===e.status&&(e.status="panning"))})},touchend:function(e){rr.end(e,function(t,n){sr.cancelPress(t),"tapping"===t.status&&(t.lastTime=Date.now(),sr.lastTap&&t.lastTime-sr.lastTap.lastTime<300&&rr.fire(t.element,"doubletap",{touch:n,touchEvent:e}),sr.lastTap=t)})},touchcancel:function(e){rr.end(e,function(e){sr.cancelPress(e)})}};rr.add("press",sr);var cr={events:["swipe","swipeleft","swiperight","swipeup","swipedown"],getAngle:function(e,t){var n=Math.atan2(t,e),a=Math.round(180*n/Math.PI);return 0>a?360-Math.abs(a):a},getDirection:function(e,t){var n=cr.getAngle(e,t);return 45>=n&&n>=0?"left":360>=n&&n>=315?"left":n>=135&&225>=n?"right":n>45&&135>n?"down":"up"},touchstart:function(e){rr.start(e,i)},touchmove:function(e){rr.move(e,i)},touchend:function(e){1===e.changedTouches.length&&rr.end(e,function(t,n){var a=t.distance>30&&t.distance/t.duration>.65;if(a){var r={deltaX:t.deltaX,deltaY:t.deltaY,touch:n,touchEvent:e,direction:cr.getDirection(t.deltaX,t.deltaY),isVertical:t.isVertical},i=t.element;rr.fire(i,"swipe",r),rr.fire(i,"swipe"+r.direction,r)}})}};cr.touchcancel=cr.touchend,rr.add("swipe",cr),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var ur=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=ur),avalon},void 0===t&&(e.avalon=avalon),avalon});