forked from stdjs/SourceRepository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstd.debug.min.js
executable file
·9 lines (9 loc) · 148 KB
/
std.debug.min.js
1
2
3
4
5
6
7
8
9
/**
Std Javascript Library v0.2.1
http://www.StdJS.com
*/
!function(e,t,r,n,i,o,a,u,s,c,l,f,d){var h,m,p,v,g,b,y,k,w,x,_,S,T,C,F,A,N,L,E,z,H,D,P,j,B,M,O,W=e.Std=function(e,t){if(t===n&&a(e))return g(e);if(a(e)){var i=g(e);return i===r?r:p.malloc(i,Array.slice(arguments,1))}return r};W.version=.2,W.models={},W.modules={},W.eval=function(t){a(t)||W.debug({path:"Std.eval",description:" String contains an invalid character"});var r=e&&e.eval;return r?r(t):new Function(t)()},W.debug=function(e,t){if("undefined"==typeof console)throw e;if(s(t))return h(t,function(e,t){s(t)?W.debug.apply(W,t):W.debug.call(W,t)}),W;if(u(e))return"path"in e&&console.error("Error: ","["+e.path+"]"),"module"in e&&console.log("module: %c"+e.module,"color:green;font-weight: bold;"),"memberType"in e&&"memberName"in e&&console.log(e.memberType+" member: %c"+e.memberName,"color:green;font-weight: bold;"),"description"in e&&console.log("description: %c"+e.description,"color:green;font-weight: bold;"),"file"in e&&!l(e.file)&&console.log("file: %c"+e.file,"color:green;font-weight: bold;"),"line"in e&&console.log("line: %c"+e.line,"color:green;font-weight: bold;"),"position"in e&&console.log("position: %c"+e.position,"color:green;font-weight: bold;"),"data"in e&&console.log(e.data),"content"in e&&console.log("%c"+e.content,"color:#4D4D4D;"),W.debug.end(),W;t===n&&(t={});var r="%c"+e,i="";if("size"in t&&(i+="font-size: "+t.size+"px;"),"bold"in t&&(i+="font-weight: bold;"),"underline"in t&&(i+="text-decoration: underline;"),"italic"in t&&(i+="font-style: italic;"),"color"in t&&(i+="color: "+t.color+";"),"background"in t&&(i+="background:"+t.background+";"),"css"in t)if(a(t.css))i+=t.css;else if(u(t.css))for(var o in t.css)t.css.hasOwnProperty(o)&&(i+=o+":"+t.css[o]+";");if("type"in t){if("error"===t.type)return console.error("Error:",e),W;if("info"===t.type)return console.info(r,i),W}return console.log(r,i),W},W.debug.end=function(){throw null},h=W.each=function(e,t,o,a){var u=r,c=typeof e;if(!e||!i(t))return r;if("string"===c&&(e=e.split(a===n?" ":a)),s(e)){o===!0&&(u=[]);for(var l=0,f=e.length;f>l;l++){var d=t.call(e,l,e[l]);if(d!==n){if(o!==!0)return d;u.push(d)}}}else if("object"===c||"function"===c){o===!0&&(u={});for(var h in e){var d=t.call(e,h,e[h]);if(d!==n){if(o!==!0)return d;u[h]=d}}}return u},m=W.extend=function(e,t,r,n){if(!e||!u(t)&&!i(t))return e;var o,a,l,f="__Std__";switch(r){case 1:for(o in t)o!==f&&(a=t[o],l=e[o],s(a)?s(l)?e[o].mergeArray(a):e[o]=[].mergeArray(a):e[o]=a);break;case 2:for(o in t)a=t[o],l=e[o],a!==t&&o!==f&&(e[o]=c(a)&&c(l)&&!s(a)&&!s(l)?m(l,a,2):a);break;case 3:for(o in t)a=t[o],l=e[o],a!==t&&o!==f&&(s(a)?s(l)?e[o].mergeArray(a):e[o]=[].mergeArray(a):e[o]=c(a)&&c(l)&&!s(a)&&!s(l)?m(l,a,3):a);break;default:for(o in t)n===!1&&o in e||o!==f&&(e[o]=t[o])}return e},m(Math,{over:function(e,t){return 0===t?0:e/t},rand:function(e,t){return e=t===n?Math.random()*e:Math.random()*(t-e)+e},check:function(e,t,r){var i=!1;if(""===t&&""===r)return!i;if(r==n)return i;switch(t){case">":i=float(e)>float(r);break;case"<":i=float(e)<float(r);break;case"=":case"==":i=e==r;break;case"===":i=e===r;break;case">=":i=float(e)>=float(r);break;case"<=":i=float(e)<=float(r);break;case"!=":i=e!==r;break;case"~=":i=(" "+e+" ").indexOf(r)>-1;break;case"^=":i=0==e.indexOf(r);break;case"$=":i=e.slice(-r.length)===r;break;case"*=":a(e)&&(i=e.indexOf(r)>-1);break;case"|=":i=e===r||e.slice(0,r.length+1)==r+"-"}return i}}),m(Object,{clear:function(e){for(var t in e)delete e[t];return e},keys:function(e){var t=[],r={}.hasOwnProperty;return W.each(e,function(n){r.call(e,n)&&t.push(n)}),t},contains:function(e,t){if(e===n||!t)return!1;if(e===t)return!0;var r=s(t),i=t.length;if(r||o(i))for(var a=0;i>a;a++)if(t[a]===e)return!0;return r?!1:e in t}},0,!1),m(Function.prototype,{bind:function(){var e=this,t=Array.prototype.slice,r=t.call(arguments),n=r.shift();return function(){return e.apply(n,r.concat(t.call(arguments)))}}},0,!1),m(Array,{slice:function(e,t,r){return Array.prototype.slice.call(e,t,r)},from:function(e){var t,r=e.length;if(u(e))if(t=[],o(r))for(var n=0;r>n;n++)t[n]=e[n];else for(var i in e)t.push(e[i]);else a(e)&&(t=e.split(""));return t}},0,!1),m(Array.prototype,{each:function(e,t,r){return h.call(this,this,e,t,r)},has:function(e){return-1!==this.indexOf(e)},exist:function(e){return this.has(e)},clear:function(){return this.remove()},insert:function(e,t){return t===n?this.push(e):this.splice(t,0,e),this},map:function(e,t){var r=this,n=[],o=Object.prototype.hasOwnProperty;return i(e)||W.debug({path:"Array",memberType:"public",memberName:"map",description:e+" is not a function"}),h(r,function(i,a){o.call(r,i)&&n.push(e.call(t,a,i,r))},!0),n},filter:function(e,t){var r=this,n=[],o=Object.prototype.hasOwnProperty;return i(e)||W.debug({path:"Array",memberType:"public",memberName:"filter",description:e+" is not a function"}),h(r,function(i,a){o.call(r,i)&&e.call(t,a,i,r)===!0&&n.push(a)},!0),n},last:function(){return this[this.length-1]},merge:function(){for(var e=0,t=arguments,r=t.length;r>e;e++)this.mergeArray(t[e]);return this},union:function(){for(var e=0,t=arguments,r=t.length;r>e;e++)this.mergeArray(t[e],!0);return this},push_uniq:function(e){var t=this;return t.has(e)||t.push(e),t},swap:function(e,t){var r=this,n=r[e];return r[e]=r[t],r[t]=n,r},indexOf:function(e,t){var r=this,i=r.length;for(t=t===n?0:t;i>t;t++)if(e===r[t])return t;return-1},move:function(e,t){var r=this,n=r.length;if(e!==t&&e>=0&&n>=e&&t>=0&&n>=t){var i=r[e];if(t>e)for(;t>e;)r[e]=r[++e];else for(;e>t;)r[e]=r[--e];r[t]=i}return r},unique:function(){for(var e=this,t=e.length,r=[],n=0,i=0;t>i;i++)-1==r.indexOf(e[i])&&(r[n++]=e[i]);for(var o=0;n>o;o++)e[o]=r[o];return e.length=n,e},mergeArray:function(e,t){var r=this;if(u(e))for(var n=e.length||0,i=0;n>i;i++)t===!0&&r.has(e[i])||r.push(e[i]);return r},order:function(e){var t=r;return"asc"===e?t=function(e,t){return e>t}:"desc"===e&&(t=function(e,t){return t>e}),this.sort(t)},remove:function(e){var t=this;if(e===n)t.length=0;else if(o(e))t.splice(e,1);else if(s(e)){for(var r=[],i=0,a=t.length;a>i;i++){var u=e.indexOf(i);-1===u?r.push(t[i]):e.splice(u,1)}for(i=0,a=t.length=r.length;a>i;i++)t[i]=r[i]}return t}},0),m(String.prototype,{trim:function(){return this.replace(/(^\s*)|(\s*$)/g,"")},left:function(e){return o(e)||W.debug({path:"String.prototype",memberName:"left",description:"illegal parameter"}),this.substr(0,e)},right:function(e){return o(e)||W.debug({path:"String.prototype",memberName:"right",description:"illegal parameter"}),this.substring(this.length-e)},isNumber:function(){return x.number(this)},capitalize:function(){return this.charAt(0).toUpperCase()+this.substr(1)},has:function(e){return-1!==this.indexOf(e)},retype:function(){var e=this.toString();return"true"===e?e=!0:"false"===e?e=!1:"null"===e?e=r:x.number(e)&&(e=int(e)),e},byteLen:function(){for(var e=this,t=e.length,r=t-1;r>=0;r--){var n=e.charCodeAt(r);n>127&&2047>=n?t++:n>2047&&65535>=n&&(t+=2)}return t},between:function(e,t,n){var i=this,u=o(e)?e:i.indexOf(e,n),s=o(t)?t:i.indexOf(t,u+e.length);return-1===u||-1===s?r:(a(e)&&(u+=e.length),i.substring(u,s))},reverse:function(){for(var e="",t=this.length-1;t>=0;t--)e+=this.charAt(t);return e},toObject:function(){var e=this.trim();if(e.length<2)return r;var t=e.charAt(0),n=e.substring(e.length-1);return"["==t&&"]"==n||"{"==t&&"}"==n?new Function("return "+e)()||r:r},count:function(e){var t=0,r=this,i=-1;if(e===n)return r.length;for(a(e)||W.debug({path:"String.prototype",memberName:"count",description:"illegal parameter"});-1!=(i=r.indexOf(e,i+1));)t++;return t},line:function(e,t){o(e)||W.debug({path:"String.prototype",memberName:"line",description:"illegal parameter"});var r=0,n=this.toString(),i=-1;do if(++r===e){var a=n.indexOf("\n",i+1);return t===!0?i+1:n.substring(r>0?i+1:i,-1==a?n.length:a)}while(-1!=(i=n.indexOf("\n",i+1)));return null},camelCase:function(e){var t=this;return e===!0&&(t=t.capitalize()),-1!=t.indexOf("-")?t.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}):t.toString()},unCamelCase:function(){return this.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()})},utf8Encode:function(){return unescape(encodeURIComponent(this))},utf8Decode:function(){try{return decodeURIComponent(escape(this))}catch(e){return this.toString()}},escapeString:function(e){for(var t=this,r="",n=0,i=t.length;i>n;n++){var o=t.charAt(n),a=t.charAt(n+1);switch(o){case e:r+="\\"+o;break;case"\r":r+="\\r";break;case"\n":r+="\\n";break;case"\\":a===o?(r+="\\\\",n++):a===e&&(r+="\\"+e,n++);break;default:r+=o}}return r},escapeHTML:function(){return this.replace(/[<>&"]/g,function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"}[e]||e})},unescapeHTML:function(){var e="replace";return this[e](/&/,"&")[e](/</g,"<")[e](/>/g,">")[e](/'/g,"'")[e](/"/g,'"')[e](/&#(\d+)/g,function(e,t){return String.formCharCode(int(t,10))})}},0,!1),m(Number.prototype,{"float":function(e){var t=Math.pow(10,e===n?0:e);return Math.round(this*t)/t},isFloat:function(){return 0!=Math.ceil(this)-this}}),m(Date,{time:function(){return(new Date).getTime()}},0,!1),m(Date.prototype,{format:function(e,t){var r=this;if(t===n){var i={"M+":r.getMonth()+1,"d+":r.getDate(),"h+":r.getHours(),"m+":r.getMinutes(),"s+":r.getSeconds(),"q+":Math.floor((r.getMonth()+3)/3),S:r.getMilliseconds()};l(e)&&(e="yyyy-M-d h:m:s"),/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(r.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in i)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?i[o]:("00"+i[o]).substr((""+i[o]).length)));return e}for(var a={},u="y M d h m s".split(" "),s="",c=[],f=0,d=-1,h=e.length;h>f;f++){var m=e.charAt(f),p=-1!=u.indexOf(m);p&&m!==s?c[++d]=s=m:p||m===s?c[d]+=m:c[++d]=s=m}for(f=0,d=0,h=c.length;h>f;f++){var v=c[f],g=t.substring(d,d+=v.length);if(!g)break;-1!=u.indexOf(v.charAt(0))&&(a[v.charAt(0)]=~~g)}for(var b in a){var y=~~a[b];"y"==b?y.length<4?r.setYear(y):r.setFullYear(y):"M"==b?r.setMonth(y-1):"d"==b?r.setDate(y):"h"==b?r.setHours(y):"m"==b?r.setMinutes(y):"s"==b&&r.setSeconds(y)}return r}},0,!1),m(e,{"int":parseInt,"float":function(e,t){var r=parseFloat(e);return t===!0?0!=Math.ceil(r)-r:r},newDom:function(e,r){a(e)||W.debug({path:"global",memberName:"newDom",description:"illegal parameter"});var n=t.createElement(e);return a(r)&&(n.className=r),new j(n,!1)},newDiv:function(e){return newDom("div",e)},sprintf:function(){for(var e=arguments,t=e.length,r=arguments[0],n=1,i="",o=0,a=r.length;a>o;o++){var u=r.charAt(o);if(a-1>o&&"%"==r.charAt(o)){var s=r.charAt(o+1);if("%"==s)i+="%";else if(t>n){var c=e[n];switch(s){case"c":i+=(c+"").charAt(0);break;case"s":i+=c+"";break;case"d":i+=int(c);break;case"f":i+=float(c);break;case"o":i+=int(c).toString(8);break;case"x":i+=int(c).toString(16);break;case"X":i+=int(c).toString(16).toUpperCase();break;case".":if(a-3>o){var l=int(r.charAt(o+2));l>0&&"f"==r.charAt(o+3)&&(i+=float(c).toFixed(l),o+=2)}}n++}o++}else i+=u}return i}}),W.init=function(){var r,n,i,o,u=!!e.ActiveXObject,s=u&&!e.XMLHttpRequest,c=u&&!!t.documentMode,l=u&&!s&&!c,f={ie:{n:u,6:s,7:l,8:c},on:i={},cssName:o={}},d=function(e){return e.capitalize()},h=function(e){return t.createElement(e)},m="opacity",p="animation",v="keyframes",g="defineProperty",b=g in Object;if(b){var y=function(){},k=y.prototype={};try{Object[g](k,"a",{value:1})}catch(w){b=!1}1!==k.a&&(b=!1)}return f[g]=b,!function(){var e=h("a"),u=e.style;e.innerHTML=" <link/><table></table><script>;</script>",u.cssText="top:1px;float:left;"+m+":.5;",r=f.css={inlineBlock:s||l,opacity:/^0.5/.test(u[m]),cssFloat:!!u.cssFloat},n=f.dom={dataset:!!e.dataset,tbody:!e.getElementsByTagName("tbody").length,innerFullHTML:3!==e.firstChild.nodeType,outerHTML:!!e.outerHTML,htmlSerialize:!!e.getElementsByTagName("link").length,contains:!!e.contains,compareDocPos:!!e.compareDocumentPosition,cloneBug:""==e.lastChild.cloneNode(!0).innerHTML};for(var c=["submit","focusin","change"],d=0,g=c.length;g>d;d++){var b=c[d],y="on"+b;(i[b]=y in t)||(e.setAttribute(y,"t"),i[b]=e.attributes[y].expando===!1)}for(var k in u)if(g=k.length,a(k)&&k.toLowerCase().substring(g-9)===p){f.anim=(k=k==p?"":"-"+k.substr(0,g-9)+"-")+v,o.animation=k+p;break}}(),!function(){var n,i,a=f.platformPrefix={O:"-o-",MS:"-ms-",Moz:"-moz-",WebKit:"-webkit-"},u="",s=t.documentElement,c=f.styles=[],l=e.getComputedStyle,h="requestAnimationFrame",m="cancelAnimationFrame",p=e[h],v=e[m];if(!p){for(n in a)if(p=e[(n=n.toLowerCase())+d(h)],v=e[n+d(m)],p)return!0;p||(p=function(e){setTimeout(e,1e3/60)}),v||(v=function(e){clearTimeout(e)}),e[h]=p,e[m]=v}if(l){i=l(s,"");for(n in i)isNumeric(n)&&c.push(i[n])}else{i=s.currentStyle;for(n in i)c.push(n.unCamelCase())}for(var g=0,b=c.length;b>g;g++)if(n=c[g],"-"===n.charAt(0))for(var y in a){var k=a[y];0==n.indexOf(k)&&(""===u&&(u=k),o[n.substring(k.length).camelCase()]=n)}r.prefix=u}(),f}(),W.count=function(e){var t=0,r={}.hasOwnProperty;if(s(e)||a(e))t=e.length;else if(u(e))if("length"in e&&o(e.length))t=e.length;else for(var n in e)r.call(e,n)&&t++;else t++;return t},p=W.func=function(e,t){if(e==n)return function(){};if(isBool(e))return function(){return e};a(e)&&(e=new Function(e));var c=r,f=r,d=0,m=!1,v=!1,g=!1,b=!0,y=" ",k="array",w="object",x="string",_=[Array,s,k],S=[Object,u,w],T=[String,a,x],C=function(t,r,i,o,a){var u,c=f||this;if(t===n)0!==d&&d.call(c),u=e.call(c);else if(m===!0&&s(t))for(var l=0,p=t.length;p>l;l++)C.call(c,t[l],r,i,o,a);else if(g===!0&&typeof t===x)-1===t.indexOf(" ")?e.call(c,t,r,i,o,a):h(t,function(t,n){e.call(c,n,r,i,o,a)},!1,y);else if(v===!0&&typeof t===w)for(var k in t)e.call(c,k,t[k],i,o,a);else 0!==d&&d.call(c,t,r,i,o,a),u=e.call(c,t,r,i,o,a);return u===n&&b===!0&&(u=c),u};if(u(t)){var F=t.each||t.a,A=t.split||t.b,N=t.parent||t.c,L=t.delay||t.d,E=t.packages||t.f;if(f=t.bind||t.e,t.rebuild&&(e=p.rebuild(e)),t.chaining===!1&&(b=!1),a(A)&&(y=A),o(L)&&(c=L),s(F)?h(F,function(e,t){_.has(t)?m=!0:S.has(t)?v=!0:T.has(t)&&(g=!0)}):u(F)&&(l(F[k])||(m=F[k]),l(F[w])||(v=F[w]),l(F[x])||(g=F[x])),i(N)?d=N:s(N)&&(d=function(){for(var e=0,t=arguments,r=N.length;r>e;e++)N[e].apply(this,t)}),E){var z=C;C=function(){var e=this,t=arguments;return W.use(E,function(){z.apply(f||e,t)}),b===!0?e:n}}}else o(t)&&(c=t);return c!==r?function(){var e=f||this,t=arguments;return setTimeout(function(){C.apply(e,t)},c),e}:C},p.exec=function(e,t){return p(e,t)()},p.malloc=function(e,t){var r="prototype",n=function(){e.apply(this,t)};return n[r]=e[r],new n},p.rebuild=function(){},v=W.model=function(e,t){if(a(e)){if(t===n)return W.models[e]}else t===n&&u(e)&&(t=e);return i(t)&&(t=t()),u(t)?(a(e)&&(W.models[e]=t),t):{}},function(){var e="__Std__",t="__StdPool__",o="names",c="emits",l="events",f="prototype",d="protected",y="defineProperty";g=W.module=function(t,o,c){if(a(t)){if(o===n)return W.modules[t]||r}else c=o,o=t;c===n&&(c=W),i(o)&&!u(o=o.call(c))&&W.debug({path:"Std.module",description:"illegal parameter"});var k=g.inheritance,w=o.model||o.a;a(w)&&(w=w.split(" ")),s(w)?h(w,function(e,t){var n=r;a(t)?n=v(t):u(t)&&(n=t),n==r&&a(t)&&W.debug({path:"Std.module",description:"load model failed,model "+t+" doesn't exist."}),g.loadModel(o,n)}):u(w)&&g.loadModel(o,w);var x=o.parent||o.b||r,_=o[l]||o.c||[],S=o.mix||o.d||r,T=o.option||o.e||r,C=o.static||o.f,F=o.extend||o.g||{},N=o.private||o.h,L=o[d]||o.i,E=o.public||o.j,z=o.main||o.k||p(),H=o.entrance||o.l,D=o.action||o.m||{},P=o.__constructor__||o.z,j=z,B=r;a(x)&&!(x=c.modules[x])&&W.debug({path:"Std.module",description:"parent module "+o.parent+" doesn't exist."});var M=function(){var e=arguments;x.apply(this,e),z.apply(this,e)};i(P)?(j=P,i(x)&&k(j,x)):1===o.type?i(x)?(j=function(e,t,r,n,i){return new M(e,t,r,n,i)},k(j,x),k(M,x)):(j=function(e,t,r,n,i){return new z(e,t,r,n,i)},z[f]=j[f]={}):i(x)&&(j=M,k(j,x));var O=j[f],R=function(e,t,r){if(x&&g.isProtected(x,e))return W.debug({path:"Std.module",description:"member '"+e+"' is protected."}),!1;var n;if(n=u(t)?t.value:t,W.init[y]){var i=u(t)?t:{configurable:!1,enumerable:1===r,writable:!0,value:n};Object[y](O,e,i)}else O[e]=n;return!0};if(a(_)&&(_=_.split(" ")),i(x)&&(x[f][e]&&(_=_.union(x[f][e][l])),g.extendMembers(j,F,x),m(j,x,3)),T!==r){var q={};if(i(x)){var I=x[f][e];u(I)&&(T=I.option.get(T))}T=q=new A(T),j.opts=function(e){return e===n?T:(T&&T.set(e),void 0)},O.opt=function(e,t,r){var i=this;if(t===n)return i.opts[e];if(i.opts[e]=t,"function"==typeof r){var o=r.call(i);if(o!==n)return o}return i},O.init_opts=function(e){return u(e)||(e={}),this.opts=q.get(e)},O.call_opts=function(t,r){var n=this,o=n.opts,c=n[e].option;if(a(t))i(n[t])||W.debug({path:"Std.module",memberName:"call_opts",description:"function "+d+" doesn't exist."}),r===!0?o[t]!==c.get(t)&&n[t](o[t]):n[t](o[t]);else if(s(t))for(var l=0,f=t.length;f>l;l++){var d=t[l];i(n[d])||W.debug({path:"Std.module",memberName:"call_opts",description:"function "+d+" doesn't exist."}),r===!0?o[d]!==c[d]&&n[d](o[d]):n[d](o[d])}else if(u(t))for(var d in t)i(n[d])||W.debug({path:"Std.module",memberName:"call_opts",description:"function "+d+" doesn't exist."}),r===!0?o[d]!==t[d]&&n[d](o[d]):n[d](t[d]);return n}}s(S)?h(S,function(e,t){m(j,t,3),h(t[f],function(e,t){R(e,t,1)})}):(u(S)||i(S))&&(m(j,S,3),h(S[f],function(e,t){R(e,t,1)})),u(C)&&m(j,C,3),u(L)&&h(L,function(e,t){B||(B=[]),R(e,t,2)&&B.push(e)}),u(N)&&h(N,function(e,t){R("_"+e,t,3)}),u(E)&&h(E,function(e,t){R(e,t,1)}),i(H)&&H.call(j,j,O),u(D)||(D={}),i(x)&&(D=m(m({},x[f][e].action,3),D)),h(D,function(e,t){b[0](t,O[e])?D[e]=O[e]:i(t)&&(D[e]=t)}),h(O,function(e,t){i(t)&&(t.__StdName__=e)});var U={type:o.type||0,model:w||r,parent:x,option:T,events:_,action:D,"protected":B||r,main:z};return W.init[y]&&Object[y](O,e,{configurable:!1,enumerable:!1,writable:!0,value:U}),O[e]=U,a(t)&&(c.modules[t]=j),j},g.inheritance=function(e,t){var r=p();return r[f]=t[f],e[f]=new r,e[f].constructor=e,e},g.extendMembers=function(e,r,a){return h(r,function(r,u){var s=a[f][r],l=function(e){var n=e[t];if(n[c]&&n[c][r]){for(var i=0,a=n[c][r],u=a.length;u>i;i++)e.emit.apply(e,a[i]);n[o][r]=!1,n[c][r].length=0}};i(s)&&i(u)&&(e[f][r]=function(){var e=this,i=arguments,a=e[t],c=!1;a?a[o][r]!==!0&&(a[o][r]=c=!0):(e[t]=a={names:{}},a[o][r]=c=!0);var f=s.apply(e,i);return f!==e&&f!==n?(c&&l(e),f):((f=u.apply(e,i))===n&&(f=e),c&&l(e),f)})}),e},g.loadModel=function(e,t){var r=t[l]||t.c,n=e[l];return a(r)&&(r=r.split(" ")),s(r)&&(n?(a(n)&&(n=n.split(" ")),s(n)&&(e[l]=[].union(r,n))):e[l]=r),h({parent:"b",main:"k",entrance:"l"},function(r,n){var i=t[r]||t[n],o=e[r]||e[n];!o&&i&&(e[r]=i)}),h({mix:"d",option:"e","static":"f",extend:"g","private":"h","protected":"i","public":"j",action:"m"},function(r,n){var i=t[r]||t[n];if(u(i)){var o=m(m({},i,3),e[r]||e[n]);e[n]?e[n]=o:e[r]=o}}),e},g.property=function(t,i,o){var a,s=t;if(o!==!0)return(a=s[f][e])?a[i]:r;for(var c=[];(a=s[f][e])&&u(a)&&a[i]!==n&&(c.push(a[i]),s=a.parent););return c},g.isProtected=function(t,r){for(var n,i=t;(n=i[f][e])&&u(n);){if(s(n[d])&&n[d].has(r))return!0;if(!(i=n.parent))break}return!1}}(),b=W.mold={0:function(e,t){return a(e)&&i(t)},1:function(e){return a(e)||o(e)},2:function(e,t){return t in e?e[t]:e[t]={}},3:function(e,t){return t in e?e[t]:e[t]=[]},or:function(e,t){for(var r=!1,n=0,i=e.length;i>n;n++)if(e[n]===t){r=!0;break}return r},ins:function(e,t){a(e)&&(e=e.split(" "));for(var r=0,n=e.length;n>r;r++)if(!(e[r]in t))return!1;return!0},ui:function(e,t,n){var o=r;if(i(n)&&(n=n()),a(t)){var s={text:t};n&&m(s,n),o=M(e,s)}else f(t)?o=t:u(t)&&(u(n)&&m(t,n),o=M(t.ui||e,t));return o},dataPath:function(e,t){if(!u(e)||!a(t)||l(t))return e;var r=e;return W.each(t,function(e,t){return(t=t.trim())in r?(r=r[t],void 0):!1},!1,"."),r}},A=W.options=g({f:{data:{},get:function(e,t){var r=A.data[e];return r?r.get(t):{}}},j:{get:function(e){if(a(e))return this.data.prototype[e];var t=new this.data;if(!u(e))return t;for(var r in e)t[r]=e[r];return t},set:p(function(e,t){this.data.prototype[e]=t},{each:[s,u]}),remove:p(function(e){delete this.data.prototype[e]},{each:[s]})},k:function(e,t){var r=this;if(r instanceof A)return r.data=p(),r.set(e);if(u(e))for(var n in e)A(n,e[n]);else a(e)&&u(t)&&(A.data[e]=new A(t));return A}}),W.create=function(e){if(a(e)){var t=W.modules[e];return t==r?t:p.malloc(t,Array.slice(arguments,1))}},W.unite=function(e,t,c){var l="prototype",f=W.unite.addMember,d=p(),m=t||p(),v=W.unite.methods;return d[l]=e[l],m[l]={length:0,_:function(e){var t=this,c=r;return e===n?c=t:a(e)?c=v[e].apply(t,Array[l].slice.call(arguments,1)):s(e)?c=v.merge.call(t,e):o(e)?c=t[e]:(i(e)||u(e))&&(c=v.push.call(t,e)),c},each:function(e){return v.each.call(this,e)}},h(new d,function(e,t){i(t)&&f(m,e)}),h(c,function(e,t){i(t)&&f(m,e)}),m},W.unite.addMember=function(e,t){e.prototype[t]=function(){for(var e=this,r=0,n=e.length;n>r;r++){var i=e[r][t];i&&i.apply(e[r],arguments)}return e}},W.unite.methods=function(){var e=Array.prototype,t={push:function(e){return this[this.length++]=e},splice:function(t,r){return e.splice.call(this,t,r),this},indexOf:function(t,r){return e.indexOf.call(this,t,r)},has:function(t){return e.has.call(this,t)},remove:function(e){return e===n?this.clear():t.splice.call(this,e,1)},clear:function(){for(var e=this;e.length>0;)delete e[--e.length];return e},merge:function(e){u(e)||W.debug({path:"Std.unite.methods",memberType:"static",memberName:"merge",description:"illegal parameter"});for(var t=this,r=0,n=e.length;n>r;r++)t[t.length++]=e[r];return t},each:function(e){i(e)||W.debug({path:"Std.unite.methods",memberType:"static",memberName:"each",description:"illegal parameter"});for(var t=this,r=0,n=this.length;n>r&&e.call(t[r],r,t[r])!==!1;r++);return t}};return t}(),v("events",function(){var e="emits",t="__StdPool__",o="__StdEvents__";return{j:{eventExist:function(e,t){var r=this[o];return r&&r[e]?i(t)?r[e].has(t):!0:!1},eventAssign:function(e,t){var n=this;if(!i(t))return n;if(a(e)&&(e=e.split(" ")),s(e))for(var o=e.length,u=[],c=0,l=function(e,i){u[e]=r,n.once(i,function(r){u[e]=r,++c==o&&t.apply(n,u)})},f=0;o>f;f++)l(f,e[f]);return n},on:p(function(e,t){var r=this,n=b[2](r,o);if(b[0](e,t)){var i=n[e];i||(i=n[e]=[]),i.push(t)}return r},{each:[s,u,a]}),off:p(function(e,t){var r=this,a=r[o];e===n?h(a,function(e){r.off(e)}):t===n&&e in a?a[e].clear():a&&i(t)&&h(a[e],function(r,n){n===t&&a[e].remove(r)})},{each:[s,u,a]}),once:p(function(e,t){var r=this;if(b[0](e,t)){var n=function(i){return r.off(e,n),t.call(r,i)};r.on(e,n)}},{each:[s,u,a]}),emit:p(function(e,t,r){var n,a=this,u=a[o];if(isBool(e))return a.emitTurn=e,a;if(!u||!(n=u[e])||a.emitTurn===!1)return a;var s=n.length,c=r===!0?"apply":"call";if(1===s)return n[0][c](a,t),void 0;for(var l=0;s>l;){var f=n[l];i(f)&&f[c](a,t),f===n[l]&&l++}},{each:[s,a]}),__emit__:function(){var r=this,n=r[t],i=arguments,o=i.callee.caller.__StdName__;return n&&n.names[o]?(n[e]||(n[e]={}),n[e][o]?n[e][o].push(i):n[e][o]=[i],r):r.emit.apply(r,i)}}}}()),k=W.events=g({a:"events",f:{connect:function(e,t,r,n){var o="__StdConnection__",u=function(){var e=arguments;return i(n)?n.apply(r,e):b[0](n,r[n])?r[n].apply(r,e):(s(n)&&h(n,function(t,n){if(a(n)){if(i(r[n])&&r[n].apply(r,e)===!1)return!1}else if(i(n)&&n.apply(r,e)===!1)return!1}),void 0)};return e[o]||(e[o]={}),e[o][t]||(e[o][t]=[]),e[o][t].push({source:e,sourceEvent:t,target:r,targetMethod:n,handle:u}),e.on(t,u),k},disconnect:function(e,t,r,n){var i="__StdConnection__";if(!e||!e[i])return k;if(!e[i][t]){for(var t in e[i])k.disconnect(e,t);return k}return r?(h(e[i][t],function(o,a){(!n||a.target===r&&a.targetMethod===n)&&(a.source.off(t,a.handle),e[i][t].remove(o))}),k):(h(e[i][t],function(r,n){k.disconnect(e,t,n.target)}),k)}},k:function(e){u(e)&&this.on(e)}}),W.model("hooker",function(){var e="__StdHook__",t=function(t){return e in t||(t[e]={hooks:{},hands:{}}),t[e]};return{j:{hook:p(function(e,r){var n=this,i=t(n),o=i.hooks;e in o?o[e].push(r):(o[e]=[r],i.hands[e]=function(){for(var t=0,r=o[e].length;r>t;t++)if(o[e][t].apply(this,arguments)===!1)return!1;return!0})},{each:[u,s,a]}),unhook:p(function(e,r){var i=this,o=t(i),a=o.hooks;return e in a?(r===n?(delete a[e],delete o.hands[e]):h(a[e],function(e,t){return t===r?(this.remove(e),!0):void 0}),void 0):!1},{each:[u,s,a]}),act:function(e){var r=this,n=t(r),i=n.hands;return e in i?i[e].apply(r,Array.slice(arguments,1)):!0}}}}),W.hooker=g({a:"hooker",f:{hijack:function(e,t,r){var o,s,c;if(i(e)&&i(t))s=e,c=t;else{if(!((i(e)||u(e))&&a(t)&&i(e[t])&&i(r)))return e;s=e[t],c=r,o=!0}var l=function(){var e=this,t=arguments,r=c.call(e,t);return r===n?s.apply(this,t):r};return o&&(e[t]=l),l}},k:function(e){u(e)&&this.hook(e)}}),w=W.queue=g({a:"events",e:{auto:!1,tasks:r,timeout:0,interval:0},h:{pos:0,retry:0,timer:r},j:{length:0,pos:function(){return this._pos},timeout:function(e){return this.opt("timeout",S.timeUnit(e,"ms"))},interval:function(e){return this.opt("interval",S.timeUnit(e,"ms"))},auto:function(e){return this.opt("auto",e)},prev:function(){return this.jump(this._pos-1,arguments)},next:function(){return this.jump(this._pos+1,arguments)},done:function(){return this.next()},has:function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return!0;return!1},push:p(function(e){var t=this;i(e)&&(t[t.length++]=e)}),merge:function(e){var t=this;if(s(e))for(var r=0,n=e.length;n>r;r++)i(e[r])&&(t[t.length++]=e[r]);return t},error:function(e){var t=this;return i(e)?t.on("error",e):t.emit("error",[t._pos,e],!0),t},complete:function(e){var t=this;return i(e)?t.on("complete",e):t.emit("complete",e,!0),t},jump:function(e,t){var r=this,n=r.length;return r._retry=0,0>e?r:(n-1>=e&&r[r._pos=e].apply(r,t),e===n&&r.complete(t),r.emit("jump",[e,t],!0))},exec:function(){for(var e=this,t=e.length,r=0;t>r;r++)e[e._pos=r].apply(e,arguments);return r>=t-1&&e.complete(),e},start:function(){var e=this,t=e.opts;return t.timeout>0&&(e._timer=setTimeout(function(){e.emit("timeout")},t.timeout)),e.length>0&&e[0].apply(e,arguments),e.emit("start")},retry:function(e,t,r){var n=this,o=n._pos;return n._retry++<e?setTimeout(function(){n[o].apply(n,t)},n.interval()):(i(r)&&r.call(n,o),n.error(t)),n},remove:function(e){var t=this;if(e===n)t.clear();else if(o(e)){delete t[e];for(var r=e+1;r<t.length;r++)t[r-1]=t[r],delete t[r];t.length--}else if(i(e))for(var r=t.length;r--;)if(t[r]===e){t.remove(r);break}return t},clear:function(){for(var e=this,t=e.length;t>=0;t--)delete e[t];return e._pos=0,e.length=0,clearTimeout(e._timer),e}},k:function(e){var t=this;t._map={},t.init_opts(u(e)?e:{}),s(e)?t.merge(e):u(e)&&(s(e.tasks)&&t.merge(e.tasks),u(e.on)&&t.on(e.on))}}),W.holder=g(function(){var e="complete";return{a:"events",j:{length:0,push:p(function(e){var t=this;t.length++,t._tasks.push({hand:e})},{each:[s]}),hold:function(e){var t=this.push(e);return i(e)?(e.call(t,t,e),t.emit("hold",e)):s(e)&&h(e,function(e,r){r.call(t,t,r),t.emit("hold",r)}),t},release:p(function(t){var r=this;h(r._tasks,function(n,i){return i.hand===t?((0==r.emit("release",t).length||0==--r.length)&&r.emit(e),this.remove(n)):void 0})},{each:[s]}),complete:function(t){var r=this.once(e,t);return 0===r.length&&r.emit(e),r}},k:function(t){var r=this;r._tasks=[],i(t)?r.on(e,t):s(t)&&r.hold(t)}}}),v("plugin",{"public":{plugin:p(function(e,t){var r=this,i=b[2](r instanceof j?r.dom:r,"__StdPlugins__");return t===n?i[e]||null:(i[e]=y(e,r,t),void 0)},{each:[u]}),removePlugin:p(function(e){var t=this,r=b[2](t instanceof j?t.dom:t,"__StdPlugins__");if(e===n)for(var i in r)r[i]&&r[i].remove(),delete r[i];else e in r&&(r[e].remove(),delete r[e])})}}),y=W.plugin=g({f:{modules:{},exist:function(e){return e in y.modules},create:function(e,t,n){var o=b[2](t,"plugins");return e in o&&(i(o[e].remove)&&o[e].remove(),delete o[e]),a(e)?(y.exist(e)||W.debug({path:"Std.plugin",memberType:"static",memberName:"create",description:"plugin "+e+" doesn't exist"}),new y.modules[e](t,n)):r},module:function(e,t){if(a(e)){if(t===n)return y.exist(e)||W.debug({path:"Std.plugin",memberType:"static",memberName:"module",description:"plugin "+e+" doesn't exist"}),y.modules[e]||r}else t=e;a(e)&&i(t)&&(t=t.call(W,y)),t=m({},t);var o,u=[],s="prototype";return t.__constructor__=function(e,t){var n=this,i=n.opt?n.init_opts(t||{}):r;n.owner=e,t.on&&n.on(t.on),n.emit("create");for(var o=u.length-1;o>=0&&u[o].call(n,n,i,e)!==!1;o--);},(o=g(e,t,y))===r?o:(o[s].remove=p(),o[s].pluginName=e,h("on off once emit __emit__",function(e,t){o[s][t]=k[s][t]}),u=g.property(o,"main",!0),o)}},k:function(e,t,i){return t===n&&a(e)?y.modules[e]||r:y.create(e,t,i)}}),y.module("drag",{e:{x:!0,y:!0,opacity:.7,handle:0,draggable:!0},j:{draggable:function(e){return this.opt("draggable",e)}},k:function(r,n,i){var o,a,u,s,c,l,d,h,m,p,v=j(i),g=0,b=1,y=j(t),k=v.offsetParent(),w=M.status;n.handle||(n.handle=v),n.on&&r.on(n.on),p=f(n.handle)?n.handle[0]:j(n.handle);var x=function(t){1!=w.resize&&(y.on({mousemove:S,mouseup:_}),g=1,b=v.opacity(),o=v.outerWidth(),a=v.outerHeight(),c=t.pageX-v.offsetLeft()-(int(k.css("borderLeftWidth")||0)||0),l=t.pageY-v.offsetTop()-(int(k.css("borderTopWidth")||0)||0),k.is("body")?(d=j(e).width(),h=j(e).height()):(d=k.clientWidth(),h=k.clientHeight()))},_=function(e){y.off({mousemove:S,mouseup:_}),m&&m.remove(),0!=g&&1==w.drag&&(w.drag=0,v.opacity(b),r.emit("stop",[e.pageX-c,e.pageY-l],!0))},S=function(e){if(1==w.resize)return g=0,_(e),!1;if(1==g){var t=v.css("position");"absolute"!==t&&"fixed"!==t&&v.css("position","absolute"),v.opacity(n.opacity),m=M("locker",{renderTo:"body",cursor:"move",opacity:0,visible:!0}),g=2,w.drag=1,r.emit("start",[e.pageX-c,e.pageY-l],!0)}return 2==g&&(n.x&&(u=e.pageX-c,0>u?u=0:u+o>d&&(u=d-o),v.left(u)),n.y&&(s=e.pageY-l,0>s?s=0:s+a>h&&(s=h-a),v.top(s))),!1};p.on("mousedown",function(e){1==e.which&&1==n.draggable&&(e.preventDefault(),x(e))})}}),y.module("drop",{e:{},j:{},k:function(){}}),y.module("resize",{e:{top:!0,right:!0,bottom:!0,left:!0,opacity:.35,resizable:!0,className:"",minWidth:10,minHeight:10,border:"1px dotted #24415D",background:"rgb(90,176,249)",cssPosition:"absolute"},c:"start stop",j:{resizable:function(e){return this.opt("resizable",e)}},k:function(r,n,i){var o,a,u,s,c,l,f,d,h,m,p,v,g,b,y,k,w,x=j(i),_=0,S=0,T=0,C=x.style("cursor"),F="",A=j(e),N=j(t),L=x.offsetParent(),E=M.status;L.contains("body")&&(L=A);var z=function(){c=x.offset(),v=c.x,g=c.y,m=i.width(),p=i.height()},H=function(e){return z(),d=L.offsetWidth()||L.width(),h=L.offsetHeight()||L.height(),_=i.minWidth(),S=i.minHeight(),m=i.width(),p=i.height(),b=e.pageX,y=e.pageY,w=x.offsetTop(),k=x.offsetLeft(),a=newDiv(n.className).css({position:n.cssPosition,opacity:n.opacity,border:"1px dotted #24415D",background:n.background}).appendTo(L.is(A)?"body":L),s=a.boxSize(),u=L.boxSize(),l=u.borderTopWidth+u.borderBottomWidth,f=u.borderLeftWidth+u.borderRightWidth,a.css({width:m-s.width,height:p-s.height,left:k,top:w,zIndex:E.zIndex+2,cursor:F}),N.on({mousemove:P,mouseup:D}),o=M("locker",{renderTo:"body",cursor:F,opacity:0,visible:!0}),r.emit("start"),!1},D=function(){var e=a.offsetWidth(),t=a.offsetHeight(),n=a.offsetLeft(),u=a.offsetTop(),s={width:e,height:t,left:n,top:u};i.width(e).height(t).left(n).top(u),o.remove(),a.remove(),N.off({mousemove:P,mouseup:D}),z(),E.resize=0,r.emit("stop",s)},P=function(e){var t=e.pageX,r=e.pageY,i=function(){var e=w+r-y,t=p+y-r;t<n.minHeight||S>t||(0>e&&(e=0,t=p+w),a.css({top:e,height:t-s.height}))},o=function(){var e=m+t-b;e<n.minWidth||_>e||(e+k>d+l&&(e=d-k-l),a.width(e-s.width))},u=function(){var e=p+r-y;e<n.minHeight||S>e||(e+w>h+f&&(e=h-w-f),a.height(e-s.height))},c=function(){var e=k+t-b,r=m+b-t;r<n.minWidth||_>r||(0>e&&(e=0,r=m+k),a.css({left:e,width:r-s.width}))};switch(T){case 1:i();break;case 2:o();break;case 3:u();break;case 4:c();break;case 5:i(),c();break;case 6:i(),o();break;case 7:u(),o();break;case 8:u(),c()}},B=function(e){if(n.resizable&&1!=E.resize&&0==E.drag){var t=T,r="",i=e.pageX,o=e.pageY,a=n.top&&o>=g&&g+6>o,u=n.right&&i>v+m-6&&v+m>i,s=n.bottom&&o>g+p-6&&g+p>o,c=n.left&&i>=v&&v+6>i;a&&c?5!=T&&(T=5,r="nw-resize"):a&&u?6!=T&&(T=6,r="ne-resize"):s&&u?7!=T&&(T=7,r="se-resize"):s&&c?8!=T&&(T=8,r="sw-resize"):a?1!=T&&(T=1,r="n-resize"):u?2!=T&&(T=2,r="e-resize"):s?3!=T&&(T=3,r="s-resize"):c?4!=T&&(T=4,r="w-resize"):0!=T&&(T=0,r=C),t!=T&&(F=r,x.css("cursor",r))
}},O=function(e){1==e.which&&0!=T&&(E.resize=1,e.preventDefault(),z(),H(e))},W=0;return x.on("mouseenter",function(){z(),0==W&&(W=1,i.on({mousemove:B,mousedown:O}))}),!1}}),y.module("contextMenu",{e:{menuUI:"Menu",menuOpts:r,handle:r,items:r,width:"auto",renderTo:"body",animation:r},f:{move:function(t,r,n,i){var o=t.width(),a=t.height(),u=j(i),s=u.offsetWidth(),c=u.offsetHeight(),l=j(e);u.is("body")&&(s=l.width(),c=l.height()),t.move(r+o>s?s-o:r,n+a>c?c-a:n)}},i:{init:function(){var e=this,t=e.opts,r=function(){e.hide()},n=e.menu=M(t.menuUI,m(t.menuOpts||{},{items:t.items,width:t.width,visible:!1,renderTo:t.renderTo,animation:t.animation}));n.on({click:r,mousedown:p(!1),itemPress:function(t){r(),e.emit("itemPress",t)}}),n[0].css("position","absolute"),t.on&&n.on(t.on)},resize:function(e,t){y("contextMenu").move(this.menu,e,t,this.opts.renderTo)}},j:{handle:function(e){return this.opt("handle",e)},show:function(){var e=this,t=e.menu;return t&&!t.visible()&&(t.show(),e.emit("show")),e},hide:function(){var e=this,t=e.menu;return t&&t.visible()&&(t.hide(),e.emit("hide")),e},remove:function(){var e=this,r=e.menu;return f(r)&&r.remove(),j(e.owner).off("contextmenu",e._contextMenu),W.dom(t).off("mousedown",e._docEvent),e}},k:function(e,n,i){var o=r,a=!1,u=r;j(t).on("mousedown",e._docEvent=function(){var t=e.menu;t&&t.visible()&&(o=setTimeout(function(){e.hide()},1))}),j(i).on("contextmenu",e._contextMenu=function(t){var r=j(n.handle,i);if(0==a&&(a=!0,e.init()),f(e.menu)&&j(n.renderTo)&&(!r||r.contains(t.target))){if(clearTimeout(o),e.menu.visible()){if(u===t.target)return e.hide(),!1}else e.show();return e.resize(t.pageX,t.pageY),u=t.target,!1}})}}),W.validator=p(),x=W.is=g({f:{number:function(e){return isNumeric(e)},blankChar:function(e){return"\r"===e||"\n"===e||" "===e||" "===e},alnum:function(e){return e>="0"&&"9">=e||e>="a"&&"z">=e||e>="A"&&"Z">=e||"_"===e},validAlNum:function(e){if(""===e)return!1;for(var t=e.length-1,r=x.alnum;t>=0;t--)if(!r(e.charAt(t)))return!1;return!0},singleTag:function(){var e={};return h("input link meta img param br hr",function(t,r){e[r]=1}),function(t){return t in e}}(),operatorChar:function(){var e={};return h("+ - * / = ! > < ~ | $ ^",function(t,r){e[r]=1}),function(t){return t in e}}(),color:function(e){var t=!0,n=(e=e.toLowerCase()).length,i=x.validAlNum;if("#"===e.charAt(0)){var o=e.substr(1,n-1),a=n-1;if(!i(o)||3!=a&&6!=a)return!1;for(var u,s=0;a>s;s++)if((u=o.charAt(s))>"f")return!1}else if(i(e)&&25>n)t=e in S.colors;else if(n>=11&&"rgb"===e.substr(0,3)){var c=3;if("a"===e.charAt(3)&&c++,"("!==e.charAt(c)&&")"!==e.charAt(n-1))return!1;var l=e.substring(c+1,n-1);if(l!==r){var f=(l=l.split(",")).length;if(c!==f)return!1;h(l,function(e,r){return!x.number(r)||0>~~r||~~r>255?t=!1:void 0})}}else t=!1;return t},keyword:function(){var e="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".split(",");return function(t){return e.has(t)}}(),DOM:function(e){return u(e)&&(isElement(e)||e instanceof j)},ie:function(e){var t=W.init.ie;return e==r?t.n:t[e]||!1}},k:function(e,t){var r=!0;if(e===t)return r;if(e instanceof RegExp)return e.test(t);switch(e){case"Number":r=x.number(t);break;case"String":r=a(t)&&!l(t);break;case"Function":r=i(t);break;case"Object":r=u(t);break;case"PlainObject":r=c(t);break;case"Array":r=s(t);break;case"Empty":r=l(t);break;case"NonEmpty":r=!l(t);break;case"Element":r=isElement(t);break;case"Widget":r=f(t);break;case"Layout":r=d(t);break;default:x.DOM(e)&&x.DOM(t)?r=j(e).is(t):e in x&&(r=x[e](t))}return r}}),_=W.crypto={},S=W.convert=g(function(){var e=Math.min,t=Math.max,i=Math.round;return{f:{percent:function(e,t){return o(t)?float(100*(e/(t||100))):(a(e)&&(e="from"===e?0:"to"===e?100:"%"===e.charAt(e.length-1)||x.number(e)?float(e):r),e)},timeUnit:function(e,t,r){if(o(e))return e;if(a(e)&&r===n){r=t;for(var i=e.length,u=i-1;u>=0;u--){var s=e.charAt(u);if(s>="0"&&"9">=s){t=e.substring(u+1,i)||"ms",e=int(e.substr(0,u+1));break}}return 0>u?0:S.timeUnit(e,t,r)}var c=1e3,l={us:c,ns:c*c},f={s:c,m:60*c,h:60*60*c,d:24*60*60*c},d=function(e,t,r){var n;if("ms"==t)return e;if(t in l)n=!0;else{if(!(t in f))return 0;n=!1}return 1==r?n?e/l[t]:f[t]*e:n?l[t]*e:e/f[t]};return c=t===r?e:"ms"===r?d(e,t,1):d(d(e,t,1),r,0)},hex2rgb:function(e){function t(t){return e.charAt(t)}return"#"===e.charAt(0)&&(e=e.substr(1)),3==e.length&&(e=t(0)+t(0)+t(1)+t(1)+t(2)+t(2)),{r:int(t(0)+t(1),16),g:int(t(2)+t(3),16),b:int(t(4)+t(5),16)}},rgb2hex:function(e,t,r){u(e)&&(t=e.g,r=e.b,e=e.r);for(var n=(65536*~~e+256*~~t+~~r).toString(16);n.length<6;)n="0"+n;return"#"+n},hsv2rgb:function(e,t,r){if(u(e)&&(t=e.s,r=e.v,e=e.h),e=i(e),t=i(255*t/100),r=i(255*r/100),0==t)return{r:r,g:r,b:r};var n=r,o=(255-t)*r/255,a=(n-o)*(e%60)/60,s=0,c=0,l=0;return 360==e&&(e=0),60>e?(s=n,l=o,c=o+a):120>e?(c=n,l=o,s=n-a):180>e?(c=n,s=o,l=o+a):240>e?(l=n,s=o,c=n-a):300>e?(l=n,c=o,s=o+a):360>e&&(s=n,c=o,l=n-a),{r:i(s),g:i(c),b:i(l)}},rgb2hsv:function(r,n,o){u(r)&&(n=r.g,o=r.b,r=r.r);var a=e(r,n,o),s=t(r,n,o),c=s-a,l=0,f=0,d=s*(100/255);return 0!=s&&(f=255*c/s),l=0==f?-1:r==s?(n-o)/c:n==s?2+(o-r)/c:4+(r-n)/c,(l*=60)<0&&(l+=360),{h:e(360,i(l)),s:i(f*=100/255)||0,v:i(d)||0}},rgb:function(e){var t=r;return"rgb"==e.left(3).toLowerCase()&&(e=e.between("(",")"))!==r&&(e=e.split(",")).length>=3&&(t={r:~~e[0],g:~~e[1],b:~~e[2]},4==e.length&&(t.a=float(e[3]))),t},hsv:function(e){var t=r;return"hsv"==e.left(3).toLowerCase()&&(e=e.between("(",")"))!==r&&3==(e=e.split(",")).length&&(t={h:~~e[0],s:~~e[1],v:~~e[2]}),t},color:function(e){var t=(e=e.trim().toLowerCase()).length,n=S.colors,i=S.hex2rgb,o=r;return 8>t&&"#"===e.charAt(0)?o=i(e):25>t&&e in n?o=i(n[e]):t>9&&("rgb"==e.substr(0,3)||"rgba"==e.substr(0,4)?o=S.rgb(e):"hsv"===e.substr(0,3)&&(e=S.hsv(e),o=S.hsv2rgb(e.h,e.s,e.v))),o}},k:function(){}}}),S.colors=function(){for(var e={},t="black,navy,darkblue,mediumblue,blue,darkgreen,green,teal,darkcyan,deepskyblue,darkturquoise,mediumspringgreen,lime,springgreen,aqua,cyan,midnightblue,dodgerblue,lightseagreen,forestgreen,seagreen,darkslategray,limegreen,mediumseagreen,turquoise,royalblue,steelblue,darkslateblue,mediumturquoise,indigo,darkolivegreen,cadetblue,cornflowerblue,mediumaquamarine,dimgray,dimgrey,slateblue,olivedrab,slategray,lightslategray,mediumslateblue,lawngreen,chartreuse,aquamarine,maroon,purple,olive,gray,skyblue,lightskyblue,blueviolet,darkred,darkmagenta,saddlebrown,darkseagreen,lightgreen,mediumpurple,darkviolet,palegreen,darkorchid,yellowgreen,sienna,brown,darkgray,lightblue,greenyellow,paleturquoise,lightsteelblue,powderblue,firebrick,darkgoldenrod,mediumorchid,rosybrown,darkkhaki,silver,mediumvioletred,indianred,peru,chocolate,tan,lightgray,thistle,orchid,goldenrod,palevioletred,crimson,gainsboro,plum,burlywood,lightcyan,lavender,darksalmon,violet,palegoldenrod,lightcoral,khaki,aliceblue,honeydew,azure,sandybrown,wheat,beige,whitesmoke,mintcream,ghostwhite,salmon,antiquewhite,linen,lightgoldenrodyellow,oldlace,red,fuchsia,magenta,deeppink,orangered,tomato,hotpink,coral,darkorange,lightsalmon,orange,lightpink,pink,gold,peachpuff,navajowhite,moccasin,bisque,mistyrose,blanchedalmond,papayawhip,lavenderblush,seashell,cornsilk,lemonchiffon,floralwhite,snow,yellow,lightyellow,ivory,white".split(","),r="000000,000080,00008B,0000CD,0000FF,006400,008000,008080,008B8B,00BFFF,00CED1,00FA9A,00FF00,00FF7F,00FFFF,00FFFF,191970,1E90FF,20B2AA,228B22,2E8B57,2F4F4F,32CD32,3CB371,40E0D0,4169E1,4682B4,483D8B,48D1CC,4B0082,556B2F,5F9EA0,6495ED,66CDAA,696969,696969,6A5ACD,6B8E23,708090,778899,7B68EE,7CFC00,7FFF00,7FFFD4,800000,800080,808000,808080,87CEEB,87CEFA,8A2BE2,8B0000,8B008B,8B4513,8FBC8F,90EE90,9370DB,9400D3,98FB98,9932CC,9ACD32,A0522D,A52A2A,A9A9A9,ADD8E6,ADFF2F,AFEEEE,B0C4DE,B0E0E6,B22222,B8860B,BA55D3,BC8F8F,BDB76B,C0C0C0,C71585,CD5C5C,CD853F,D2691E,D2B48C,D3D3D3,D8BFD8,DA70D6,DAA520,DB7093,DC143C,DCDCDC,DDA0DD,DEB887,E0FFFF,E6E6FA,E9967A,EE82EE,EEE8AA,F08080,F0E68C,F0F8FF,F0FFF0,F0FFFF,F4A460,F5DEB3,F5F5DC,F5F5F5,F5FFFA,F8F8FF,FA8072,FAEBD7,FAF0E6,FAFAD2,FDF5E6,FF0000,FF00FF,FF00FF,FF1493,FF4500,FF6347,FF69B4,FF7F50,FF8C00,FFA07A,FFA500,FFB6C1,FFC0CB,FFD700,FFDAB9,FFDEAD,FFE4B5,FFE4C4,FFE4E1,FFEBCD,FFEFD5,FFF0F5,FFF5EE,FFF8DC,FFFACD,FFFAF0,FFFAFA,FFFF00,FFFFE0,FFFFF0,FFFFFF".split(","),n=0,i=t.length;i>n;n++)e[t[n]]="#"+r[n];return e}(),T=W.timer=g({a:"events",e:{delay:0,count:"infinite",timeout:0,interval:0,progress:r},f:{now:function(){return Date.time()},test:function(e,t){var r=T.now();if(o(t)&&t>1)for(var n=0;t>n;n++)e();else e();return T.now()-r}},h:{t0:0,t1:0,t2:0,t3:0,t4:0,tid:r,tid1:r,tid2:r,state:"ready"},i:{elapsedTime:0,elapsedCount:0,clock:function(e){var t=this,r=T.now();switch(e){case-1:t._t0=r,t._t1=r,t._t2=t._t3=t._t4=0;break;case 0:t._t0=t._t1=t._t2=t._t3=t._t4=0;break;case 1:t.elapsedTime=r-t._t1-t._t2;break;case 2:t._t0=r,t._t2+=r-t._t3;break;case 3:t._t0=r,t._t1=r;break;case 4:t._t4=r-t._t0;break;case 5:t._t4=t.opts.delay;break;case 6:t._t2+=t.opts.delay}return t},startTimer:function(){var e=this.stopTimer(),t=e.opts,r=t.interval,n=t.timeout;a(r)&&"auto"!=r&&(r=S.timeUnit(r,"ms")),a(n)&&(n=S.timeUnit(n,"ms")),(n-=e._t4)>0&&(e._tid2=setTimeout(function(){e.stopTimer().emit("timeout").state("ready")},n));var i=function(){if("running"!=e._state)return e.stopTimer();var n=t.count,o=e.clock(1).elapsedTime,a=++e.elapsedCount;"infinite"!==n&&a>=n?(e.stopTimer(),e.state("completed"),e.emit("progress complete",o)):(e._tid="auto"==r?requestAnimationFrame(i):setTimeout(i,r),e.emit("progress",o))};return e.state("running"),i(),e},stopTimer:function(){var e=this,t=e.opts;return"auto"==t.interval?cancelAnimationFrame(e._tid):clearTimeout(e._tid),clearTimeout(e._tid1),clearTimeout(e._tid2),e}},j:{count:function(e){return this.opt("count",e)},timeout:function(e){return this.opt("timeout",S.timeUnit(e,"ms"))},delay:function(e){return this.opt("delay",S.timeUnit(e,"ms"))},state:function(e){var t=this;return e===n?t._state:(u(e)&&W.debug({path:"Std.timer",memberType:"public",memberName:"state",description:"illegal parameter"}),t.emit("stateChange",t._state=e))},set:function(e){var t=this;return u(e)||W.debug({path:"Std.timer",memberType:"public",memberName:"set",description:"illegal parameter"}),h("count delay timeout interval on",function(r,n){n in e&&t[n](e[n])}),i(e.progress)&&t.on("progress",e.progress),t},interval:function(e){var t=this;return t.opt("interval",S.timeUnit(e,"ms"),function(){"running"==t._state&&t.startTimer()})},start:function(){var e=this,t=e.opts,r=e._state,n=t.delay;return 0===t.count||"running"===r?e:("completed"==r?e.clock(-1):"paused"==r?e.clock(2):e.clock(3),(n-=e._t4)>0?(e.state("waiting"),e._tid1=setTimeout(function(){e.clock(6).startTimer()},n)):e.startTimer(),e.emit("start"))},pause:function(){var e=this,t=e.state(),r=T.now();if("waiting"==t)e.clock(4);else{if("running"!=t)return e;e.clock(5)}return e.stopTimer().state("paused")._t3=r,e.emit("pause")},stop:function(){return this.stopTimer().reset().emit("stop")},reset:function(){var e=this.clock(0);return e.elapsedTime=0,e.elapsedCount=0,e.state("ready")},remove:function(){this.stopTimer().reset()}},k:function(e,t){var n=this,s=r;return n instanceof T?(u(e)?s=e:i(e)&&(o(t)||a(t)?s={interval:t}:u(t)&&(s=t),n.on("progress",e)),n.set(n.init_opts(s)),void 0):new T(e,t).start()}}),C=W.parser=g(function(){var e="arguments",t=x.alnum,i=x.blankChar,o=x.operatorChar;return{type:1,h:{text:"",size:0},f:{json:function(e){return(e+"").toObject()},unit:function(e){for(var n,i="",o="",a=0,u=0,s=e.length;s>a;a++)if((n=e.charAt(a))>="0"&&"9">=n)o+=n;else if("-"===n&&0==a)o+=n;else{if("."!==n)break;if(++u>1)break;o+=n}if(""===o||"-"===o)return r;for(;s>a;a++){if(!t(n=e.charAt(a))&&"%"!==n)return r;i+=n}return{type:"number",unit:i,value:float(o)}}},j:{skipWhiteSpace:function(e,t){for(;t>e&&i(this._text.charAt(e));e++);return e},hex:function(e){var r=this,n="",i=0,o=0,a={error:0,text:""};for(e++;e<r._size;e++){var u=r._text.charAt(e);if(!t(u)){e--;break}if(u.toLowerCase()>"f"){i=1;break}if(o>6){i=1;break}n+=u,o++}return 3!=o&&6!=o&&(i=1),a.text=n,a.endPos=e,a.error=i,a},keyword:function(e,r){var n=this,i=n._text.charAt(e),a="",u=0,s=2,c={text:""};for(2===r&&(e++,s=0);e<n._size;e++){var l=n._text.charAt(e);if(0===r){if(t(l)){a+=l;continue}}else if(1===r){if(l>="0"&&"9">=l){a+=l;continue}if(t(l)){u=1;break}}else{if(2===r){var f=n._text.charAt(e+1);if("\\"===l&&(f===l||f===i)){e++,a+=f;continue}if(l===i){e++,s=2;break}a+=l;continue}if(3===r){if(o(l)){a+=l;continue}}else if(4===r){if(t(l)||"-"===l||"."===l){a+=l;continue}}else if(5===r){if(t(l)||"-"===l){a+=l;continue}}else r!==l&&(a+=l)}break}return 2!=s&&(u=1),c.error=u,c.endPos=--e,c.text=a,c},htmlComment:function(e){var t=this,r=0,n={text:""},i=e;return-1===(i=t._text.indexOf("-->",e))?(r=1,i=t._size-1):(i+=2,n.text=t._text.substring(e,i+3)),n.endPos=i,n.error=r,n},argument:function(r,o){var a=this,u=0,s=0,c={};for(c[e]=[],o===n&&(o=")"),++r;r<a._size;r++){var l=a._text.charAt(r);if(","!==l){if(l===o){s=2;break}if(!i(l)){if(0!=s){u=1;break}var f=-1;if(l>=0&&9>=l)f=1;else if(t(l))f=0;else{if("'"!==l&&'"'!==l){u=1;break}f=2}var d=a.keyword(r,f);if(r=d.endPos,0!=d.error){u=1;break}c[e].push({type:f,text:d.text}),s=1}}else s=0}return 2!=s&&(u=1),c.error=u,c.endPos=r,c},pseudoClass:function(r,n){var i,o=this,a=0,u=0,s={};for(s[e]=[],++r;r<o._size;r++){var c=o._text.charAt(r);if(0!=a||!t(c)){if(1==a){if("("!==c){--r;break}0==(i=o.argument(r)).error?h(i[e],function(t,r){var i=r.text;n===!1&&2!==r.type&&(i=i.retype()),s[e].push(i)}):u=1,r=i.endPos;break}u=1;break}if(s.name=(i=o.keyword(r,5)).text,r=i.endPos,0!=i.error){u=1;break}a++}return s.error=u,s.endPos=r,s},attribute:function(e,t){var r=this,n=0,a=0,u={type:0,name:"",operator:""};for(++e;e<r._size;e++){var s=r._text.charAt(e);if(!i(s)){if("]"==s)break;if(0==n){var c=r.keyword(e,4);if(e=c.endPos,0!=c.error){a=c.error;break}u.name=c.text,n++}else if(1==n)if(o(s))u.operator+=s;else{if(""==u.operator){a=1;break}e--,n++}else if(2==n){var l=0;('"'==s||"'"==s)&&(l=2);var f=r.keyword(e,l);if(e=f.endPos,0!=f.error){a=f.error;break}u.type=l,u.value=t===!1&&2!==u.type?f.text.retype():f.text,n++}else if(3==n){a=1;break}}}return u.error=a,u.endPos=e,u}},k:function(e,t){this._text=e,this._size=t===n?e.length:t}}}),W.cookie=g({f:{get:function(e){var t=W.cookie();t||e||W.debug({path:"Std.debug",memberType:"static",memberName:"get",description:"get cookie failed! "});var i=h(t,function(t,r){return(r=r.trim()).substring(0,e.length+1)==e+"="?decodeURIComponent(r.substring(e.length+1)):void 0},!1,";");return i==n?r:i},set:p(function(e,r,i){var s="",c="";if(a(r)||o(r)?c=r:u(r)&&i===n&&(i=r),u(i)){var l,f=i.value,d=i.expires,h=i.path,m=i.domain,p=i.secure;f!==n&&(c=f),d!==n&&(o(d)||a(d)?(l=new Date,l.setTime(l.getTime()+d)):d.toUTCString&&(l=d.toUTCString),s+="; expires="+l.toUTCString()),a(h)&&(s+="; path="+h),a(m)&&(s+="; domain="+m),p===!0&&(s+="; secure")}t.cookie=e+"="+F.encodeURI(c)+s},{each:[u]}),remove:p(function(e,t){var r={expires:-1};t!==n&&m(r,t),W.cookie(e,0,r)},{each:[s,a]}),clear:function(e){var t=W.cookie;return h(t(),function(r,n){(n=n.split("=")).length>0&&t.remove(n[0],e)},!1,";"),this}},k:function(e,r,i){var o=W.cookie;return e===n?t.cookie||null:r===n?u(e)?o.set(e):o.get(e):o.set(e,r,i)}}),F=W.url=g({type:1,f:{encodeURI:function(e){return encodeURIComponent(e+"")},location:function(t){var r=e.location;if(t===n){var i=r.protocol;return{url:r.href,port:r.port||80,protocol:i.substr(0,i.length-1),hostName:r.hostname,pathName:r.pathname}}return a(t)&&(e.location=t),F},convert:function(e,t){var r="",n=F(e),i="";return"http:/"==t.left(6)||"https:/"==t.left(7)?t:a(t)?(i=n.protocol+"://"+n.host,80!=n.port&&(i+=":"+n.port),"./"==t.left(2)&&(t=n.path+t.substr(2)),r="/"===t.charAt(0)?t.substr(1):n.path+t,i+"/"+r.replace(/\/\//g,"/")):void 0},param:function(e){if(a(e))return e;var t=[],r=F.encodeURI,i=function(e,o){u(o)?h(o,function(t,r){i(e+"["+t+"]",r)}):o!==n&&t.push(r(e)+"="+r(o))};return h(e,function(e,t){i(e,t)}),t.join("&")},suffix:g({"static":{img:function(e){return"png gif jpg jpeg bmp img tiff ico".split(" ").has(e.toLowerCase())}},main:function(e){var t=e.lastIndexOf("."),r=e.length;if(-1!=t&&r-1>t){var n=e.substring(t+1,r);if(-1==n.indexOf("/"))return n}return""}})},j:{protocol:"",host:"",port:80,path:"",file:"",suffix:"",queryString:"",hashString:"",addParam:p(function(e,t){e===n&&W.debug({path:"Std.url",memberType:"public",memberName:"addParam",description:"illegal parameter"});var r,i=this,o="";t!==n?(r={},r[e]=t,o=F.param(r)):o=h(e,function(e,t){return""!=t?t:void 0},!0,"&").join("&");var a="queryString";return""!=i[a]&&(i[a]+="&"),i[a]+=o,i},{each:[u]}),toUrl:function(){var e=this,t="",r=e.host,n=e.port,i=e.path;return t+=e.protocol+"://"+r,80!=n&&(t+=":"+e.port),F.location().hostName!==r||""!=i&&"/"===i.charAt(0)||(i=F(location.href).path+i),"/"!==i.charAt(0)&&(i="/"+i),t+=i+e.file,""!=e.queryString&&(t+="?"+e.queryString),e.hashString&&(t+="#"+e.hashString),t},parse:function(e){a(e)||W.debug({path:"Std.url",memberType:"public",memberName:"parse",description:"illegal parameter"});var t=this,r="",n=e.length,i=e.indexOf("#"),o=0;if(-1!=i&&(t.hashString=e.substring(i+1,n),e=e.substr(0,i),n=e.length),i=e.indexOf("://",0),-1==i){i=0;var u=F.location();t.protocol=u.protocol,t.host=u.hostName,t.port=u.port||80}else t.protocol=e.substr(0,i).toLowerCase(),i+=3,o=e.indexOf("/",i),r=-1==o?e.substr(i,n-i):e.substr(i,o-i),i=r.indexOf(":",i),-1==i?t.host=r:(t.port=~~r.substring(i+1,r.length),t.host=r.substr(0,i));return-1!=o&&(i=e.lastIndexOf("/"),t.path=e.substr(o,i-o),""!=t.path&&(t.path+="/"),o=e.indexOf("?",i),-1==o?t.file=e.substring(i+1,n):(t.file=e.substring(i+1,o),t.queryString=e.substring(o+1,n))),i=t.file.lastIndexOf("."),-1!=i&&(t.suffix=t.file.substring(i+1,t.file.length)),t}},k:function(t){t==n&&(t=e.location.href),this.parse(t)}}),N=W.ajax=g({type:1,a:"events",e:{type:"get",cache:!0,async:!0,url:"#",data:"",delay:0,format:"text",polling:!1,timeout:0,username:"",password:"",dataType:"*",charset:"UTF-8",contentType:"application/x-www-form-urlencoded; charset=UTF-8",requestHeader:0},f:{hooker:new W.hooker,hook:function(e,t){return N.hooker.hook(e,t)},unhook:function(e,t){return N.hooker.unhook(e,t)},get:function(e,t){return N({url:e,type:"get",success:t})},post:function(e,t,r){return N({url:e,type:"post",data:t,success:r})},json:function(e,t,n){var o="get",s="",c="",l=r,f={cache:!1,dataType:"json",format:"json"};return u(e)?N(m(f,e)):a(e)?(i(t)?(s=e,l=t):i(n)&&(o="post",s=e,c=t,l=n),N(m(f,{type:o,url:s,data:c,success:l}))):N},load:function(e,t,n){var o="get",s="",c="",f=r;return l(e)?N():u(e)?N(e):(a(e)&&(s=e),i(t)?f=t:(u(t)||a(t))&&(o="post",c=t),i(n)&&(o="post",f=n),N({type:o,url:s,data:c,success:f}))}},i:{init:function(){var e=this;return"undefined"!=typeof XMLHttpRequest?e.http=new XMLHttpRequest:h(["Msxml2.XMLHTTP","Microsoft.XMLHTTP"],function(t,n){try{return e.http=new ActiveXObject(n),!1}catch(i){e.http=r}}),e},send:function(){var e=this,t=e.http,n=e.opts,i=n.data,o=n.type.toLowerCase(),a=n.timeout,u=N.hooker,f=r,d=r,m=F(n.url),v=T.now();"get"==o?(l(i)||m.addParam(i),0==n.cache&&m.addParam("_",v)):(s(f=i)||c(f))&&(f=F.param(f));var g="error",b="success",y="progress",k="complete",w="readyStateChange";return t.open(o,m.toUrl(),n.async,n.username,n.password),t.setRequestHeader("Content-Type",n.contentType),t.onreadystatechange=function(){if(u.act(w,e)){e.emit(w,t);var i=t.readyState;if(3==i){if(!u.act(y,e))return;e.emit(y,t)}else if(4==i){e.elapsed=T.now()-v;var o=t.status;if(o>=200&&300>o||304===o){if(!u.act(b,e))return;e.emit(b,e.formatResponse(t.responseText))}else{if(!u.act(g,e))return;e.emit(g,t)}n.polling===!0&&p(function(){e.send()},n.delay)(),d!==r&&(clearTimeout(d),d=r),u.act(k,e)&&e.emit(k,t)}}},e.accept(n.dataType),h(e._requestHeader,function(e,r){t.setRequestHeader(e,r)}),u.act("beforeSend",e)?(e.emit("beforeSend"),t.send(f),a>0&&(d=setTimeout(function(){e.abort(),u.act("timeout",e)&&e.emit("error timeout",t)},a)),u.act("afterSend",e)?e.emit("afterSend"):e):e}},j:{elapsed:0,http:r,status:function(){return this.http.status},statusText:function(){return this.http.statusText},type:function(e){return this.opt("type",e)},url:function(e){return this.opt("url",e)},data:function(e){return this.opt("data",e)},cache:function(e){return this.opt("cache",e)},delay:function(e){return this.opt("delay",e)},responseText:function(){return this.http.responseText},responseContentLength:function(){return this.responseHeader("Content-Length")},responseUrl:function(){return this.http.responseUrl},responseHeader:function(e){var t=this,i=t.http,o=r;return e===n?o=i.getAllResponseHeaders()||r:a(e)&&(o=i.getResponseHeader(e)||r),o},requestHeader:p(function(e,t){var r=this,i=r._requestHeader;return t===n?i[e]:(i[e]=t,void 0)},{each:[u,s]}),formatResponse:function(e){var t=this.opts.format.toLowerCase();return"json"===t?e=C.json(e):"text"===t&&(e+=""),e},accept:function(e){var t=this;if(e==n)return t.requestHeader("Accept");var r={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml,text/xml",json:"application/json,text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"};return t.requestHeader("Accept",r[e]||e)},start:function(){var e=this,t=e.delay();return t>0?p(function(){e.send()},t)():e.send(),e},stop:function(){var e=this;return e.opts.polling=!1,e.http.abort(),e},abort:function(){var e=this;return e.http.abort(),e}},l:function(e,t){h("success error complete",function(e,r){t[r]=function(e){return this.on(r,e)}})},k:function(e){var t=this,r=t.init_opts(e);t._requestHeader={},t.init(),h("success error timeout complete beforeSend afterSend readyStateChange",function(e,n){i(r[n])&&t.on(n,r[n])}),t.requestHeader(r.requestHeader),u(e)?t.start():a(e)&&(t.url(e),t.start())}}),L=W.loader=g(function(){var e="status",o="error",c="success",f="loading",d="complete";return{a:"events",f:{css:p(function(e,t){return L.element("css",e,t)},{each:[u]}),js:p(function(e,t){return L.element("js",e,t)},{each:[u]}),testLink:function(e){try{return!l(e.sheetText())}catch(t){}return!1},image:p(function(e,t){var n=new Image;return i(t)?(n.onload=function(){t.call(n,!0,n),n.onload=r},n.onerror=function(){t.call(n,!1,n),n.onerror=r},n.src=e,void 0):(n.src=e,void 0)},{each:[u]}),createElement:function(e,t){var n=r;return"css"===e?n=newDom("link").attr({type:"text/css",rel:"stylesheet",href:t}):("js"===e||"json"===e)&&(n=newDom("script").attr({src:t,async:"false",defer:"true"})),n.appendTo("head")},element:p(function(e,t,r){var n=!1,i=L.createElement(e,t=F.convert(location+"",t)),o=L.testLink,a=function(){p(r).call(i.off(),!0)};if(i&&b.ins(i.dom,"onload onreadystatechange"))i.on("load readystatechange",function(){var t=i.readyState();n||t&&!b.or(["loaded",d],t)||(a(n=!0),"js"===e&&i.remove())}),"css"===e&&"addEventListener"in i.dom&&!("onloadstart"in i.dom)&&L.image(t,function(){!n&&o(i)&&a(n=!0)});else if("css"===e){var u=new T(function(){try{o(i)&&(u.stop(),a())}catch(e){}},10);u.timeout("10s").start()}},{each:[s]})},h:{basePath:"",onlyAjax:!1},i:{length:0,success:0,error:0,loading:0,status:"none",queue:function(e){var t=this._queue;return s(t[e])?t[e]:t[e]=[]},convertUrl:function(e){var t=this._basePath;return e.has("://")||l(t)||(e=F.convert(t,e)),e},indexOf:function(e,t){var r=this._queue[e];if(s(r))for(var n=0,i=r.length;i>n;n++)if(r[n].url===t)return n;return-1},updateStates:function(e){var t=this;return e===!0?t[c]++:t[o]++,t[f]--,t},finish:function(t,r,n){var a=this,u=t[e]=r?c:o;return i(n)?(a.updateStates(r),n.call(a,t)):h(t.callbacks,function(e,n){a.updateStates(r),n.call(a,t)}),a.emit("progress "+u,[t,r],!0),0===a[f]&&a.emit(a[e]=d),a}},j:{require:function(){return this.loadFiles(Array.from(arguments))},basePath:function(e){var t=this;return e===n?t._basePath:(a(e)||W.debug({path:"Std.loader",memberType:"public",memberName:"basePath",description:"parameter must be a string"}),"/"!==e.right(1)&&(e+="/"),t._basePath=e,t)},load:p(function(e,t,o){var c=this,f="",d="",m=r;return e===n&&W.debug({path:"Std.loader",memberType:"public",memberName:"load",description:"illegal parameter"}),u(e)?(d=e.url,f=e.type,m=e.callback):a(e)&&t===n?d=e:a(e)&&s(t)?h(t,function(t,r){a(r)&&c.append(e,r,o)}):o===n?i(t)?(d=e,m=t):a(t)&&(f=e,d=t):a(e)&&a(t)&&(f=e,d=t,m=o),l(f)&&(f=F(d).suffix),c.append(f,d,m)},{each:[s]}),loadQueue:function(e,t){for(var r=this,n=new w,i=e.length,o=0;i>o;o++)n.push(function(){r.load(e[n._pos],function(){n.next()})});return n.on(d,function(){p(t).call(r)}).start(),r},loadFiles:function(e,t){var r=this;if(a(e))return r.load(e,function(e){p(t).call(r,e)});if(s(e))for(var n=0,i=e.length,o=new Array(i),u=function(e,a){o[e]=a,++n===i&&p(t).call(r,o)},c=0;i>c;c++){var l=e[c];a(l)?r.load(l,u.bind(r,c)):s(l)&&r.loadQueue(l,u.bind(r,c))}return r},append:p(function(n,o,u){function s(e){L.element(n,o,function(t,r){e&&(m.data=r,l.finish(m,t))})}var l=this;a(n)&&a(o)||W.debug({path:"Std.loader",memberType:"public",memberName:"append",description:"illegal parameter"});var d=l.queue(n),h=l.indexOf(n,o),m=r;return i(u)||(u=p()),l.length++,l[l[e]=f]++,l.emit("append"),-1!==h?(m=d[h],m.callbacks.push(u),m[e]==c&&l.finish(m,!0,u),void 0):(d.push(m={url:o,data:r,status:"none",callbacks:[]}),m.callbacks.push(u),p(function(){var e="css"===n||"js"===n,r=F(o=l.convertUrl(o)).host!==t.domain;F.suffix.img(n)?L.image(o,function(e){m.data=this,l.finish(m,e)}):l._onlyAjax||0==r?N({cache:!0,url:o,error:function(){l.finish(m,!1)},success:function(t){"sbs"===n.toLowerCase()&&(t=B(t)),m.data=t,e&&!l._onlyAjax?s(!0):l.finish(m,!0)}}):e?s(!0):L.image(o,function(){l.finish(m,!0)})},0)(),void 0)},{each:[s,u]}),remove:p(function(e,t,r){var o=this,u=o._queue;if(e in u){if(e===n)return o.clear();var s=u[e],c=s.length,l=function(e){for(var t=e.length;t>=0;t--)if(e[t]===r){e.remove(t);break}};if(t===n)for(;c>=0;c--)s[c].callbacks.clear(),s.remove(c);else if(a(t))for(;c>=0;c--)if(s[c].url===t){var f=s[c].callbacks;i(r)?l(f):(f.clear(),s.remove(c));break}}},{each:[s,u]}),clear:function(){var e=this;return e.length=0,e[c]=0,e[o]=0,e.callbacks=[],e._queue={},e.off()}},k:function(e){var t=this;if(!(t instanceof L)){var r=new L;return r.load.apply(r,arguments)}a(e)?t._basePath=e:e===!0&&(t._onlyAjax=e),t.clear()}}}),W.sourceRepository=g(function(){var e="done",t="none",r="ready",n="reading",o="loading";return{a:"events",i:{queryUrl:function(e,t){var r=this.packages[e].from;return l(r)?t:F.convert(this.paths[r],t)},initTask:function(t,r){var a=this,u=a.status,s=a.packages;if(u==n)return a.queue.push({name:t,callback:r}),!1;if(t in s){var c=s[t];return c.status==e?(i(r)&&r(c),!1):(a.status=o,c.status=o,!0)}return W.debug({path:"Std.sourceRepository",memberType:"public",memberName:"use",description:"package "+t+" doesn't exist."}),!1}},j:{status:t,loading:0,add:p(function(e,r){this.packages[e]={from:"",data:r,status:t}},{each:[u]}),use:function(e,t){var r=this;if(a(e))r.load(e,t);else if(s(e)){var n=e.length,o=0;h(e,function(e,a){r.load(a,function(){++o===n&&i(t)&&t()})})}return r},addOrigin:p(function(e,r){var i=this;i.status===t&&(i.status=n),a(e)||W.debug({path:"Std.sourceRepository",memberType:"public",memberName:"addOrigin",description:"parameter1 must be a string"}),a(r)||W.debug({path:"Std.sourceRepository",memberType:"public",memberName:"addOrigin",description:"parameter2 must be a string"}),i.reader.load((i.paths[e]=r+"/")+"index.js")},{each:[u]}),response:function(e,r){var n=this;i(r)&&(r=r()),a(e)||W.debug({path:"Std.sourceRepository",memberType:"static",memberName:"response",description:"parameter1 must be a string."}),u(r)||W.debug({path:"Std.sourceRepository",memberType:"static",memberName:"response",description:"parameter2 must be a object or a function."}),e in n.paths||W.debug({path:"Std.sourceRepository",memberType:"static",memberName:"response",description:"package "+e+" doesn't exist."}),h(r,function(r,i){n.packages[r]={from:e,data:i,status:t}})},load:function(t,r){if(!this.initTask(t,r))return this;var n=this,o=n.packages[t],c=o.data,l=n.loader,f=function(){o.status=e,i(r)&&r(o)},d=function(e){return a(e)?n.queryUrl(t,e):s(e)?h(e,function(e,r){return n.queryUrl(t,r)},!0):void 0};if(a(c)||s(c))l.loadFiles(d(c),f);else if(u(c)){var m=c.basics,p=function(){l.loadFiles(d(c.files),f)};m?n.use(m,p):p()}return n}},k:function(e,t){var n=this;n.paths={},n.queue=[],n.packages={},n.reader=(new L).on({complete:function(){n.status=r,h(n.queue,function(e,t){n.load(t.name,t.callback)}),n.emit(r)}}),n.loader=(new L).on({append:function(){n[o]++},progress:function(){n[o]--},complete:function(){0===this.loading&&n.emit(n.status="complete")}}),e&&t&&n.addOrigin(e,t)}}}),E=W.source=g({k:function(e,t){E.repository.addOrigin(e,t)},l:function(e){e.repository=new W.sourceRepository,h("use add response",function(t,r){e[r]=function(){var t=e.repository;return t[r].apply(t,arguments)}})}}),W.use=function(e,t){return E.repository.use(e,t)},z=W.template=g({a:"events",e:{url:"",text:"",renderTo:r,element:r,compressLevel:1},f:{fileCaches:{},templates:{},add:p(function(e,t){t instanceof z&&(z.templates[e]=t)},{each:[u]}),remove:p(function(e){e===n?this.clear():a(e)&&delete z.templates[e]},{each:[s]}),clear:p(function(){Object.clear(z.templates)}),clearCache:p(function(){Object.clear(z.fileCaches)})},i:{error:0,loaded:!1,analyze:function(e,t){var r=this;return r.analyzer.analyze(e,function(e){0!=this.error&&(r.error=1,r.emit("error","analyzeError")),i(t)&&t.call(r,e)}),r},compile:function(){var e=this,t=e.compiler.compile();return 0!=e.compiler.error?(e.error=2,e.emit("error","compileError"),!1):t},build:function(e){var t=this;return 0!=t.error||!u(e)&&e!=r?r:t.builder.build(e)},checkout:function(e){var t=this.build(e),n=this._renderTo;return n!=r&&n.html(t),t}},j:{compressLevel:function(e){return this.opt("compressLevel",e)},render:function(e,t){var r=this;return i(t)?(r.loaded?t.call(r,r.checkout(e)):r.once("load",function(){t.call(r,r.checkout(e))}),null):r.checkout(e)},renderTo:function(e,t,r){var n=this,o=j(e);return n.render(t,function(e){o&&o.append(e),i(r)&&r.call(n,e)}),n},loadFromString:function(e,t){var r=this;return r.loaded=!1,r.analyze(r._tpl=e,function(e){e!==!1&&(r.compile(),r.loaded=!0,r.emit("load"),i(t)&&t.call(r,e))}),r},loadFromUrl:function(e,t){var r=this;return N.get(e,function(e){a(e)?r.loadFromString(e,t):r.emit("loadError")}),r},loadFromElement:function(e,t){var n=this,i=n._dom=j(e);if(i!==r){var o=i.attr("std-name"),a=i.attr("render-to"),u=i.attr("render-url");l(o)||z.add(o,n),l(a)||(n._renderTo=j(a)),l(u)||(n._renderUrl=u,n.refresh()),n.loadFromString(i.html(),t)}return n},refresh:function(){var e=this,t=e._dom,r=e._renderUrl;return!l(r)&&t&&N.json({url:r,cache:!1,success:function(r){"true"===t.attr("render-here")&&(t.parent().insertBefore(e.render(r),t),t.remove())}}),e}},k:function(e,t){if(!(this instanceof z))return a(e)?t===n?z.templates[e]||r:new z(e,t):r;var i=this,o=r;i.builder=new z.builder(i.compiler=new z.compiler(i.analyzer=new z.analyzer)),t===n?t=e:z.add(e,i),a(t)?(i.init_opts(),i.loadFromString(t)):u(t)&&((o=i.init_opts(t)).on&&i.on(i.on),o.text?i.loadFromString(o.text):o.element?i.loadFromElement(o.element):o.url&&i.loadFromUrl(o.url))}}),z.methods={eval:function(e){return"<script>"+e+"</"+"script>"}},z.statements={"#else":function(){return"}else{"},"#elseif":function(e,t){return"}else if("+this.fixCode(e,t)+"){"},"#break":function(){return"break;"},"#continue":function(){return"continue;"},"with":function(e,t,r){return"if(typeof("+this.fixCode(e,t)+")!=='undefined'){"+r+"}"},"if":function(e,t,r){return"if("+this.fixCode(e,t)+"){"+r+"}"},"for":function(e,t,r){return"for("+this.fixCode(e,t)+"){"+r+"}"
},"while":function(e,t,r){return"while("+this.fixCode(e,t)+"){"+r+"}"},each:function(e,t,r,n){var i,o,a=[],u=e,s=0,c="";if(-1!==(o=e.indexOf(" as ",1))){u=e.substr(0,o).trim();var f=e.length,d="";for(o+=4;f>o;o++)if(x.blankChar(i=e.charAt(o)));else if(x.alnum(i))d+=i;else{if(","!==i){s=3,c=i;break}a.push(d),d=""}""!==d&&a.push(d)}if(x.validAlNum(u)||(s=4,c=u),l(a)&&(a=["index","value"]),0!==s){var h="";switch(s){case 3:h="illegal char: "+c;break;case 4:h="illegal variable name: "+c}W.debug({path:"Std.template.builder",description:h,line:n.line})}return"Std.each("+this.varName(u,t)+",function("+a.join(",")+"){"+r+"});"}},z.analyzer=g({h:{loading:0,callback:r},i:{parseCode:function(e){var t,n,i=this,o=r,a=0,u={},s=i.tplLength,c=i.parser,l="",f=0;switch(s>e+2&&!x.alnum(i.tpl.charAt(e+2))&&W.debug({path:"Std.template.analyzer",memberType:"private",memberName:"parseCode",description:"syntax error: "+i.tpl.substring(e,e+2),file:this.src,line:i.currentLine,content:i.tpl.line(i.currentLine+1).trim()}),t=i.tpl.charAt(e+1)){case"=":case"$":e++;case"@":case"#":case"/":o=t}for((u.type=o)!==r&&"="!==o&&"$"!==o&&(0==(n=c.keyword(e+2,0)).error?u.keyword=n.text:f=1,e=n.endPos),++e;s>e;e++)if("\n"!==(t=i.tpl.charAt(e))||0!==a)if(";"!==t&&"{"!==t&&"}"!==t)if(0!==a&&x.blankChar(t))"\n"===t&&i.currentLine++;else{if(a=0,"?"===t&&">"===i.tpl.charAt(e+1)){e++;break}if('"'===t||"'"===t){if(e=(n=c.keyword(e,2)).endPos,0!==n.error){f=1;break}l+=t+n.text.escapeString(t)+t}else l+=t}else a=2,l+=t;else a=1,l+="\n",i.currentLine++;return u.text=l.trim(),u.error=f,u.endPos=e,u}},j:{readFile:function(e){var t=this,n=z.fileCaches;if(e in n)return t.result.push(n[e]),t;var o=t.result.push(r),a=new z.analyzer;return a.line=t.currentLine,a.src=e,++t._loading&&N({url:e,success:function(r){a.analyze(r,function(){t.result[o-1]=n[e]=this,0===--t._loading&&i(t._callback)&&t._callback.call(t,t.result)})}}),t},append:function(e,t){var r=this;if(0===t)e=e.escapeString("'");else if(1===t&&"@"===e.type&&"include"===e.keyword)return r.readFile(e.text.trim());return r.result.push({type:t,line:r.currentLine,data:e}),r},analyze:function(e,t){var r,n,o,a=this.clear(),u=a.tplLength=e.length,s=a.parser=C(a.tpl=e,u),c="",l=0;for(r=0;u>r;r++)if("<"===(n=e.charAt(r)))if("?"===(n=e.charAt(r+1))){if(r=(o=a.parseCode(r+1)).endPos,0!==o.error){l=1;break}a.append(c,0),a.append(o,1),c=""}else if("!"===n&&"-"===e.charAt(r+2)&&"-"===e.charAt(r+3)){if(r=(o=s.htmlComment(r)).endPos,c+=o.text,0===o.error){l=2;break}a.currentLine+=o.text.count("\n")}else r++,c+="<"+n;else"\n"===n&&a.currentLine++,c+=n;if(0!==l){var f="";1===l?f="illegal syntax: ":2===l&&(f="parse error,html comment unexpected end <!-- : "),W.debug({path:"Std.template.analyzer",memberType:"public",memberName:"analyze",description:f+a.tpl.substring(r,r+2),line:a.currentLine,content:a.tpl.line(a.currentLine+1).trim()})}return a.error=l,a.endPos=r,a.append(c,0),i(t)&&(a._loading>0?a._callback=t:t.call(a,a.result)),a},clear:function(){var e=this;return e._loading=0,e._callback=r,e.endPos=0,e.error=0,e.currentLine=0,e.result.clear(),e}},k:function(){this.result=[]}}),z.builder=g({j:{build:function(e){a(e)&&(e=e.toObject());try{return this.compiler.result(e)}catch(t){}return""}},k:function(e){this.compiler=e}}),z.compiler=g({i:{makeFunction:function(e){var t="var window=null;var document=null;var _print='';"+e+"\nreturn _print";return t="try{var _print='';var _line=0;"+e+"\nreturn _print"+"}catch(e){"+"Std.debug({path:'Std.template.builder',line:_line,file:_file,description:e.message})"+"}",W.eval("(function(){return function(_data){"+t+"}})()")},fixCode:function(e,t){for(var n=this,i=e.length,o=C(e,i),a="",u=n.variables,s=0,c=0;i>c;c++){var l=e.charAt(c),f=r;if(x.blankChar(l))a+=l;else if(";"!==l&&"{"!==l&&"}"!==l&&"&"!==l&&"|"!==l){if('"'===l||"'"===l)f=2;else if(l>="0"&&"9">=l)f=1;else if(x.alnum(l))f=0;else{if(!x.operatorChar(l)){a+=l;continue}f=3,s=0}var d=o.keyword(c,f),h=d.text||"";0===f&&"var"===h&&(s=1),2===f&&(h=l+h.escapeString(l)+l),0===f&&"."!==e.charAt(c-1)?x.keyword(h)?a+=h:0===s||2===s?a+=u.has(h)?h:n.varName(h,t):1===s&&(u.push_uniq(h),a+=h):3===f&&"="===h?(s=2,a+=h):a+=h,2===s&&"="!==h&&(s=1),c=d.endPos}else a+=l,s=0}return a}},j:{varName:function(e,t){return t===n?e:t+"."+e},printText:function(e){return"_print+='"+e+"';"},printVariable:function(e,t){return""===e?e:"_print+="+this.varName(e,t)+";"},compile:function(){return this.result=this.makeFunction(this.compileCode())},compileCode:function(){for(var e=this.clear(),t="",r="",n=e.analyzeLength=e.analyzeResult.length;e.i<n;e.i++)null!==(r=e.compileItem(e.analyzeResult[e.i],"_data"))&&(t+=r);return t},compileMethod:function(e,t,r){var n=z.methods;return t in n?this.printText(n[t](r).escapeString("'")):(W.debug({path:"Std.template.compiler",line:e.line,description:"method "+t+" doesn't exist",content:this.analyzer.tpl.line(e.line+1)}),"_print+="+r+";")},compileLogicSyntax:function(e,t,r){var n,i,o=this,a=t.keyword,u=t.text,s="",c=1,l=a+" "+u,f=z.statements;for("with"===a&&(r=o.fixCode(u,r)),s+="_line="+e.line+";",o.i++;o.i<o.analyzeLength;o.i++){var d=o.analyzeResult[o.i],h=d.data,m=d.type;if("/"===(i=h.type)&&1===m&&h.keyword===a)return a in f||W.debug({path:"Std.template.compiler",line:e.line,description:"syntax error,unknown keyword :"+a,content:l}),f[a].call(o,u,r,s,e);if(1===m&&"#"===i)if(i+(n=h.keyword)in f)s+=f[i+n].call(o,h.text,r);else{if(!f[n]){c=2,l=n;break}s+=o.compileItem(d,r)}else s+=o.compileItem(d,r)}if(0!==c){var p="";switch(c){case 1:p="unexpected end: "+l;break;case 2:p="syntax error,unexpected statement: "+l}W.debug({memberType:"public",memberName:"compileLogicSyntax",path:"Std.template.compiler",line:e.line,description:p,content:this.analyzer.tpl.line(e.line+1)})}return!1},compileItem:function(e,t){var n=this,i=r,o=e.data;if(e instanceof z.analyzer)i=new z.compiler(e).compileCode(),i="var _file='"+e.src+"';"+i+";_file=undefined;";else if(1===e.type){var a=o.type;a?"="===a?i=n.printVariable(o.text,t):"$"===a?i=n.printVariable(o.text):"#"===a?i=n.compileLogicSyntax(e,o,t):"@"===a&&(i=n.compileMethod(e,o.keyword,o.text)):i=o.text+"\n"}else l(o)||(i=n.printText(o));return i&&(i="_line="+e.line+";"+i),i},clear:function(){var e=this;return e.error=e.i=0,e.result="",e.variables=[],e.analyzeResult=e.analyzer.result,e}},k:function(e){var t=this;t.analyzer=e,t.clear()}}),H=W.animation=g({a:"events",f:{data:{scripts:{},keyframes:{}},append:p(function(e,t){if(u(e)&&(e=j(e).html()),a(e)){var r=H.parser(e),n=H.data.keyframes;h(r.keyframes,function(e,r){var i=r.name,o=r.rules;t!==!1&&D.keyframes(i,o),n[i]=o})}},{each:[s]}),remove:p(function(e){a(e)&&delete H.data.keyframes[e]},{each:[s]})},j:{append:function(){},exec:function(){}},k:function(e,t){var r=H.data.scripts;if(a(e)){if(t===n&&e in r)return r[e];i(t)&&(r[e]=t)}}}),H.timingFunction=g({f:{linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],snap:[0,1,.5,1],"cubic-bezier":function(e,t,r,n){function i(e){return((l*e+c)*e+s)*e}function o(e){return((h*e+d)*e+f)*e}function a(e){return(3*l*e+2*c)*e+s}function u(e){for(var t,r,n,o,u=0,s=e;8>u;u++){if(m(n=i(s)-e)<p)return s;if(m(o=a(s))<p)break;s-=n/o}if((s=e)<(t=0))return 0;if(s>(r=1))return 1;for(;r>t;){if(m((n=i(s))-e)<p)return s;e>n?t=s:r=s,s=.5*(r-t)+t}return s}var s=3*e,c=3*(r-e)-s,l=1-s-c,f=3*t,d=3*(n-t)-f,h=1-f-d,m=Math.abs,p=1e-6;return function(e){return o(u(e))}}},k:function(e){var t=r,n="cubic-bezier",i=H.timingFunction;null==e&&(e="linear"),s(e)?t=e:(e=e.trim()).left(12)===n?t=h(e.between("(",")",11).split(","),function(e,t){return float(t.trim())},!0):e in i?t=i[e]:W.debug({path:"Std.animation.timingFunction",description:"rule "+e+" doesn't exist"}),t===r&&(t=i.linear);for(var a=0;4>a;a++)o(t[a])?t[a]>1&&(t[a]=1):t[a]=0;return i[n].apply(this,t)}}),H.parser=g({f:{value:function(e){function t(e,t){var r=t.length,n=[];if("rgb"===e&&3!=r||"rgba"===e&&4!=r)return!1;for(var i=0;r>i;i++){var o=t[i];if("number"!==o.type||!x.number(o.value))return!1;n[i]=float(o.value)}var a={r:n[0],g:n[1],b:n[2]};return 4==r&&(a.a=n[3]),{type:"color",unit:e,value:a}}function n(e){for(var t=0,r="",n="",i=[],o=function(){1==u&&(r+="<?=v"+t++ +"?>",i.push(~~n),n="",u=0)},a=0,u=0,s=e.length;s>a;a++){var c=e.charAt(a);c>="0"&&"9">=c?(0==u&&u++,n+=c):(o(),r+=c)}return o(),{type:"text",tpl:z(r),value:i}}function i(n){var i,o=e.charAt(c+1);if("("===o){c+=2;var u=a();return u===!1?u:"rgb"===n||"rgba"===n?t(n,u):{type:"function",name:n,value:u}}return"%"===o&&++c&&(n+=o),x.number(n)?{type:"number",value:float(n),unit:r}:(i=C.unit(n))!==r?i:n in S.colors?{type:"color",unit:"rgb",value:d(S.colors[n])}:{type:"string",value:n}}function o(e){if("#"===e){var t=f.hex(c);if((c=t.endPos)&&0==t.error)return{type:"color",unit:"rgb",value:d(t.text)}}else if('"'===e||"'"===e){var r=f.keyword(c,2);if((c=r.endPos)>-1&&0==r.error)return n(r.text)}else if(x.alnum(e)||"-"===e||"."===e){var o=f.keyword(c,4);if((c=o.endPos)>-1&&0==o.error){var a=i(o.text);if(a!==!1)return a}}return!1}function a(){for(var t,r=[];l>c&&")"!==(t=e.charAt(c));c++)if(x.blankChar(t))c=f[h](c,l)-1;else if(","!==t){var n=u();if(n===!1)return!1;1==n.length?r.push(n[0]):r.push({type:"array",value:n})}return r}function u(){for(var t,r=[];l>c;c++){if(")"===(t=e.charAt(c))||","===t){c--;break}if(x.blankChar(t))c=f[h](c,l)-1;else{var n=o(t);if(n===!1)return!1;r.push(n)}}return r}var s,c=0,l=(e+="").length,f=new C(e,l),d=S.hex2rgb,h="skipWhiteSpace",m=u();return m===!1&&W.debug({path:"Std.animation.parser",memberType:"static",memberName:"value",position:c+1,content:e}),1===m.length?(s=m[0],s.text=e):s={type:"array",value:m,text:e},s}},k:function(e,t,i){function o(){var t="";for(y++;f>y;y++){var r=e.charAt(y);if("]"===r)break;if(!x.operatorChar(r)){var n=e.substr(0,y).count("\n")+1;return W.debug({path:"Std.animation.parser",line:n,position:y-1,description:"illegal operator",content:e.line(n-1).trim()}),!1}t+=r}return t}function a(){var t,n="",i="",a="",u={},s=0;for(y++;f>y;y++)if("}"===(t=e.charAt(y))||3==s&&";"===t){if(3===s){if("animation-timing-function"===n)u[n]=i;else{var c=H.parser.value(i);if(c===r)return!1;c.operator=a,u[n]=c}n=i=a="",s=0}if("}"===t)break}else if(3>s&&b(t))y=d[v](y,f)-1,0==s&&s++;else if(1==s)if(":"===t)s++;else if("["===t){if(a=o(),a===!1)return!1}else{if("-"!==t&&!g(t))break;n+=t}else if(2==s)b(t)&&(y=d[v](y,f)),y--,s++;else if(3!=s||'"'!==t&&"'"!==t)3==s?i+=t:0===s&&(s++,y--);else{var l=d.keyword(y,2);if((y=l.endPos)&&0!==l.error)return!1;i+=t+l.text.escapeString(t)+t}return u}function u(t){for(var n,i,o="";f>y;y++)if("%"===(n=e.charAt(y))||","===n||"."===n||g(n))o+=n;else{if(!b(n)){if("{"===n)break;return!1}y=d[v](y,f)-1}return(i=a())!==!1?h(o,function(e,n){(n=S.percent(n))!==r&&(t[n]=m(t[n]||{},i))},!1,","):!1}function s(t){var r,n=d.keyword(y,0),i={};for(y=n.endPos+1;f>y&&"{"!==(r=e.charAt(y));y++)if(!b(r))return!1;for(y++;f>y&&"}"!==(r=e.charAt(y));y++)if(g(r)){if(u(i)===!1)return!1}else if(!b(r))return!1;return t.name=n.text,t.rules=i,!0}function c(){if(!g(e.charAt(++y)))return!1;var t,r=d.keyword(y,0);if("keyframes"!==r.text)return!1;for(y=r.endPos+1;f>y;y++){if(g(t=e.charAt(y))){var n={};if(s(n)===!1)return!1;p.keyframes.push(n);break}if(!b(t))return!1}return!0}for(var l,f=i===n?e.length:i,d=C(e,f),p={error:0,endPos:0,keyframes:[]},v="skipWhiteSpace",g=x.alnum,b=x.blankChar,y=t===n?0:t;f>y;y++)if("@"===(l=e.charAt(y))){if(c()===!1){p.error=1;break}}else if(!b(l)){p.error=1;break}if(0!==p.error){var k=e.substr(0,y).count("\n")+1;W.debug({path:"Std.animation.parser",line:k,position:y-1,description:"parse error",content:e.line(k-1).trim()})}return p.endPos=y,p}}),H.keyframes=g(function(){function e(e,t){return e===c?t:H.parser.value(t)}function t(e){for(var t=0,r="",n="",i=0,o=e.length;o>i;i++){var a=e.charAt(i);if("["===a){if(0==t){t++;continue}break}if("]"===a)break;if(1===t&&x.operatorChar(a))n+=a;else{if(0!==t)break;r+=a}}return{name:r,operator:n}}function i(e){if(e in f)return f[e];var t=D.keyframes(e);return t!==r?(H.append(t,!1),f[e]):r}var o="_timingFunction",s="_defaultProperty",c="animation-timing-function",l=H.timingFunction,f=H.data.keyframes;return{a:"events",e:{fps:"auto",delay:0,fillMode:"forwards",duration:0,direction:"normal",iterationCount:1,iterationDelay:!1,timingFunction:"linear"},f:{query:i},h:{timer:r,state:"ready",stage:0,count:0,rules:r,stages:r,percents:r,property:r,backward:!1},i:{backward:function(e){var t=this;return e===n?"alternate"===t.opts.direction&&t._count%2?!0:!1:(t._backward=e,t)},progress:function(e,t,r){var n=this,i=n._stageTimingFunc(t);return n.emit("progress",[n.updateValues(e.begin,e.end,e.from,e.to,i,r),r],!0)},stage:function(e){var t=this;if(e===n)return t._stage;var r=t._stageData=t._stages[e];return t._backward=t.backward(),t._stage=e,t._stageBegin=r.begin,t._stageEnd=r.end,t._stageTimingFunc=r.timingFunction||t[o],t},complete:function(){var e=this,t=e.opts,r=e._timer,n=e._backward,i=e._stageLength,o=t.fillMode,a=t.iterationCount,u=t.iterationDelay;return++e._count<a||"infinite"===a?(e.stage(e.backward()?i-1:0),r.stop().reset(),u||(r._t4=r.delay()),r.start(),e.emit("iteration",e._count)):("none"==o||n?e.progress(e._stages[0],0,100):"forwards"==o&&e.progress(e._stages[i-1],1,100),r.stop(),e._state="completed",e.stage(i-1).emit("complete")),e},findNextValue:function(e,t){for(var i,o=this,a=o._rules,u=o._percents,c=o[s],l=r,f=t||0,d=u.length;d>f;f++)if((i=a[u[f]][e])!==n){l=i;break}return l===r&&c&&e in c&&(l=c[e]),l},loadRules:function(o){var s=this,l={},f=[],d=s._property={},h=!1,m=!0;if(a(o)){var p=o;if(!(o=i(o)))return W.debug({path:"Std.animation.keyframes",memberType:"public",memberName:"loadRules",description:"load rule "+p+" failed,rule is null"}),s;m=!1}else u(o)&&(h=!0);for(var v in o){var g=o[v],b={};if(!((v=S.percent(v))===r||v>100||0>v)){f.push(v);for(var y in g){var k=m?e(y,g[y]+""):g[y],w=y;if(h){var x=t(w);w=x.name,k.operator=x.operator}b[w]=k,b[w]["%"]=v,d[w]===n&&y!==c&&(d[w]=k)}l[v]=b}}return 100 in l||(l[100]={},f.push(100)),s._rules=l,s._percents=f.order("asc"),s},computeValue:function(e,t,r){if(!(e in t&&e in r))return t[e];var n=t[e].operator,i=t[e].value,o=r[e].value,a=function(e,t){return"+"===n?e+=t:"-"===n?e=t-e:"*"===n?e*=t:"/"===n&&(e=t/e),e};switch(t[e].type){case"number":t[e].value=a(i,o)}return t[e]},formatStages:function(){for(var e=this,t=e._rules,n=e._stages=[],i=e._percents,o=e._timefns={},a=i[0],u=0,f=m({},e[s]||(0==a?t[a]:{})),d=f,h=0,p=i.length;p>h;h++){var v=i[h],g=t[v],b=n[h]={begin:u,end:v,from:m({},d),to:{},timingFunction:r};c in d&&(o[u]=b.timingFunction=l(d[c]),delete d[c]);for(var y in g)f[y]=e.computeValue(y,g,d);for(y in f){var k=r;if(y in g)k=g[y];else if((k=e.findNextValue(y,h+1))===r)continue;b.to[y]=k}d=f,u=v}return e},updateValues:function(e,t,i,a,u,s){function c(r,n,i,a,c){if(t!==a||e!==i){var l=g._timefns[i]||g[o];return(r+(n-r)*l((s-i)/(a-i))).float(c)}var f=n-r,d=a-i,h=Math.over(e-i,d),m=Math.over(t-i,d);return(r+(h*f+(m-h)*f*u)).float(c)}function l(r,n,i,o){return i+(o-i)/2>e+(t-e)*u?r.value:n.value}function f(e,t,r,n){return t.name+"("+p(e,t,r,n,",")+")"}function d(e,t,n,i){var o=t.unit,a="px"===o||"deg"===o?0:4,u=c(e.value,t.value,n,i,a);return o===r?u:u+o}function h(e,t,r,i){var o=e.value,a=t.value,u=t.unit,s=[c(o.r,a.r,r,i),c(o.g,a.g,r,i),c(o.b,a.b,r,i)],l={r:s[0],g:s[1],b:s[2]};return"rgba"===u&&(o.a===n&&(l.a=1),s.push(l.a=c(o.a,a.a,r,i))),u+"("+s.join(",")+")"}function m(e,t,r,n){for(var i=e.value,o=t.value,a={},u=0,s=i.length;s>u;u++)a["v"+u]=c(i[u],o[u],r,n);return e.tpl.render(a)}function p(e,t,r,i,o){for(var a=e.value,u=t.value,s=[],c=0,l=u.length;l>c;c++){var f=u[c];f!==n&&s.push(v(a[c],f,r,i))}return s.join(o||" ")}function v(e,t,r,i){var o=t.type,a="";return e===n||t===n?"":(e.type!==o||("number"===o?a=d(e,t,r,i):"string"===o?a=l(e,t,r,i):"color"===o?a=h(e,t,r,i):"text"===o?a=m(e,t,r,i):"array"===o?a=p(e,t,r,i):"function"===o&&(a=f(e,t,r,i))),a)}var g=this,b={};for(var y in a){var k=i[y],w=a[y];if(k!=n&&w!=n)b[y]=v(k,w,k["%"]||0,w["%"]||100);else if(1===u&&w!==n){var x=w["%"];b[y]=v(w,w,x,x)}}return b}},j:{elapsedTime:0,fps:function(e){return this.opt("fps",e)},iterationCount:function(e){return this.opt("iterationCount",e)},iterationDelay:function(e){return this.opt("iterationDelay",e)},fillMode:function(e){return this.opt("fillMode",e)},duration:function(e){return a(e)&&(e=S.timeUnit(e,"ms")),this.opt("duration",e)},direction:function(e){return this.opt("direction",e)},delay:function(e){return this.opt("delay",e,function(){this._timer.delay(e)})},timingFunction:function(e){var t=this;return e===n?t[o]:(t[o]=l(e),t)},state:function(e){var t=this;return e===n?t._state:(t.emit("stateChange",t._state=e),t)},rules:function(e){var t=this;return e===n?t._rules:t.loadRules(e)},pause:function(){return this._timer.pause(),this.emit("pause")},stop:function(){var e=this;return e._timer.stop(),e.reset().emit("stop")},start:function(){var e,t=this,n=t.opts,i=n.fps,o=n.duration;if("completed"==t._state&&t.reset(),"auto"==i?e=i:(e=Math.ceil(1e3/~~i),e>o&&(e=o)),t._stages===r){if(t._rules===r)return t;t.formatStages(),t.stage(0),t._stageLength=t._stages.length}return t._timer.interval(e).start(),t.emit("start")},reset:function(){var e=this;return e.stage(0),e._count=0,e._timer.reset(),e},clear:function(){var e=this;return e._count=0,e._property=r,e._rules=r,e._stage=0,e._stages=r,e._percents=r,e._timefns=r,e._timer.reset(),delete e._stageData,delete e._stageBegin,delete e._stageEnd,delete e._stageTimingFunc,e},remove:function(e){var t=this;return e===n&&(t.clear(),t._timer.remove()),t},defaultProperty:function(t){var r=this;return t===n?r[s]:(r[s]=h(t,e,!0),r)}},k:function(e){var t=this;if(!(t instanceof H.keyframes))return new H.keyframes(e).start();var r=t.init_opts(e);"on"in r&&t.on(r.on),"defaultProperty"in r&&t.defaultProperty(r.defaultProperty),"rules"in r&&t.rules(r.rules),t.duration(r.duration),t.timingFunction(r.timingFunction),t._timer=new T(function(){var e=t._backward,n=t._stageData,i=t._stageBegin,o=t._stageEnd,a=r.duration,u=t.elapsedTime=this.elapsedTime,s=100*(u/a);u>=a?t.complete():!e&&s>=o?t.progress(n,1,o).stage(t._stage+1):e&&i>=100-s?t.progress(n,0,i).stage(t._stage-1):e?(s=100-s,t.progress(n,(s-i)/(o-i),s)):t.progress(n,(s-i)/(o-i),s)},{delay:r.delay,on:{stateChange:function(e){t.state(e)}}})}}}),H.keyframes.united=W.unite(H.keyframes),D=W.css=g({type:1,f:{support:function(e,t){return e=e.unCamelCase(),h(W.init.styles,function(r,n){return e===n||t&&Object.contains(e,W.init.cssName)?!0:void 0})||!1},keyframes:function(e,i){var o=t.styleSheets,s=W.init.anim;if(!s||e===n||!o)return r;if(u(i)){var c=D(),l="@"+s+" "+e+"{",f=W.init.cssName;for(var d in i)l+=S.percent(d)+"%{",h(i[d],function(e,t){e in f&&(e=f[e]),l+=e+":"+(a(t)?t:t.text)+";"}),l+="}";return l+="}",c.sheet.insertRule(l,0),D}for(var m=0;m<o.length;m++)for(var p=o[m].cssRules||o[m].rules,v=0;v<p.length;v++){var g=p[v];if(g.name===e&&7===g.type){for(var b="",y=g.cssRules||g.rules,k=0;k<y.length;k++)b+=y[k].cssText;return"@keyframes "+e+"{"+b+"}"}}return r}},j:{length:0,enable:function(e){var t=this,r=t.sheet;return e===n?!r.disabled:(r.disabled=!e,t)},source:function(){for(var e=this,t=e.rules,r="",n=0;n<e.length;n++)r+=t[n].selectorText+"{"+t[n].style.cssText+"}";return r},insert:function(e,t,r){var n=this,i=n.sheet,o="";if(u(t)){var s=W.init.cssName;h(t,function(t,i){if((">"===t||" "===t)&&u(i))return h(i,function(i,o){n.insert(e+t+i,o,r)}),void 0;if(t in s&&(t=s[t]),t in D.hooks){var c=D.hooks[t](i);a(c)?o+=c:u(c)&&(o+=c.name+":"+c.value+";")}else o+=t.unCamelCase()+":"+i+";"})}else a(t)&&(o=t);return""===e||""===o||x.ie(6)&&-1!==e.indexOf(">")?void 0:(i.insertRule?i.insertRule(e+"{"+o+"}",r):i.addRule&&i.addRule(e,o,r),n.length++,n)},append:p(function(e,t){this.insert(e,t,this.length)},{each:[s,u]}),remove:p(function(e){var t=this;if(e===n)t._dom.remove();else if(o(e)){var r=t.sheet;r.deleteRule?r.deleteRule(e):r.removeRule&&r.removeRule(e),t.length--}else if(a(e))for(var i=t.rules,u=i.length-1;u>=0;u--)i[u].selectorText.toLowerCase()===e.toLowerCase()&&t.remove(u)},{each:[s]}),clear:function(){for(var e=this,t=e.length-1;t>=0;t--)e.remove(t);return e}},k:function(e,t){var r=this,n=r._dom=newDom("style").attr("type","text/css").appendTo(t||"head");r.sheet=n.dom.sheet||n.dom.styleSheet,r.rules=r.sheet.cssRules||r.sheet.rules,i(e)&&(e=e.call(r)),u(e)&&r.append(e)}}),D.hooks=function(){var e={},t=W.init.css;return t.opacity||(e.opacity=function(e){return{name:"filter",value:"alpha(opacity="+100*e+")"}}),e}(),D.pseudos=function(){function i(e){return e.parentNode}function o(e,t,r){var n=j.elementIndex(e,null,r)+1,i=!1;if(x.number(t))return n==t;switch(t){case"even":case"2n":i=0==n%2;break;case"odd":case"2n+1":i=1==n%2;break;default:var o=t.replace(/(^|\D+)n/g,"$11n").split("n"),a=0|o[0],u=0|n-o[1];i=a*u>=0&&0==u%a}return i}var a="readOnly",u={index:function(e,t,r){return j.elementIndex(e,r)===t},focus:function(e){return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},target:function(t){var r=e.location.hash;return r&&r.slice(1)===t.id},parent:function(e){return!!e.firstChild},root:function(e){return e===t.documentElement},enabled:function(e){return e.disabled!==!1},disabled:function(e){return e.disabled===!1},"read-only":function(e){return e[a]===a||e[a]===!0},"read-write":function(e){return!u[a](e)},password:function(e){return"password"===e.type},has:function(e,t){return P.query(t,e,!1)!==r},not:function(e,t){return P.matchSelector(e,t)===!1},odd:function(e){return o(e,"odd")},even:function(e){return o(e,"even")},html:function(e,t){return e.innerHTML==t},value:function(e,t){return e.value==t},hidden:function(e){return"none"===j.getStyle(e,"display")||!j.contains(e,e.ownerDocument)||0===e.offsetWidth&&0===e.offsetHeight},visible:function(e){return!u.hidden(e)},checked:function(e){var t=e.nodeName;return"INPUT"===t&&!!e.checked||"OPTION"===t&&!!e.selected},contains:function(e,t,r){return r!==n&&"true"==r+""?(e.innerHTML||"").indexOf(t)>-1:(e.textContent||e.innerText||"").indexOf(t)>-1},text:function(e){var t;return"INPUT"===e.nodeName&&"TEXT"===e.type&&((t=e.getAttribute("type"))==r||"text"===t.toLowerCase())},selected:function(e){return e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},"first-child":function(e){var t=i(e).firstChild;do if(!t||1===t.nodeType)break;while(t=t.nextSibling);return t===e},"last-child":function(e){var t=i(e).lastChild;do if(!t||1===t.nodeType)break;while(t=t.previousSibling);return t===e},"only-child":function(e){var t=!1,r=0,n=i(e).childNodes,o=n.length;if(0==o)return t;for(var a=0;o>a;a++)if(1===n[a].nodeType){if(r>0){t=!1;break}if(n[a]!==e){t=!1;break}t=!0,r++}return t},"nth-child":o,"nth-last-child":function(e,t){return o(e,t,!0)},"nth-of-type":function(e,t){for(var r=1;e=e.previousSibling;)e.tagName===e.tagName&&r++;return o(e,r,t)},"nth-last-of-type":function(e,t){for(var r=1,n=e.tagName;e=e.nextSibling;)e.tagName===n&&r++;return o(e,r,t)},"first-of-type":function(e){for(var t=e.tagName;e=e.previousSlibling;)if(e.tagName===t)return!1;return!0},"last-of-type":function(e){for(var t=e.tagName;e=e.nextSibling;)if(e.tagName===t)return!1;return!0},"only-of-type":function(e){for(var t=i(e).childNodes,r=t.length-1;r>-1;r--)if(t[r].tagName===e.tagName&&t[r]!==e)return!1;return!0}};return u}(),D.selector=P=function(){var e=function(e,t){if(9===e.nodeType)return!1;if(t.selector){var n=P.querySelectors(t.selector);if(n!==r)for(var i=0,o=n.length;o>i;i++)if(n[i]===e)return!0;return!1}var a=t["#"],u=t.tag,s=t["."],c=t.attr,l=t[":"],f=t.content;switch(!0){case"*"!==u&&e.nodeName!==u:case a&&e.id!=a:case s&&!j.hasClass(e,s):case c&&!P.matchAttr(e,c):case l&&!P.matchPseudos(e,l):case f&&!P.matchContent(e,f):return!1}return!0};return{cache:!0,caches:{},cacheSize:0,maxCacheSize:100,parse:function(e,t){var n=0,i=e.length,o=C(e,i),u=function(){for(var t="";i>n;n++){var r=e.charAt(n);if("\n"===r&&(r=" ")," "!==r&&" "!==r&&">"!==r&&"<"!==r&&"+"!==r&&"~"!==r&&"/"!==r){n--;break}t+=r}return""===(t=t.trim())&&(t=" "),t},s=function(t){var r=":",i=o.pseudoClass(n,!1);return n=i.endPos,0!=i.error?(W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"pseudosClass error",content:e.substr(0,n+1)}),!1):(t[r]||(t[r]={}),t[r][i.name]=i.arguments,void 0)},c=function(t){var r=o.attribute(n,!1),i=r.value;return n=r.endPos,0!=r.error?(W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"attribute error,unexpected end",content:e.substr(0,n+1)}),!1):(t.attr||(t.attr=[]),t.attr.push({name:r.name,operator:r.operator,value:i}),void 0)},f=function(t){var r=e.charAt(++n),a="";if('"'===r||"'"===r){var u=o.keyword(n,2);if(n=u.endPos+1,0!=u.error)return W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"content error",content:e.substr(0,n+1)}),!1;a=u.text}for(;i>n&&"}"!==(r=e.charAt(n));n++)a+=r;t.content=a},d={"[":c,":":s,"{":f},h=function(r){for(var u,s=0,c={tag:"*","<":r};i>n;n++){var f=e.charAt(n);if("#"===f||"."===f)u=o.keyword(++n,5),n=u.endPos,a(c[f])?c[f]+=" "+u.text:c[f]=u.text;else if("["===f||":"===f||"{"===f){if(d[f](c)===!1)return!1}else if("("===f){if(0!==s)return W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"parse error",content:e.substr(0,n+1)}),!1;n++;var h=p();l(h)||(c.selector=h)}else if("*"===f)if(0===s)c.tag=f;else{if(0!==(u=o.keyword(++n,1)).error)return W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"parse error",content:e.substr(0,n+1)}),!1;n=u.endPos,c[f]=u.text}else{if(!x.alnum(f)){n--;break}if(0!==s)return W.debug({path:"Std.css.selector",memberType:"static",memberName:"parse",position:n,description:"parse error",content:e.substr(0,n+1)}),!1;n=(u=o.keyword(n,0)).endPos,c.tag=t===!1?u.text:u.text.toUpperCase()}s=2}return 0==s?!1:c},m=function(){for(var t=[],o=r;i>n;n++){var a=e.charAt(n);if(","===a||")"===a)break;if("\n"!==a&&" "!==a&&" "!==a&&">"!==a&&"<"!==a&&"+"!==a&&"~"!==a){var s=h(o);if(s===!1)return s;t.push(s)}else o=u()}return t},p=function(){for(var t=[];i>n;n++){var r=e.charAt(n);if(!x.blankChar(r)&&","!==r){if(")"===r)break;var o=m();if(!o)break;if(l(o)||t.push(o),")"===e.charAt(n))break}}return t};return p()},matchContent:function(e,t){var r=e.innerHTML;return r?r.trim()===t.trim():!1},matchAttr:function(e,t){for(var i=0,o=t.length,a=0;o>a;a++){var u=t[a],s=u.operator,c=u.value,l=e.getAttribute(u.name);if("="!=s&&"=="!=s&&""!=s||c!==n){if(!Math.check(l,s,u.value))break}else if(l==r)break;i++}return i==o},matchPseudos:function(e,t){for(var r in t){var n=D.pseudos[r];if(!n||!n.apply(e,[e].mergeArray(t[r])))return!1}return!0},matchElement:e,findElements:function(e,t,n){if(e.selector)return P.querySelectors(e.selector,t);var i=e.tag,o=e["#"],a=e["."],u=e.attr,s=e[":"],c=e.content,l=r;if(o){var f=j.getElementById(o,t);if(f===r)return r;l=[f]}else l=j.getElementsByTagName(i,t);if(!(a||u||s||c))return n===!1&&l!==r?l[0]:l;if(l===r)return l;for(var d=[],h=j.hasClass,m=P.matchAttr,p=P.matchPseudos,v=P.matchContent,g=0,b=l.length;b>g;g++){var y=l[g];if(!(o&&"*"!==i&&y.nodeName!==i||a&&!h(y,a)||u&&!m(y,u)||s&&!p(y,s)||c&&!v(y,c))){if(n===!1)return y;d.push(y)}}return 0==d.length?r:d},findSibling:function(t,n,i,o){var a="nextSibling",u=n,s=[];for(o===!1&&(a="previousSibling");u=u[a];)if(1===u.nodeType&&e(u,t)){if("+"===i)return[u];"~"===i&&s.push(u)}return 0==s.length?r:s},findRelativeElement:function(t,n,i,o){var a=n;if(">"==i){if(Object.contains(a=a.parentNode,o))return r;if(e(a,t))return a}else if(" "==i)for(;a=a.parentNode;){if(Object.contains(a,o))return r;if(e(a,t))return a}else if(("+"==i||"~"==i)&&P.findSibling(t,n,i,!1)!==r)return n;return r},matchSelector_P1:function(e,t,n){for(var i=t.length,o=t[i-1]["<"],a=i-2,u=e;a>=0;a--){var s=t[a];if((u=P.findRelativeElement(s,u,o,n))===r)return!1;o=s["<"]}return!0},matchSelector_P2:function(t,n,i){for(var o=n.length,a=[t],u=t;(u=u.parentNode)&&!Object.contains(u,i)&&9!==u.nodeType;)a.push(u);var s=a.length;if(0==s)return!1;var c=function(t,i,o){var a=n[o+1]["<"];if(" "==a){for(;--i>=0;)if(e(t[i],n[o])){if(0>o-1)return!0;if(0!=c(t,i,o-1))return!0}else if(0>o)return!1}else if(">"==a){if(e(t[--i],n[o]))return--o<0?!0:c(t,i,o)}else if("+"==a||"~"==a){var u=P.findSibling(n[o],t[i],a,!1);if(u!==r)return--o<0?!0:c(t,i,o)}return!1};return 1==c(a.reverse(),s-1,o-2)},matchSelector:function(t,r,n){a(r)&&(r=P.parseSelector(r));for(var i=0,o=r.length;o>i;i++){var u=r[i],s=u.length,c=P.getMatchMethod(u);if(!(1>s)&&e(t,u[s-1])&&(1==s||c(t,u,n)))return!0}return!1},getMatchMethod:function(e){for(var t=0,r=0,n=1,i=e.length;i>n;n++){var o=e[n]["<"];">"==o&&1!=r&&(r=1),n>1&&" "==o&&(t=1)}return 0==r&&(t=0),0==t?P.matchSelector_P1:P.matchSelector_P2},querySelector:function(e,t,n){var i=e.length,o=P.findElements;if(0===i)return r;if(1===i)return o(e[i-1],t,n);var a=o(e[i-1],t);if(a===r)return r;for(var u=a.length,s=[],c=P.getMatchMethod(e),l=0;u>l;l++)if(c(a[l],e,t)===!0){if(n===!1)return a[l];s.push(a[l])}return 0==s.length?r:s},querySelectors:function(e,t,n){var i=e.length,o=P.querySelector;if(1===i)return o(e[0],t,n);for(var a=[],u=0;i>u;u++){var s=o(e[u],t,n);if(s){if(n===!1)return s;for(var c=0,l=s.length;l>c;c++)a.push_uniq(s[c])}}return 0==a.length?r:a},parseSelector:function(e){var t=r,n=P.caches,i=P.parse;return!P.cache||e.length>50?i(e):(P.cacheSize>P.maxCacheSize&&(P.caches=n={},P.cacheSize=0),n[e]?t=n[e]:(P.cacheSize++,t=n[e]=i(e)),t)},query:function(e,t,n){a(t)&&(e=t+" "+e,t=r);var i=P.parseSelector(e);return P.querySelectors(i,t,n)}}}(),P.html=g({f:{attrText:function(e){var t=e.name,n=e.operator,i=e.value||"";return""===n&&i==r?t:t+n+'"'+i.escapeString('"')+'"'},nodeHtml:function(e,t,n){var i="<"+(e=e.toLowerCase());return h(t,function(e,t){i+=" ",i+=a(t)?t:P.html.attrText(t)}),l(n)&&x.singleTag(e)?i+" />":(i+=">",n!=r&&(i+=n),i+"</"+e+">")},makeNodeHtml:function(e,t){var r="",n="",i=e.tag,o=e["*"],a=e["#"],u=e["."],s=e.attr,c=e[":"],l=e.content,f=[],d=function(e,t){f.push({name:e,operator:"=",value:t})};if("*"===i&&(i="div"),a&&d("id",a),u&&d("class",u),s&&f.mergeArray(s),l&&(n+=l),t&&(n+=t),c&&(h({password:"type"},function(e,t){c[e]&&d(t,e)}),h("checked selected disabled readOnly hideFocus",function(e,t){c[t]&&f.push(t)})),o)for(var m=0;o>m;m++)r+=P.html.nodeHtml(i,f,n);else r=P.html.nodeHtml(i,f,n);return r},makeHtml:function(e,t){var n="",i="";t!=r&&(n=i=t);for(var o=e.length-1,a=r;o>=0;o--){var u=0,s=e[o],c="";a&&" "!=a&&">"!=a?("+"==a||"~"==a)&&(u=1,i=t):i=n,s.selector?h(s.selector,function(e,t){c+=P.html.makeHtml(t,i)}):c=P.html.makeNodeHtml(s,i),0==u?n=c:1==u&&(n=c+n),a=s["<"]}return n}},k:function(e,t){e===n&&W.debug({path:"Std.css.selector.html",description:"illegal parameter"});for(var r="",i=P.parseSelector(e),o=0,a=i.length;a>o;o++)r+=P.html.makeHtml(i[o],t);return r}}),j=W.dom=g(function(){var c=/<(?:script|style|link)/i,d=W.init,v=d.dom,g=d.cssName,y="__StdWidget__",w="__StdEvents__",x="__StdData__",_="__StdAnimation__",S={extend:p(function(e,t){j.united.addMember(e),this.prototype[e]=t},{each:[u,s]}),on:function(e,t){return h(t,function(t,r){return j.united(t).on(e,r)},!0)},off:function(e,t){return h(t,function(t,r){return j.united(t).off(e,r)},!0)},text:function(e){return t.createTextNode(e)},hasClass:function(e,t){var r=e.className;if(!r)return!1;r=r.split(" "),a(t)&&(t=t.split(" "));var n=t.length,i=r.length;if(0==i||0==n)return!1;for(var o=0,u=0;i>u;u++)for(var s=r[u],c=0;n>c;c++)if(s==t[c]){o++;break}return o===n}},C=S.descendant=function(e,t){if(!e||!t)return!1;var r=t.length;if(o(r)){for(var n=0;r>n;n++)if(C(e,t[n]))return!0}else for(;e=e.parentNode;)if(e===t)return!0;return!1},F=S.contains=function(e,t){var r=!1;return r=e===t?!0:v.contains?(B(t)||A(t)?q(t):t).contains(e):v.compareDocPos?!!(16&t.compareDocumentPosition(e)):C(e,t)
},A=S.isWindow=function(t){return t!=r&&(t===t.window||t===e)},L=S.window=function(t,r){return A(t)?t:B(t)?t.defaultView||t.parentWindow:r===!0?!1:e},E=S.inDocument=function(e){return F(e,q(e))},B=S.isDocument=function(e){return e!=r&&9===e.nodeType},R=S.document=function(e){return B(e)?e:L(e).document},q=S.documentElement=function(e){return R(e).documentElement},I=S.loadHTML=function(e,n){o(e)&&(e+="");var i=W.init.dom.innerFullHTML,a=t.createElement("div"),u=[];if(a.innerHTML=i?"<a>a</a>"+e:e,i&&a.removeChild(a.firstChild),n!==!1&&-1!=e.indexOf("</script>")){var s=rt("script",a);if(s!==r)for(var c=0,l=s.length;l>c;c++){var f=s[c],d=f.type;f.type=d?d+"/":"//",f["*"]=1}}for(u.mergeArray(a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);return u},U=S.behaviorScript=function(e,t){var r=j(e),n="__StdLoadScript__",i="text/std-",o=e.type;if(r.hasData(n))return!1;if(r.data(n,1),l(o)||"text/javascript"===o){if(t!==!1){var a=r.attr("src");l(a)?W.eval(r.text()):(newDom("script").attr("src",a).insertAfter(r),r.remove())}}else if(o.left(9)===i){var u=r.attr("std-name"),s="true"===r.attr("std-render-here");if(o===i+"animation")H.append(r.html());else if(o===i+"css-selector"){if(s){var c=P.html(r.html()),f=G(c);r.parent().insertBefore(f,r),r.remove()}}else if(o===i+"template")(s||!l(u))&&new z({element:r});else if(o!==i+"ui"||l(u)){if(o===i+"read-file"){var d=function(e){N.get(r.attr("uri"),function(t){r.parent().insertAfter(t,r),r.remove(),e&&e()})};"true"===r.attr("std-hold")?O.hold(function(e,t){d(function(){e.release(t)})}):d()}}else M.rule.add(u,r.html())}else o in U&&U[o](o,r);return!0},X=function(e,t){var n=e.ownerDocument;if(t.call(e,e),F(e,n)){var i=rt("script",e);if(i!==r)for(var o=0,u=i.length;u>o;o++){var s=i[o];if(1===s["*"]){var c=s.type;"//"===c?s.removeAttribute("type"):a(c)&&"/"===c.right(1)&&(s.type=c.substr(0,c.length-1)),s["*"]=0,U(s)}}}},Y=S.get=function(e,t){var i=r;return e===n?i:(u(e)?e instanceof j?i=e.dom:e.nodeType||A(e)?i=e:f(e)?i=e[0].dom:s(e)?i=Y(e[0]):e.jquery&&e.length&&(i=e.get(0)):a(e)&&(i=it(e,t,!1)),i)},V=S.getStyle=function(e,t,n){var i=e.style;if(t in g&&(t=g[t]),n!==!1&&i&&i[t])return i[t];if(e.currentStyle)return e.currentStyle[t];if(L(e).getComputedStyle)try{return L(e).getComputedStyle(e,r).getPropertyValue(t.unCamelCase())}catch(o){}return""},$=S.setStyle=function(e,t,r){t in g&&(t=g[t]);try{e.style[t]=r+""}catch(n){}return j},K=S.clear=function(e){for(var t;t=e.firstChild;)e.removeChild(t);return j},Q=S.addListener=function(e,t,r,n,i){var o="addEventListener";return e[o]?e[o](t,r,n||!1,i):e.attachEvent("on"+t,r),j},Z=S.removeListener=function(e,t,r,n,i){var o="removeEventListener";return e[o]?e[o](t,r,n||!1,i):e.detachEvent("on"+t,r),j},G=S.fragment=function(e,i){var c=t.createDocumentFragment();if(e===n)return c;if(s(e))h(e,function(e,t){(t=Y(t))!==r&&c.appendChild(t)});else if(a(e)||o(e))for(var l=0,f=I(e,i),d=f.length;d>l;l++)c.appendChild(f[l]);else u(e)&&c.appendChild(Y(e));return c},J=S.clone=function(e,t){return e?e.cloneNode(t===n?!0:t):null},et=S.insertHTML=function(e,t,r){return X(e.parentNode,function(){if(e.insertAdjacentHTML)e.insertAdjacentHTML(t.toLowerCase(),r);else{var n=G(r),i=e.parentNode;"BeforeBegin"==t?i&&i.insertBefore(n,e):"AfterBegin"==t?e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n):"BeforeEnd"==t?e.appendChild(n):"AfterEnd"==t&&i&&(i.lastChild===e?i.appendChild(n):i.insertBefore(n,e.nextSibling))}}),j},tt=S.elementIndex=function(e,t,n){var i=-1,o=e.parentNode;if(!o)return i;var u=o.childNodes;if(!u||0===u.length)return i;var s=0,c=u.length,l=r;for(a(t)&&(l=P.parseSelector(t));c>s;s++){var f=u[s];if(1===f.nodeType&&(!l||P.matchSelector(f,l,e))&&(i++,f===e))break}return n===!0&&-1!==i&&(i=c-i),i};S.getElementById=function(e,n){var i=t.getElementById(e);if(i===r)return r;if(i.id!==e)for(var o=t.all[e],a=0,u=o.length;u>a;a++)if(o[a].id===e){i=o[a];break}return i===r||n&&!C(i,n)?r:i};var rt=S.getElementsByTagName=function(e,n){var i="getElementsByTagName";if(!n)return t[i](e);var a=n.length;if(o(a)&&!isElement(n)){var u=t[i](e),s=u.length;if(0==s)return r;for(var c=[],l=0;s>l;l++){var f=u[l];if(1==f.nodeType)for(var d=0;a>d;d++)if(f!==n[d]&&F(f,n[d])){c.push(f);break}}return 0==c.length?r:c}return n[i](e)};S.getElementsByClassName=function(e,n,i){var a=[],u=[],s="getElementsByClassName";if(n=n?n.toUpperCase():"*",t[s]){var c=t[s](e),l=c.length;if(i){var f=i.length;if(o(f))for(var d=0;l>d;d++)for(var h=c[d],m=0;f>m;m++){var p=i[m];if(h!==p&&F(h,p)){a.push(h);break}}else for(var d=0;l>d;d++)C(c[d],i)&&a.push(c[d])}else a=t[s](e);var v=a.length;if(0===v)return r;if("*"!==n)for(var d=0;v>d;d++)a[d].nodeName===n&&u.push(a[d]);else u=a}else{var v=(a=rt(n,i)).length;if(0===v)return r;for(var g=e.split(" "),b=g.length,d=0;v>d;d++){var y=a[d].className;if(y){for(var k=0,w=y.split(" "),x=w.length,m=0;b>m;m++)for(var _=0;x>_;_++)if(g[m]===w[_]){k++;break}k==b&&u.push(a[d])}}}return 0===u.length?r:u},S.getElementsByName=function(e,t,r){return nt("name","=",e,t,r)};var nt=S.getElementsByAttribute=function(e,t,n,i,o){if(!e||!t||!n)return r;var a=rt(i||"*",o);if(a===r)return a;for(var u=[],s=0,c=a.length;c>s;s++){var l=a[s],f="";f=j.attrHook[e]?j.attrHook[e](l):l.getAttribute(e),Math.check(n,t,f)&&u.push(l)}return u.length>0?u:r};S.getElementsByPseudoClasses=function(e,t,i,o){if(!e&&!D.pseudos[e])return r;s(t)||(t=[]);var a=rt(i||"*",o);if(a!==r){for(var u=[],c=0,l=a.length;l>c;c++){var f=a[c],d=D.pseudos[e].apply(f,t);if(d===!1)break;if(d===!0)u.push(f);else if(d!==n)return d}return 0==u.length?r:u}return r};var it=S.query=function(e,t,n){return t!==r&&!s(t)&&u(t)&&(t=Y(t)),P.query(e,t,n)};S.create=function(){};var ot={ui:function(){return this.dom.ui||null},clone:function(e){return j(J(this.dom,e))},document:function(){return R(this.dom)},parentNode:function(){return this.dom.parentNode||r},index:function(e,t){return tt(this.dom,e,t)},contains:function(e){return F(Y(e),this.dom)},inDocument:function(){return E(this.dom)},offsetParent:function(){for(var e=this.dom,t=e.offsetParent||q(e);t&&"HTML"!==t.nodeName&&"static"===V(t,"position");)t=t.offsetParent;return j(t||q(e))},parent:function(e){if(e===n)return j(this.parentNode());for(var t=this;t=t.parent();)if(t.is(e))return t;return r},cssText:function(e,t){var r=this,i=r.dom.style,o="cssText";if(e===n)return i[o];if(u(e)){var a="";h(e,function(e,t){if(e in g)g=g[e];else if(e in D.hooks){var r=D.hooks[e](t);e=r.name,t=r.value}a+=e+":"+t+";"}),e=a}return t===!0?i[o]+=";"+e:i[o]=e,r},backgroundImage:function(e){var t=this,r="backgroundImage";return e!==n?t.css(r,"url('"+e+"')"):(e=t.css(r))?(h(e=e.replace(/url\(([^)]+)\)/g,"$1"),function(t,r){'"'===r&&e.split(t,1)}),e):""},boxSize:function(e){for(var t=this,r={width:0,height:0},n=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],i=["paddingRight","paddingLeft","borderRightWidth","borderLeftWidth"],o=0;4>o;o++){var a=i[o],u=n[o];r.width+=r[a]=int(t.css(a))||0,r.height+=r[u]=int(t.css(u))||0}if(e===!0){var s=["marginTop","marginRight","marginBottom","marginLeft"];r.height+=(r[s[0]]=int(t.css(s[0])))+(r[s[2]]=int(t.css(s[2]))),r.width+=(r[s[1]]=int(t.css(s[1])))+(r[s[3]]=int(t.css(s[3])))}return r},offset:function(){var e,t=this,r=t.dom,n=L(r),i=q(r),o="getBoundingClientRect";return!E(r)||A(r)?{x:0,y:0}:(o in r&&(e=r[o]()),{x:e.left+(n.pageXOffset||i.scrollLeft)-(i.clientLeft||0),y:e.top+(n.pageYOffset||i.scrollTop)-(i.clientTop||0)})},position:function(){var e=this,t=e.dom,n=0,i=0,o=r;if(A(t)||B(t))return{x:0,y:0};if("fixed"===e.css("position"))o=t.getBoundingClientRect(),n+=o.top,i+=o.left;else{o=e.offset();var a=e.offsetParent();if("html"!==a.nodeName()){var u=a.offset();i-=u.x,n-=u.y}n+=o.y-a.css("borderTopWidth"),i+=o.x-a.css("borderLeftWidth")}return{x:i-e.css("marginLeft"),y:n-e.css("marginTop")}},pageX:function(){var e=this.dom;return e.offsetParent?e.offsetLeft+this.offsetParent().pageX():e.offsetLeft},pageY:function(){var e=this.dom;return e.offsetParent?e.offsetTop+this.offsetParent().pageY():e.offsetTop},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},visible:function(e){var r=this,i=r.dom;if(e===n)return!D.pseudos.hidden(i);var o="none",a="display",u=i.style.display;if(e===!0)if(r.hasData("_"+a))r.css(a,r.data("_"+a)),r.removeData("_"+a);else{if(u===o&&(r.removeStyle(a),r.css(a)!==o))return r;var s=newDom(r.nodeName()).appendTo(t.body);r.css(a,s.css(a)),s.remove()}else r.css(a)!==o&&(""!==u&&r.data("_"+a,r.css(a)),r.css(a,o));return r},size:function(e,t){return e===n?this.css(["width","height"]):(b[1](e)&&b[1](t)||W.debug({path:"Std.dom",memberType:"public",memberName:"size",description:"parameter must be a string or a number"}),this.css({width:e,height:t}))},hasClass:function(e){return S.hasClass(this.dom,e)},className:function(e){var t=this,i=t.dom;(B(i)||A(i))&&(i=q(i));var o=i.className;return e===n?a(o)?o==r?"":o:i.getAttribute("class"):(a(o)?i.className=e:i.setAttribute("class",e),t)},addClass:p(function(e){var t=this;if(a(e)&&!t.hasClass(e=e.trim())){var r=t.className().split(" ");r.push(e),t.className(r.join(" ").trim())}},{each:[s]}),removeClass:function(e){var t=this;if(s(e)||a(e)||W.debug({path:"Std.dom",memberType:"public",memberName:"removeClass",description:"parameter must be a string or a array"}),s(e)){for(var r=t.className(),n=r.split(" "),i=0,o=e.length;o>i;i++)for(var u=0,c=n.length;c>u;u++)e[i]==n[u]&&delete n[u];t.className(n.join(" ").trim())}else a(e)&&t.removeClass(e.split(" "));return t},toggleClass:function(e,t){var r=this;return t===!1?r.removeClass(e):t===!0?r.addClass(e):r.hasClass(e)?r.removeClass(e):r.addClass(e),r},is:function(e){var t=this,r=t.dom,n=!1;return n=a(e)?P.matchSelector(r,e):u(e)?Y(e)===r:r===e},not:function(e){return!this.is(e)},html:function(e){var t=this,r=t.dom;return e===n?r.innerHTML:(u(e)||a(e)&&c.test(e)?(K(r),t.append(e)):r.innerHTML=e,t)},outerHTML:function(e){var t=this,r=t.dom;return e===n?r.outerHTML:(o(e)||a(e)||W.debug({path:"Std.dom",memberType:"public",memberName:"outerHTML",description:"parameter must be a string or a number"}),r.outerHTML=e+"",t)},insertHTML:function(e,t){var r=this;return et(r.dom,e,t),r},sheetText:function(e){var t=this,r=t.dom,i=r.styleSheet,o="";if(e===n){if(i)o=i.cssText;else if(r.sheet)try{var u=r.sheet.cssRules;if(u&&u.length)for(var s=0,c=u.length;c>s;s++)o+=u[s].cssText}catch(l){}return o}return a(e)||W.debug({path:"Std.dom",memberType:"public",memberName:"sheetText",description:"parameter must be a string"}),i!==n?i.cssText=e:(K(r),t.append(j.text(e))),t},text:function(e){var t=this,r=t.dom;return e===n?r.text||r.textContent||r.innerHTML||"":(o(e)||a(e)||W.debug({path:"Std.dom",memberType:"public",memberName:"text",description:"parameter must be a string or a number"}),K(r),t.append(j.text(e)))},value:function(e){var t=this,i=t.dom;return e===n?((e=i.value)==n&&(e=i.getAttribute("value"))==r&&(e=r),e):(o(e)||a(e)||W.debug({path:"Std.dom",memberType:"public",memberName:"value",description:"parameter must be a string or a number"}),i.value===n?i.setAttribute("value",e):i.value=e,t)},contentEditable:function(e){var t=this.dom,r="contentEditable";return e===n?t[r]||!1:(t[r]=e,this)},firstChild:function(){return j(this.dom.firstChild)},lastChild:function(){return j(this.dom.lastChild)},findSibling:function(e,t,i){var o,a,u=this,s=u.dom,c="nextSibling",f=r;switch(e){case"next":a=s[c];break;case"prev":c="previousSibling",a=s[c];break;case"all":var d=s.parentNode;d&&(a=d.firstChild)}if(!a)return r;i===!0&&(f=[]),t!=n&&(o=P.parseSelector(t));do if(a!==u.dom&&1===a.nodeType)if(t==n){if(i!==!0)return j(a);f.push(j(a))}else if(P.matchSelector(a,o)){if(i!==!0)return j(a);f.push(j(a))}while(a=a[c]);return l(f)&&(f=r),f},nextSibling:function(e){return this.findSibling("next",e)},nextSiblings:function(e){return this.findSibling("next",e,!0)},prevSibling:function(e){return this.findSibling("prev",e)},prevSiblings:function(e){return this.findSibling("prev",e,!0)},sibling:function(e){return this.findSibling("all",e)},siblings:function(e){return this.findSibling("all",e,!0)},swap:function(e){var t=this,r=t.parentNode(),n=t.dom,i=Y(e),o="insertBefore",a="appendChild";if(!i||!r||n===i)return t;var u=n.nextSibling,s=i.nextSibling;return u?s?(r[o](n,s),r[o](i,u)):(r[o](i,u),r[a](n)):(r[o](n,s),r[a](i)),t},append:p(function(e){var t=this,r=t.dom;(b[1](e)||s(e))&&(e=G(e)),u(e)?X(r,function(){r.appendChild(Y(e))}):W.debug({path:"Std.dom",memberType:"public",memberName:"appendChild",description:"illegal parameter"})}),insert:function(e,t){var n=this,i=n.children();return i===r||t==r||t>=i.length?n.append(e):n.insertBefore(e,i[t]),n},insertBefore:function(e,t){var r=this,i=r.dom;if(e===n)r.prepend(i);else if(t===n){var o=(e=Y(e)).parentNode;o&&X(o,function(){o.insertBefore(i,e)})}else e=b[1](e)||s(e)?G(e):Y(e),X(i,function(){i.insertBefore(e,Y(t))});return r},insertAfter:function(e,t){var r,i=this,o=i.dom;if(t===n){var a=(e=Y(e)).parentNode;a&&X(a,function(){a.lastChild===e?a.appendChild(o):a.insertBefore(o,e.nextSibling)})}else e=b[1](e)||s(e)?G(e):Y(e),X(o,function(){o.lastChild===(r=Y(t))?o.appendChild(e):o.insertBefore(e,r.nextSibling)});return i},detach:function(){var e,t=this,r=t.dom;return(e=r.parentNode)&&e.removeChild(r),t},remove:p(function(e){var t=this,i=t.dom,o=function(e){y in e&&e[y].destroy(),"__StdPlugins__"in e&&j(e).removePlugin(),x in e&&(e[x]=r),w in e&&(e[w]=r)};if(e===n)o(i),t.detach(),i._removed=!0;else{var a=Y(e);o(a),i.removeChild(a)}},{each:[s]}),prepend:function(e){var t=this,r=t.firstChild();return this.is(e)&&W.debug({path:"Std.dom",memberType:"public",memberName:"appendChild",description:"child cannot be the same with this element"}),r?t.insertBefore(e,r):t.append(e),t},prependTo:function(e){return j(e).prepend(this),this},appendChild:function(e){return this.is(e)&&W.debug({path:"Std.dom",memberType:"public",memberName:"appendChild",description:"child cannot be the same with this element"}),this.dom.appendChild(e),this},appendTo:function(e){return this.is(e)&&W.debug({path:"Std.dom",memberType:"public",memberName:"appendTo",description:"target cannot be the same with this element"}),j(e).append(this),this},clear:function(){return K(this.dom),this},childNodes:function(){return this.dom.childNodes},children:function(e){var t,s=0,c=this,f=[],d=c.dom,h=d.childNodes;if(!h||0===(t=h.length))return r;if(e===n)for(;t>s;s++)1===h[s].nodeType&&f.push(j(h[s]));else if(o(e))f=j(h[e]);else if(i(e))for(;t>s;s++){var m=h[s],p=e.call(c,s,m);if(p!==n)if(p===!0)f.push(j(m));else{if(p===!1)break;u(p)&&f.push(p)}}else if(a(e))for(var v=P.parseSelector(e);t>s;s++)1===h[s].nodeType&&P.matchSelector(h[s],v,d)&&f.push(j(h[s]));return l(f)&&(f=r),f},find:function(e,t){var n=it(e,this.dom),o=i(t);if(l(n))return r;for(var a=[],s=0,c=n.length;c>s;s++){var f=j(n[s]);if(o){var d=t.call(this,f);(d===!0||u(d))&&a.push(f)}else a.push(f)}return l(n)&&(a=r),a},hover:function(e,t){return this.mouse({enter:e,leave:t})},ajax:function(){var e=this;return N.load.apply(e,arguments).on("success",function(t){e.html(t)})},method:function(e){var t=this,n=Array.slice(arguments,1),o=t[e]||t.dom[e];return i(o)?o.apply(t,n):r},hasData:function(e){var t=this.dom;return e=e.camelCase(),t[x]&&t[x][e]!==n||t.dataset&&t.dataset[e]!==n||this.attr(e)!==r},data:p(function(e,t){var i=this,o=i.dom,a=e.camelCase(),u=b[2](o,x);return t==n?((t=u[a])===n&&(t=o.dataset?o.dataset[a]:i.attr("data-"+e.unCamelCase())),t===n&&(t=r),t):(u&&(u[a]=t),void 0)},{each:[u]}),removeData:p(function(e){var t=this,n=t.dom,i=e.camelCase(),o=n.dataset,a=b[2](n,x);a&&delete a[i],o&&o[i]?delete n.dataset[i]:t.attr("data-"+(e=e.unCamelCase()))!==r&&t.removeAttr("data-"+e)},{each:[s,a]}),style:function(e){var t=this.dom,r=t.style;return e===n?r:a(e)?r[e]:void 0},renderTemplate:function(e,t){var r=this.clear();if(a(e)){var n=z(e);n&&n.renderTo(r,t)}else e instanceof z&&e.renderTo(r,t);return r},getStyle:function(e){var t=this,n=t.dom,i=j.cssHook;return n===r?r:i[e=e.camelCase()]?i[e].call(t,n):V(n,e)},setStyle:function(e,t){var n=this,o=n.dom,a=j.cssHook;return o===r?n:(i(t)&&(t=t.call(n,n.getStyle(e))),""===t?n.removeStyle(e):(a[e=e.camelCase()]?a[e].call(n,o,t):$(o,e,t),n))},css:function(e,t,r){var i=this;if(a(e)){if(t===n)return i.getStyle(e);r===n?i.setStyle(e,t):i.css(e)===t&&i.css(e,r)}else if(s(e)){if(t===n){var o={};return h(e,function(e,t){o[t]=i.css(t)}),o}h(e,function(e,r){i.setStyle(r,t)})}else u(e)&&h(e,function(e,t){i.setStyle(e,t)});return i},attr:p(function(e,t){var o=this,a=o.dom,u=j.attrHook;if(s(e)){if(t===n){var c={};return h(e,function(e,t){c[t]=o.attr(t)}),c}h(e,function(e,r){o.attr(r,t)})}else{if(t==n){var l;return l=u[e]?u[e].call(o,a):a.getAttribute(e),l===n?r:l}i(t)&&(t=t.call(o,o.attr(e))),e in u?u[e].call(o,a,t):a.setAttribute(e,t)}},{each:[u]}),removeAttr:p(function(e){this.dom.removeAttribute(e)},{each:[s,a]}),removeStyle:p(function(e){var t=this,r=t.dom.style;if(u(e)&&W.debug({path:"Std.dom",memberType:"public",memberName:"removeStyle",description:"illegal parameter"}),r){if(e===n)return r.cssText="";e in g&&(e=g[e]),r.removeAttribute?r.removeAttribute(e):r.removeProperty(e.unCamelCase())}},{each:[s,a]}),on:p(function(e,t,n){var s=this,c=s.dom,l=c[w],f=r,d=r,h=L(c),m=r;if(i(t)&&(o(n)&&(m=n),n=t,t=r),a(t)&&(f=P.parseSelector(t)),!i(n))return s;u(l)||(l=c[w]={});var p=j.eventFix,v=p.mouseEvents.has(e),g=p.keyEvents.has(e),b=function(t){(t=t||h.event||r)!==r&&(p(t),v?p.mouse(t):g?p.keyboard(t):e in p.fix&&p.fix[e](t),t.name=e),s.emit(e,t,!1,!0,d)};if(!l[e]){l[e]=[];var y=e,k=!1;if(e in j.eventHook){var x=j.eventHook[e];d=x.check,y=x.name,k=x.useCapture}Q(c,l[e].eventName=y,l[e].eventFunc=b,k)}var _={callback:n,selector:f,selectorText:t||r};m!==r?l[e].insert(_,m):l[e].push(_)},{each:[s,u,a]}),off:p(function(e,t,o){function u(){var t=l[e].eventName,r=l[e].eventFunc;Z(c,t,r),delete l[e]}var s=this,c=s.dom,l=c[w];if(l)if(i(t)&&(o=t,t=r),e===n)h(l,function(e){s.off(e)});else if(l[e])if(o!==n||a(t)){for(var f=l[e],d=f.length,m=d-1;m>=0;m--){var p=f[m];if(p===n);else if(t===r){if(o===n||p.callback===o){f.splice(m,1),d--;break}}else if(!(o!==n&&o!==p.callback||t!==p.selectorText&&t!==p.selector)){f.splice(m,1),d--;break}}0>=d&&u()}else l[e].clear(),u();else;},{each:[s,u,a]}),emit:p(function(e,t,r,n,o){var a,s=this,c=r?"apply":"call",l=s.dom;if(isBool(e))return s.emitTurn=e,s;if(!l[w]||!(a=l[w][e])||s.emitTurn===!1)return s;for(var f=function(e,t){var r=e.target;do if(P.matchSelector(r,t,l))return r;while(r=r.parentNode);return!1},d=(function(){"stopPropagation"in t&&(t.stopPropagation(),t.preventDefault())}),h=0,m=a.length;m>h;){var p=a[h],v=l;if(!u(p)||n===!0&&u(p.selector)&&!(v=f(t,p.selector))||i(o)&&o.call(v,t)===!1)h++;else{if(p.callback[c](v===l?s:j(v),t)===!1&&d(),t&&t._stopFire===!0){delete t._stopFire;break}p===a[h]&&h++}}return s},{each:[s,a]}),once:k.prototype.once,eventAssign:k.prototype.eventAssign,delegate:function(e,t,r){return this.on(e,t,r)},undelegate:function(e,t,r){return this.off(e,t,r)},set:function(e){var t=this;if(u(e))for(var r in e)t[r](e[r]);return t},keyboard:function(e){function n(e){var t=l.keyCode;return t===r?!0:i(t)?t.call(s,e):e.which===l.keyCode}function o(e){c=0,p(l.press).call(s,e)}function a(e){return 1==c&&o(e),l.classStatus&&s.removeClass("press"),p(l.up).call(s,e)}function u(e){return n(e)?(l.classStatus&&s.addClass("press"),c=1,j(t).once("keyup",a),p(l.down).call(s,e)):void 0}var s=this,c=0,l=m({down:r,up:r,press:r,keyCode:r,classStatus:!1},e);return s.on("keydown",u)},hasFocus:function(){var e=this,t=e.document(),r=t?t.activeElement:t;return i(t.hasFocus)&&!t.hasFocus()?!1:e.is(r)||e.contains(r)},focussing:function(e,t,i){var o=this,a=r,u=!1,s=i===n?o.hasFocus():i,c=function(r){p((s=u)?e:t).call(o,r)};return o.on("focusin focusout",function(e){u="focusin"===e.name,a==r?c(e):clearTimeout(a),a=setTimeout(function(){s!==u&&(c(e),a=r)},0)})},fullScreen:function(e){var t=this,r=!0,i=t.dom,o=R(i),a="Fullscreen",u="exit"+a,s="request"+a,c="mozCancelFullScreen",l="webkitExit"+a,f="mozRequestFullScreen",d="msRequest"+a,h="webkitRequest"+a;return e===n?r=(o.fullscreenElement||o.mozFullScreenElement||o.webkitFullscreenElemen)!==i?!1:!!(o.fullscreenEnabled||o.mozFullScreenEnabled||o.webkitFullscreenEnabled):e===!0?i[s]?i[s]():i[f]?i[f]():i[h]?i[h]():i[d]?i[d]():r=!1:o[u]?o[u]():o[c]?o[c]():o[l]?o[l]():r=!1,r},mouse:function(e,t){function n(e){f=T({delay:l.delay,interval:l.interval,progress:l.longpress.bind(c,e)})}function o(e){return f!==r&&(f.stop(),f=r),d&&c.removeClass("press"),l.unselect&&c.unselect(!1),i(l.up)?l.up.call(c,e):void 0}function a(e){return j(q(c.dom)).once("mouseup",o),d&&1===e.which&&c.addClass("press"),l.unselect&&c.unselect(!0),i(l.longpress)&&n(e),i(l.down)?l.down.call(c,e):void 0}function u(e){return c.off("mousedown",a),f!==r&&(f.stop(),f=r),d&&c.removeClass("hover"),i(l.click)&&c.off("click",l.click),i(l.dblclick)&&c.off("dblclick",l.dblclick),i(l.leave)?l.leave.call(c,e):void 0}function s(e){return c.on("mousedown",a).once("mouseleave",u),d&&c.addClass("hover"),i(l.click)&&c.on("click",l.click),i(l.dblclick)&&c.on("dblclick",l.dblclick),i(l.enter)?l.enter.call(c,e):void 0}var c=this,l=m({enter:r,leave:r,down:r,up:r,click:r,dblclick:r,longpress:r,unselect:!1,classStatus:!0,auto:!0,delay:600,interval:100},i(e)?e():e),f=r,d=l.classStatus;return l.auto?c.on("mouseenter",s):s.call(c,t),c},sizeControl:function(e,t,i){var o=this,u=0;if(a(t))u+=o.css(t);else if(s(t))for(var c=0,l=t.length;l>c;c++)u+=o.css(t[c]);return i===n?e===r?u:o.css(e)+u:(o.dom.style[e]=i-u+"px",o)},widget:function(e,t){var i=this,o=i.dom;return e===n?o[y]||r:(f(o[y])&&o[y].destroy(),f(e)?o[y]=e:u(e)&&e.ui?o[y]=M(e.ui,e):a(e)&&u(t)&&(o[y]=M(e,t)),o[y]&&o[y].renderTo(i),i)},animate:function(e,t,r){function c(e){var n=u(t)?t.method||"css":"css",o={},a=new H.keyframes(t).rules(e).on({pause:function(){o={}},progress:function(e){if(m._removed)a.stop(),f._("clear");else for(var t in e){var r=e[t];o[t]!==r&&d["css"===n?"setStyle":n](t,o[t]=r)}},complete:function(){var e=f._("indexOf",a);-1!==e&&f._("remove",e),++g==v&&i(r)&&r.call(d,v,a)}});a.defaultProperty(h(a._property,function(e,t){return"color"===t.type&&"background"===e&&(e+="-color"),d[n](e)},!0)).start(),f._(a),v++}var l,f,d=this,m=d.dom,p="keyframes",v=0,g=0;if(l=b[2](m,_),f=l[p]?l[p]:l[p]=new H.keyframes.united,e===n)return f;if(t===n&&a(e)){switch(e){case"start":case"pause":case"stop":f[e]();break;case"end":f.stop(),f._("clear")}return d}return o(t)&&(t={duration:t}),s(e)?h(e,function(e,t){c(t)}):c(e),f},animation:function(){}};h({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r=/Y/.test(t);ot[e]=function(i){var o=this,a=o.dom,u=L(a,!0);return i===n?u?t in u?u[t]:q(u)[e]:a[e]:(u?u.scrollTo(r?j(u).scrollLeft():i,r?i:j(u).scrollTop()):a[e]=i,o)}}),h("scrollWidth scrollHeight offsetWidth clientWidth offsetHeight clientHeight offsetLeft offsetTop tagName nodeName type readyState",function(e,t){ot[t]=function(e){var r=this,i=r.dom;return e===n?i[t]:(a(e)||o(e)||W.debug({path:"Std.dom",memberType:"public",memberName:t,description:"parameter muse be a string or a number"}),i[t]=e,r)}}),h("opacity outerWidth outerHeight zIndex cursor color width height minWidth minHeight",function(e,t){ot[t]=function(e){return this.css(t,e)}}),h("id name",function(e,t){ot[t]=function(e){return this.attr(t,e)}}),h("submit focus blur",function(e,t){ot[t]=function(){var e=this,r=e,i=e.dom;if(t in i){try{r=i[t].apply(i,arguments)}catch(o){}r===n&&(r=e)}return r}});var at=function(e){var t=e.target.nodeName;"INPUT"!==t&&"TEXTAREA"!==t&&e.preventDefault()};return h({unselect:"Std_unselect",wordwrap:"Std_wordwrap",wordnowrap:"Std_wordnowrap"},function(e,t){ot[e]=function(r){return"unselect"==e&&this[r?"on":"off"]("selectstart",at),this.toggleClass(t,r)}}),{f:S,a:"plugin",j:ot,k:function(e,t){var i,o=this,u=o instanceof j;return u===!1?(i=Y(e,t))===r?r:new j(i,!1):(t===!1?o.dom=e:(a(e)?s(i=j.loadHTML(P.html(e)))&&(o.dom=i[0]):o.dom=J(Y(e)),t!==n&&t!==r&&o.appendTo(t)),void 0)}}}),j.united=g(function(){var e=W.unite(j);return{f:{addMember:p(function(t){W.unite.addMember(e,t)},{each:[s]})},k:function(t,i){var o=this,u=o instanceof j.united,c=new e;if(a(t)){var f;f=u?j.loadHTML(P.html(t)):j.query(t,i),l(f)||h(Array.from(f),function(e,t){c._(j(t))})}else if(s(t))h(t,function(e,t){(t=j(t))!==r&&c._(u?t.clone():t)});else if(t!==n){var d=j.get(t);null!==d&&c._(j(u?j.clone(d):d))}return c}}}),j.eventFix=g(function(){var e="srcElement",i="relatedTarget",o="fromElement",a="stopPropagation",u="preventDefault";return{f:{keyEvents:"keydown keypress keyup".split(" "),mouseEvents:"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick contextmenu".split(" "),mouse:function(e){var r=e.button;if(e.which==n&&r!=n&&(e.which=1&r?1:2&r?3:4&r?2:0),e.pageX===n&&e.clientX!==n){var i=e.target.ownerDocument||t,o=i.documentElement,a=i.body;e.pageX=e.clientX+(o&&o.scrollLeft||a&&a.scrollLeft||0)-(o&&o.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||a&&a.scrollTop||0)-(o&&o.clientTop||a&&a.clientTop||0)}},keyboard:function(e){e.which==r&&(e.which=e.charCode!=r?e.charCode:e.keyCode)},fix:{mousewheel:function(e){var t=e.detail?-1*e.detail:e.wheelDelta/40;e.dir=0>t?-1:1}}},k:function(t){var r=t.target||t[e];!t.target&&t[e]&&(r=t.target=t[e]),r&&3===r.nodeType&&(t.target=r.parentNode),!t[i]&&t[o]&&(t[i]=t[o]===r?t.toElement:t[o]),t.metaKey===n&&(t.metaKey=!1),t[a]||(t[a]=function(){t.cancelBubble=!0}),t[u]||(t[u]=function(){t.returnValue=!1}),t.stopFire=function(){this._stopFire=!0}}}}),j.cssHook=function(){var e=/alpha\([^)]*\)/i,t=/opacity\s*=\s*([^)]*)/,r="opacity",i="filter",u="backgroundPosition",s=W.init.css,c=j.getStyle,f=j.setStyle,d={width:["paddingRight","paddingLeft","borderRightWidth","borderLeftWidth"],height:["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"]},m={"float":function(e,t){var r=e.style,i=s.cssFloat?"cssFloat":"styleFloat";return t===n?r[i]||c(e,"float")||c(e,i):(r[i]=t,void 0)},outerWidth:function(e,t){return this.sizeControl("width",d.width,t)},outerHeight:function(e,t){return this.sizeControl("height",d.height,t)},innerWidth:function(e,t){return this.sizeControl("width",["paddingRight","paddingLeft"],t)},innerHeight:function(e,t){return this.sizeControl("height",["paddingTop","paddingBottom"],t)},opacity:function(o,a){var u=o.style,l=s[r],f=o.currentStyle;if(a===n)return l?c(o,r):t.test((f?f[i]:u[i])||"")?.01*float(RegExp.$1)+"":"1";if(l)u[r]=a;else{var d=D.hooks[r](a).value,h=f&&f[i]||u.filter||"";if(u.zoom=1,(d>=1||""===d)&&""===h.replace(e,"").trim()&&u.removeAttribute&&(u.removeAttribute(i),""===d||f&&!f[i]))return;u.filter=e.test(h)?h.replace(e,d):h+" "+d}}};return m[u]=function(e,t){return t===n?(l(t=c(e,u))&&(t=c(e,u+"X")+" "+c(e,u+"Y")),t):(f(e,u,t),void 0)},h("X Y",function(e,t){var r=u+t;m[r]=function(t,i){if(i===n){if(l(i=c(t,r))){var o=c(t,u);return o==n?0:o.split(" ")[e]}return i}f(t,r,i)}}),h("width height",function(e,t){var r=t.capitalize();m[t]=function(i,u){if(u===n){if(j.isWindow(i))return i.document.documentElement["client"+r];if(9===i.nodeType){var s=i.documentElement;return Math.max(i.body["scroll"+r],s["scroll"+r],i.body["offset"+r],s["offset"+r],s["client"+r])}var l=c(i,t);if(a(l)&&("auto"===l||"%"===l.right(1))){var h=0==e?i.offsetWidth:i.offsetHeight;return o(h)&&(l=h-this.sizeControl(null,d[t])),l||0}return float(l||0)||0}f(i,t,o(u)?u+"px":u)}}),h("left top right bottom margin marginTop marginLeft marginRight marginBottom lineHeight borderRightWidth borderLeftWidth borderTopWidth borderBottomWidth padding paddingLeft paddingRight paddingTop paddingBottom",function(e,t){m[t]=function(e,r){return r===n?float(c(e,t)||0)||0:(o(r)&&(r+="px"),f(e,t,r),void 0)},j.extend(t,function(e){var r=this;return e===n?r.css(t):r.css(t,e)})}),m}(),j.attrHook=function(){var e={};return h({id:"id","class":"className",href:"href",name:"name",type:"type"},function(t,r){e[t]=function(e,t){return t===n?e[r]:(e[r]=t,void 0)}}),e.style=function(e,t){return t===n?e.style.cssText:(e.style.cssText=t,void 0)},e}(),j.eventHook=function(){var t={},r=j(e),n=0,i=0,o=!1;return W.init.on.focusin||h({focusin:"focus",focusout:"blur"},function(e,r){t[e]={name:r,useCapture:!0,check:function(){return!0}}}),h({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,r){t[e]={name:r,check:function(e){var t=e.relatedTarget;return!t||!j.contains(t,this)}}}),"onmousewheel"in e||(t.mousewheel={name:"DOMMouseScroll"}),t.resize={name:"resize",check:function(){return r.is(this)?o:!0}},j.addListener(r.dom,"resize",function(){var e=r.width(),t=r.height();e===n&&t===i?o=!1:(o=!0,n=e,i=t)}),t}(),j.selection=g(function(){function e(e){return j.document(e).selection||j.window(e).getSelection()||r}function i(e,t){return s(e,"html",t)}function a(e,t){return s(e,g,t)}function u(t,r){var i=e(t);return r===n?y in i?i[y]():i.getRangeAt(0):(b in r?r[b]():(i.removeAllRanges(),i.addRange(r)),void 0)}function s(e,t,r){var n="",i=t===g,a=r||a();return n=(i?g:"htmlText")in a?a[i?g:"htmlText"]:o(e[x])?e.value.substring(e[x],e.selectionEnd):newDiv().append(a.cloneContents())[i?g:"html"]()}function c(e){if(o(e[x]))return e[x];if(S){var t=u(e);return t.moveStart("character",-e.value.length),t.text.length}}function l(e){if(S){var t=u(e),r=t.duplicate();return r.moveToElementText(e),r.setEndPoint("EndToEnd",t),r.text.length-t.text.length}}function f(){}function d(){}function h(e,t){var r=e.nodeName.toLowerCase();if("input"===r||"textarea"===r){if(t===n)return c(e);f(e,t)}else{if(t===n)return l(e);d(e,t)}}function m(e,t,i){var o=r;t===n?e[b]():_ in e?(o=e[_](),o.collapse(),o.moveEnd(k,i),o.moveStart(k,t),o[b]()):w in e&&(e.focus(),e[w](t,i))}function p(e){var t=j.window(e),n=j.document(e),i=n.body,o=r;if(i&&i[_])o=i[_](),o.moveToElementText(e),o[b]();else if(t.getSelection){var a=t.getSelection();o=n[y](),o.selectNodeContents(e),a.removeAllRanges(),a.addRange(o)}}function v(e,t,r){b in e?m(e,t,r):p(e,t,r)}var g="text",b="select",y="createRange",k="character",w="setSelectionRange",x="selectionStart",_="createTextRange",S=t.selection;return j.extend({selection:function(){return e(this.dom)},selectionRange:function(){return u(this.dom)},selectedHTML:function(e){return i(this.dom,e)},selectedText:function(e){return a(this.dom,e)},select:function(e,t){return v(this.dom,e,t),this},cursorPos:function(e){return e===n?h(this.dom):(h(this.dom,e),this)}}),{"public":{select:function(e,t){v(this._e,e,t)},selectedHTML:function(e){i(this._e,e)},selectedText:function(e){a(this._e,e)},cursorPos:function(e){return h(this._e,e)}},main:function(e){this._e=j.get(e)}}}),B=W.sbs=g({f:{load:function(e){return u(e)?(e.data&&h(e.data.indexes.SCRIPT,function(e,t){j.behaviorScript(t)}),this):this},parse:function(e){var t={},r=t.indexes={};return h(newDiv().append(j.fragment(e,!1)).find("*"),function(e,t){var n=t.nodeName();n in r||(r[n]=[]),r[n].push(t.dom)}),t}},k:function(e){var t=this;t instanceof B?this.data=B.parse(e):B.load(new B(e))}}),M=W.ui=W.module({f:{rules:{},modules:{},status:{zIndex:100,index:0,resize:0,drag:0},exist:function(e){return a(e)||W.debug({path:"Std.ui",memberType:"static",memberName:"exist",description:"illegal parameter,module name should be a string."}),e in M.modules},action:function(e,t){var r=g.property(M.modules[e],"action");return t===n?r:r[t]},build:function(e){var t=M.rules[e];return t&&t.build()||r},createByElement:function(e,t){a(e)||W.debug({path:"Std.ui",memberType:"static",memberName:"createByElement",description:"illegal parameter,UIName must be a string"});var r=M.action(e),n=t.attr("std-option"),o=t.attr("std-option-name"),u="content",s="childNodes";a(n)&&(n=n.toObject()),a(o)&&(n=A.get(o,n)),u in r&&"html"===u&&(n.html=t.html().trim());var c=M(e,n),l=function(e,r){a(e)?c[e](r):i(e)&&e.call(c,t,r)};return s in r&&l(r[s],t.children()),t.removeAttr("std-ui"),i(c.renderTo)||W.debug({path:"Std.ui",memberType:"static",memberName:"createByElement",description:e+" must inheritance from widget"}),c.renderTo(t.clear())
},create:function(e,t){if(a(e)){var n=M.modules[e];return n?new n(t||{}):(W.debug({path:"Std.ui",memberType:"static",memberName:"create",description:"load failed,module "+e+" doesn't exist"}),r)}return u(e)?h(e,function(e,t){return u(t)&&t.ui?M(t.ui,t):a(t)?M(t,{}):void 0},!0):r},module:function(e,o){if(e===n&&W.debug({path:"Std.ui",memberType:"static",memberName:"module",description:"illegal parameter"}),a(e)){if(o===n)return M.modules[e]||r}else o=e;a(e)&&i(o)&&(o=o.call(W,M)),o=m({},o);var u,s=o.namespaceURI,c=l(s)?newDom:function(e){return j(t.createElementNS(s,e))},f=o.nodeName||"div",d=c(f).attr("tabindex",1),h=[],p="prototype",v="objectName";return o.__constructor__=function(t){var i,o=this,a=o.init_opts(t);switch(a.tabIndex){case 1:i=d.clone();break;case r:case n:i=c(f);break;default:i=c(f).attr("tabindex",a.tabIndex)}i.dom.ui=o,o[0]=i,(o[v]=a[v])||(o[v]=e+ ++M.status.index),a.on&&o.on(a.on),o.emit("create");for(var u=h.length-1;u>=0&&h[u].call(o,o,a,i)!==!1;u--);a.renderTo&&o.renderTo&&o.renderTo(a.renderTo)},(u=g(e,o,M))===r?u:(u[p].ui=e,u[p].emit=k[p].emit,u[p].__emit__=k[p].__emit__,u[p].__Std__.nodeName=f,h=g.property(u,"main",!0),u)}},k:function(e,t){return t===n&&a(e)?M.modules[e]||r:M.create(e,t)}}),M.rule=W.module(function(){var e="content",t="children",o="selector";return{f:{add:p(function(e,t){a(t)&&(t=P.parse(t,!1)),u(t)&&(M.rules[e]=new M.rule(t))},{each:[s,u]}),remove:p(function(e){a(e)&&delete M.data[e]},{each:[s]})},h:{selector:null,buildData:null,compileData:null},i:{execAction:function(e,t,r){return a(t)?e[t](r):i(t)&&t.call(e,r),this},pushInstance:function(e,t,r){var i=this,o=t["*"],a=function(){var n=i.createUI(t,r);n&&e.push(n)};if(o!==n){o=int(o);for(var u=0;o>u;u++)a()}else a();return i},compile2:function(e){for(var t=this,r=[],n=!1,i=e.length-1;i>=0;i--){var a=e[i];switch(n===!0&&(n=!(a.items=Array.from(r).reverse()),r.clear()),e[i][o]?(r.mergeArray(t.compile(a[o])),delete a[o]):r.push(a),a["<"]){case">":case" ":n=!0}}return r}},j:{createUI:function(i,o){var a=this,u=i.tag,s={};if("*"===u&&!l(i.content))return i.content;if(!M.exist(u))return r;h(i["."],function(e,t){m(s,A.get(t))}),h(i.attr,function(e,t){"="===t.operator&&(s[t.name]=t.value)});var c=i["#"],f=M.action(u),d=M(u,s);if(!d)return r;if(e in f&&a.execAction(d,f[e],i.content),t in f&&!l(i.items)){var p=[];h(i.items,function(e,t){a.pushInstance(p,t,o)}),a.execAction(d,f[t],p)}return h(i[":"],function(e,t){d[e].apply(d,t)}),c!==n&&(o[c]=d),d},compile:function(e){var t=this,r=[];e===n&&(e=t._selector);for(var i=0,o=e.length;o>i;i++){var a=t.compile2(e[i]);if(!l(a))for(var u=0,s=a.length;s>u;u++)r.push(a[u])}return t._compileData=r},build:function(e){var t=this,r=e||t._selector,n={},i=[];return s(r)||W.debug({path:"Std.ui.rule",memberType:"private",memberName:"build",description:"build failed,illegal rule!"}),t._compileData||t.compile(r),h(t._compileData,function(e,r){t.pushInstance(i,r,n)}),{data:i,dataMap:n}}},k:function(e){var t=this;return t instanceof M.rule?(a(e)&&(e=P.parse(e,!1)),u(e)&&(t._selector=e),void 0):new M.rule(e).build()}}}),M.module("widget",function(){var t="boxSize",s="renderState",l="contentType",f="__StdEvents__";return{a:"events plugin",c:"create resize visible enable load remove beforeRender render",e:{level:2,parent:r,renderTo:r,objectName:"",defaultClass:"",className:"",tabIndex:1,top:r,left:r,width:"auto",height:"auto",minWidth:3,minHeight:3,maxWidth:r,maxHeight:r,enable:!0,visible:!0,animation:null,initSize:!0,plugins:r,validator:"",invalidText:"invalid",cache:!0,value:r,contentType:"",data:r,url:r,html:r,iframe:r,layout:r,boxSizing:"content-box",fixedLayoutWidth:!1,fixedLayoutHeight:!1},action:{content:"html",children:function(e){this.layout(M("VBoxLayout",{items:e}))}},i:{boxSize:0,renderState:!1},j:{init_boxSize:function(){var e=this,r=e.opts,n=e.__Std__,i=r.defaultClass+r.className;return n[t]||(n[t]={}),e[t]=n[t][i]?n[t][i]:n[t][i]=e[0][t](),e},init_content:function(){var e=this,t=e.opts,r=t[l];return""===r?t.html?e.html(t.html):t.url?e.url(t.url):t.iframe?e.iframe(t.iframe):t.layout&&e.layout(t.layout):a(r)&&e[r](t[r]),e},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},hasClass:function(e){return this[0].hasClass(e)},addClass:function(e){return this[0].addClass(e),this},removeClass:p(function(e){this[0].removeClass(e)}),toggleClass:p(function(e,t){this[0].toggleClass(e,t)}),className:function(e){var t=this;return e===n?t[0].className():(t[0].className(t.opts.defaultClass+" "+e),t)},minWidth:function(e){var t=this;return t.opt("minWidth",e,function(){o(e)&&t.width()<e&&t.width(e)})},minHeight:function(e){var t=this;return t.opt("minHeight",e,function(){o(e)&&t.height()<e&&t.height(e)})},maxWidth:function(e){var t=this;return t.opt("maxWidth",e,function(){o(e)&&t.width()>e&&t.width(e)})},maxHeight:function(e){var t=this;return t.opt("maxHeight",e,function(){o(e)&&t.height()>e&&t.height(e)})},enable:function(e){return this.opt("enable",e,function(){this.toggleClass("disabled",!e).__emit__("enable",e)})},disable:function(e){return e===n?!this.enable():this.enable(!e)},visible:function(e,t){var r=this,i=r.opts;return e===n?r[s]?r[0].visible():!1:(i.visible=e,t===!1?r[0].visible(e):r.animation("visible",function(){r[0].visible(e)},e),r.__emit__("visible",e))},focus:p(function(e,t){var r=this;o(e)?setTimeout(function(){r[0].focus(),p(t).call(r)},e):r[0].focus()}),blur:p(function(e,t){var r=this;o(e)?setTimeout(function(){r[0].blur(),p(t).call(r)},e):r[0].blur()}),valid:function(){var e=this,t=e.value(),r=e.validator();return i(r)?r(t):r in W.validator?W.validator[r](t):W.is(r,t)},toForeground:p(function(){this[0].css("zIndex",++W.ui.status.zIndex)}),beforeRender:function(){return this.emit("beforeRender")},appendTo:function(e){return this[0].appendTo(e),this},html:function(e){var t=this,r=t.opts;return e===n?t[0].html():(t.removeLayout(),t[0].html(r[r[l]="html"]=e),t.emit("load",e))},iframe:function(e,t){var r=this;return r.opt("iframe",e,function(){var n=newDom("iframe").attr({src:e,frameBorder:"0"}).css({"float":"left",width:"100%",height:"100%",border:0}).on("load",function(){r.emit("load",n),p(t).call(r,n)});r.removeLayout(),r.opts[l]="iframe",r[0].clear().append(n)})},url:function(e,t){var r=this,n=r.opts;return r.opt("url",e,function(){n[l]="url",N({url:e,cache:n.cache,success:function(e){r.removeLayout(),r[0].html(e),r.emit("load",e),p(t).call(r,e)}})})},animation:p(function(e,t,r){var n=this,o=n.opts,s=o.animation;if(u(s)){if(i(s[e]))return s[e].call(n,t,r),void 0;if(a(s[e])){var c=H(s[e]);if(i(c))return c.call(n,t,r),void 0}}t()}),updateLayout:p(function(){var e=this,t=e.opts;d(t.layout)&&t.layout.update()}),layout:function(e){var t=this,i=t.opts;return e===n?i.layout||r:(d(i.layout)&&t[s]&&t.removeLayout(),e&&c(e)&&e.ui&&(e=M(e.ui,e)),d(e)?(i.layout=e,i[l]="layout",t[s]?(t[0].clear().css("position","static","relative"),t.level(e.level()).on({resize:t.updateLayout,remove:t.removeLayout}),t.emit("load",e.parent(t).render().update())):t):t)},on:p(function(e,t){var r=this;if(e!==n&&i(t)||W.debug({path:"Std.ui",module:r.ui,memberType:"public",memberName:"on",description:"illegal parameter"}),r[f]||(r[f]={}),r.__Std__.events.has(e)){var o=r[f];o[e]||(o[e]=[]),o[e].push(t)}else r[0].on(e,t)},{each:[u,a]}),off:p(function(e,t){var r=this;if(e!==n&&i(t)||W.debug({path:"Std.ui",module:r.ui,memberType:"public",memberName:"off",description:"illegal parameter"}),r.__Std__.events.has(e)){var o=r[f];if(!o||!o[e])return r;t===n?o[e].clear():h(o[e],function(r,n){return n===t?(o[e].remove(r),!1):void 0})}else r[0].off(e,t)},{each:[u,a]}),move:function(t,i){var u=this,s=u[0];(t===n||!a(t)&&!o(t))&&W.debug({path:"Std.ui",module:u.ui,memberType:"public",memberName:"move",description:"illegal parameter"});var c=r,l=function(){return c!==r?c:(c=s.offsetParent(),(!c||c.contains("body"))&&(c=j(e)),c)},f=function(e){return e.offsetWidth()||e.width()},d=function(e){return e.offsetHeight()||e.height()};if(i===n){if("cent"===t.substr(0,4)){var h=l(),m=(f(h)-u.width())/2,p=(d(h)-u.height())/2;"central"==t&&(p-=.25*p),s.css({left:m,top:p})}}else s.css({left:t,top:i});return u},left:function(e){var t=this;return e===n?t[0].css("left"):(o(e)||a(e)||W.debug({path:"Std.ui",module:t.ui,memberType:"public",memberName:"left",description:"illegal parameter"}),t[0].css("left",e),t)},top:function(e){var t=this;return e===n?t[0].css("top"):(t[0].css("top",e),t)},opacity:p(function(e){var t=this;return e===n?t[0].opacity():(t[0].opacity(e),void 0)}),renderTo:function(e){var t=this;return t.opt("renderTo",e,function(){t[0].is(e)&&W.debug({path:"Std.ui",module:t.ui,memberName:"renderTo",description:"target cannot be the same with this widget"}),t.appendTo(e),t.render()})},size:p(function(e,t){var r=this;return e===n?{width:r.width(),height:r.height()}:(u(e)&&t===n?r.size(e.width,e.height):r.width(e,!1).height(t,!1),void 0)}),width:function(e,r){var i=this,a=i.opts,u=i[t];if(e===n)return o(a.width)?a.width:i[0].width()+u.width;if(!i[s])return a.width=e,i;if(o(e)){var c=a.minWidth,l=a.maxWidth;c&&c>e&&(e=c),l&&e>l&&(e=l),r===!1?i[0].width(e-u.width):i.animation("width",function(){i[0].width(e-u.width)},e-u.width)}return i.__emit__("resize",{width:a.width=e})},height:function(e,r){var i=this,a=i.opts,u=i[t];if(e===n)return o(a.height)?a.height:i[0].height()+u.height;if(!i[s])return a.height=e,i;if(o(e)){var c=a.minHeight,l=a.maxHeight;c&&c>e&&(e=c),l&&e>l&&(e=l),r===!1?i[0].height(e-u.height):i.animation("height",function(){i[0].height(e-u.height)},e-u.height)}return i.__emit__("resize",{height:a.height=e})},render:function(){var e=this,t=e.opts;return e[s]?e:(e.beforeRender(t),e[s]=!0,e.init_boxSize(),t.initSize&&(e.width(t.width,!1),e.height(t.height,!1)),t.left!==r&&e.left(t.left),t.top!==r&&e.top(t.top),t.visible||e.visible(!1,!1),t.enable||e.enable(!1),t.plugins&&e.plugin(t.plugins),t[l]!==r&&e.init_content(),e.__emit__("render"))},destroy:function(){var e=this;return e[s]=-1,e.removePlugin(),e[0].remove(),e},remove:function(e){var t=this;return e===n&&(t[s]=-1,t.animation("remove",function(){t.removePlugin(),t[0].remove()}),t.__emit__("remove")),t},removeLayout:p(function(){var e=this,t=e.opts;d(t.layout)&&t.layout[s]&&(e.off({resize:e.updateLayout,remove:e.removeLayout}),t.layout.remove(),t.layout=r)})},k:function(e,t,r){e[0].className("StdUI "+t.defaultClass+" "+t.className),t.css&&r.css(t.css),t.appendTo?r.appendTo(t.appendTo):t.prependTo&&r.prependTo(t.prependTo)},l:function(e,t){h("parent level value validator invalidText fixedLayoutWidth fixedLayoutHeight",function(e,r){t[r]=function(e){return this.opt(r,e)}})}}}),M.module("locker",{b:"widget",e:{level:5,opacity:.4,background:"#000",cursor:"default",position:"absolute",visible:!1,tabIndex:r},g:{render:function(){this.opts.visible&&this.resize(),this.on("contextmenu",p(!1))},visible:function(e){e===!0&&this.resize()},remove:function(){j(e).off("resize",this._resize)}},j:{resize:function(){var e=this,r=e[0].offsetParent();return r?(r.contains("body")&&(r=j(t)),e[0].css({left:0,top:0,width:r.offsetWidth()||r.width(),height:r.offsetHeight()||r.height()}),e):e},cursor:function(e){return this.opt("cursor",e,function(){this[0].css("cursor",e)})}},k:function(t,r,n){n.css({opacity:r.opacity,background:r.background,cursor:r.cursor,overflow:"hidden",position:r.position,zIndex:++M.status.zIndex}),j(e).on("resize",t._resize=function(){t.resize.call(t)})}}),M.module("sep",{b:"widget",e:{level:3,defaultClass:"StdUI_Sep",tabIndex:r}}),M.module("spacing",{b:"widget",e:{level:1,minHeight:1,minWidth:1,height:2,width:2,tabIndex:r}}),M.module("stretch",{b:"widget",e:{level:5,tabIndex:r}}),M.module("layoutItem",{b:"widget",e:{item:0,level:1,type:"widget",direction:"horizontal",initSize:!1,tabIndex:r},g:{render:function(){var e=this,t=e.opts,i=t.type,o=t.item;if(o!=n){if(o.render(),"widget"==i)t.width=o.width(),t.height=o.height(),t.minWidth=o.minWidth(),t.minHeight=o.minHeight();else if("layout"==i){var a=o.sizeInfo();t.width=o.fixedLayoutWidth()&&o.opts.width!=r?o.opts.width:a.width,t.height=o.fixedLayoutHeight()&&o.opts.height!=r?o.opts.height:a.height,t.minWidth=a.minWidth,t.minHeight=a.minHeight}e[0].cssText("position:absolute;width:"+t.width+"px;height:"+t.height+"px")}},width:function(e){var t=this.opts,r=t.type,n=t.item;"widget"==r?n.width(e,!1):"layout"==r&&n.update()},height:function(e){var t=this.opts,r=t.type,n=t.item;"widget"==r?n.height(e,!1):"layout"==r&&n.update()},remove:function(){var e=this.opts.item;e&&e.destroy()}},i:{init_boxSize:function(){this.boxSize={width:0,height:0,paddingLeft:0,paddingTop:0}}},j:{type:function(e){return this.opt("type",e)},fixedLayoutWidth:function(){return this.item().fixedLayoutWidth()},fixedLayoutHeight:function(){return this.item().fixedLayoutHeight()},item:function(e){var t=this,i=t.opts,o="";if(e===n)return i.item;if(f(e))o="widget",e.appendTo(t[0]);else if(d(e))o="layout";else if(u(e)&&e.ui){if(M.exist(e.ui)||W.debug({path:"Std.ui",module:"layout",description:"can't find ui module:"+e.ui}),!(e=M(e.ui,e)))return r;d(e)?o="layout":(o="widget",e.appendTo(t[0]))}return f(e)||d(e)||W.debug({path:"Std.ui",module:"layout",description:"illegal layout item"}),i.type=o,i.level=e.level(),i.item=e,e.parent(t),t}},k:function(e,t){t.item&&e.item(t.item)}}),M.module("layout",{e:{level:2,spacing:4,parent:r,items:r,fixedLayoutWidth:!1,fixedLayoutHeight:!1},action:{children:"append"},i:{renderState:!1,resetLevel:function(e){var t=this;return e.level()>t.level()&&t.level(e.level()),t}},j:{direction:"vertical",each:function(e){return W.each(this.items,e)},refresh:function(){var e=this;return h(e.items,function(t,r){e.resetLevel(r)}),e},spacing:function(e){return this.opt("spacing",e,function(){this.renderState&&this.update()})},parentWidget:function(){var e,t=this,n=t.parent();return n?f(n)||n instanceof j?e=n:d(n)&&(e=n.parentWidget()):e=r,e},insert:p(function(e,t){var r=this,n=M("layoutItem",{parent:r,direction:r.direction,item:e});if(r.resetLevel(n),r.items.insert(n,t),r.renderState){var i=r.parentWidget();i&&j(i).insert(n,t),n.render()}},{each:[s]}),append:p(function(e){var t=this,r=M("layoutItem",{parent:t,direction:t.direction,item:e});t.resetLevel(r),t.items.push(r),t.renderState&&r.renderTo(t.parentWidget())},{each:[s]}),sizeInfo:function(){var e,t,r,n,i,o,a,u=this,s=0,c=0,l=0,f=0,d=u.items.length,h=u.direction;if("horizontal"==h)for(e=0;d>e;e++)t=u.items[e],r=t.level(),a=t.width(),o=t.height(),n=t.fixedLayoutWidth(),i=t.fixedLayoutHeight(),s+=a,o>c&&(c=o),l+=1==r||n?a:t.minWidth(),1==r||i?o>f&&(f=o):t.minHeight()>f&&(f=t.minHeight()),e>0&&(s+=u.spacing(),l+=u.spacing());else if("vertical"==h)for(e=0;d>e;e++)t=u.items[e],r=t.level(),a=t.width(),o=t.height(),n=t.fixedLayoutWidth(),i=t.fixedLayoutHeight(),c+=o,a>s&&(s=a),f+=1==r||i?o:t.minHeight(),1==r||n?a>l&&(l=a):t.minWidth()>l&&(l=t.minWidth()),e>0&&(c+=u.spacing(),f+=u.spacing());return{width:s,height:c,minWidth:l,minHeight:f}},parentSize:function(){var e=this,t=0,r=0,n=0,i=0,o=e.parent();if(f(o)){var a=o.boxSize;n=o.width(),i=o.height(),a&&(t=a.paddingLeft,r=a.paddingTop,n-=a.width,i-=a.height)}else o instanceof j&&(n=o.width(),i=o.height());return{width:n,height:i,left:t,top:r}},render:function(){var e=this,t=e.parentWidget();return t&&(h(e.items,function(e,r){r.renderTo(t)}),e.renderState=!0),e},updateLayout:function(){var e=this,t=e.parent();return t&&e.renderState?e:!1},update:function(){{var e=this;e.parent()}return e.updateLayout()},clear:function(){var e=this,t=e.items;return h(t,function(e,t){t.remove()}),t.clear(),e},destroy:function(){var e=this;return e[0].remove(),e.clear()},remove:function(e){var t=this,i=t.items;return e===n?t.destroy().__emit__("remove"):(o(e)?(i[e].remove(),i[e]=r,i.remove(e)):u(e)&&f(e)&&t.removeChild(e),t.update()),t},removeChild:function(e){var t=this,r=t.items;return"layoutItem"===e.ui?r.remove(r.indexOf(e)):W.each(r,function(t,n){return n.item()===e?(e.remove(),r.remove(t),!0):void 0}),t}},k:function(e,t){e.items=[],s(t.items)&&e.append(t.items)},l:function(e,t){h("parent level spacing fixedLayoutWidth fixedLayoutHeight",function(e,r){t[r]=function(e){return this.opt(r,e)}})}}),M.module("VBoxLayout",{b:"layout",g:{render:function(){var e=j(this.parent());e&&e.css("overflow","hidden")},updateLayout:function(){for(var e=this,t=e.parentSize(),r=t.width,n=t.height,i=[],o=0,a=t.top,u=e.spacing(),s=e.items.length,c=0;s>c;c++){var l=e.items[c],f=l.level();f>1&&!l.fixedLayoutWidth()&&l.width(r),f>3&&f==e.level()&&!l.fixedLayoutHeight()?i.push(c):o+=l.height(),c>0&&(o+=u)}for(var c=0,d=n-o,h=i.length;h>c;c++){var l=e.items[i[c]],m=d/(h-c),p=l.minHeight();p>m&&(m=p),d-=m,l.height(m)}for(var c=0;s>c;c++){var l=e.items[c],m=l.height();if(d>0){var v=d/(s+1);v>0&&(a+=v)}l.top(a),a+=m+u}}},j:{direction:"vertical"}}),M.module("HBoxLayout",{b:"layout",g:{render:function(){var e=j(this.parent());e&&e.css("overflow","hidden")},updateLayout:function(){for(var e=this,t=0,r=e.parentSize(),n=r.height,i=[],o=r.left,a=e.items.length,u=0;a>u;u++){var s=e.items[u],c=s.level();1==c||2==c&&c<e.level()||s.fixedLayoutWidth()?t+=s.width():i.push(u),u>0&&(t+=e.spacing())}for(var l=r.width-t,u=0,f=i.length;f>u;u++){var s=e.items[i[u]],d=l/(i.length-u),h=s.minWidth();h>d&&(d=h),l-=d,s.width(d,!1)}for(var u=0;a>u;u++){var s=e.items[u];(s.level()>3||"layout"==s.type())&&!s.fixedLayoutHeight()?s.height(n,!1):s.top((n-s.height())/2),s.left(o),o+=s.width()+e.spacing()}}},j:{direction:"horizontal"}}),M.module("VArrayLayout",{b:"layout",g:{updateLayout:function(){for(var e=this,t=e.parentSize(),r=t.width,n=t.top,i=e.spacing(),o=e.items.length,a=0;o>a;a++){var u=e.items[a];if("layout"==u.type())switch(u.item().ui){case"HArrayLayout":case"VArrayLayout":u.item().update();break;default:u.width(r)}u.top(n),n+=u.height()+i}}},j:{direction:"vertical"}}),M.module("HArrayLayout",{b:"layout",g:{updateLayout:function(){for(var e=this,t=e.spacing(),r=e.parentSize(),n=r.left,i=0,o=e.items.length;o>i;i++){var a=e.items[i];if("layout"==a.type())switch(a.item().ui){case"HArrayLayout":case"VArrayLayout":a.item().update();break;default:a.height(r.height,!1)}a.left(n),n+=a.width()+t}}},j:{direction:"horizontal"}}),M.module("GridLayout",{e:{rows:5,columns:5,spacing:5,autoFlow:"row",cellWidth:"auto",cellHeight:"auto"},b:"layout",g:{render:function(){var e=j(this.parent());e&&e.css("overflow","hidden")},updateLayout:function(){var e=this,t=e.rows(),r=e.items.length,n=e.columns(),i=e.spacing(),a=e.opts.autoFlow,u=e.parentSize(),s=e.cellWidth(),c=e.cellHeight(),l=u.left,f=u.top;if("auto"===s&&(s=(u.width-i*(n-1))/n),"auto"===n&&(n=Math.floor(u.width/(s+i))),"auto"===c&&(c=(u.height-i*(t-1))/t),"auto"===t&&(t=Math.floor(u.height/(c+i))),o(s)&&o(c))for(var d=0,h=0,m=0;r>d;d++){var p=e.items[d].size(s,c);"row"===a?(p.left(l+s*m+i*m),p.top(f+c*h+i*h),++m===n&&(h++,m=0)):"column"===a&&(p.top(f+c*h+i*h),p.left(l+s*m+i*m),++h===t&&(h=0,m++))}}},j:{cellWidth:function(e){return this.opt("cellWidth",e,function(){this.update()})},cellHeight:function(e){return this.opt("cellHeight",e,function(){this.update()})},rows:function(e){var t=this,r=t.opts;return e===n?t.opts.rows:(r.rows=e,t.renderState&&t.update(),t)},columns:function(e){var t=this,r=t.opts;return e===n?t.opts.columns:(r.columns=e,t.renderState&&t.update(),t)}}}),W.render=g(function(){return{f:{html:function(e){var t={};return j.united("[std-ui]",e).each(function(e,r){var n=r.attr("std-ui"),i=r.attr("std-name");if(M.exist(n)){var o=M.createByElement(n,r);i&&o&&(t[i]=o)}}),t}},k:function(e,t){e===n?h(W.render,function(e,t){p(t)()}):(f(e)||d(e))&&(f(t)?e.renderTo(t):e.render())}}}),W.require=g({f:{loader:new L},k:function(){var e=W.require.loader;e.require.apply(e,arguments)},l:function(e){h("basePath on off",function(t,r){e[r]=function(){var e=this.loader;return e[r].apply(e,arguments)}})}}),D({".Std_Hidden":{visibility:"hidden"},".Std_wordwrap":{wordBreak:"break-all",wordWrap:"break-word"},".Std_wordnowrap":{overflow:"hidden",wordBreak:"keep-all",whiteSpace:"nowrap",textOverflow:"ellipsis"},".Std_unselect":function(){var e="user-select",t={};return h(W.init.platformPrefix,function(r,n){t[n+e]="none"}),t[e]="none",t}()}),O=W.main=g(function(){var o="status",a="loading",u="complete",s={},c=new W.holder,l=E.repository,f=new k,d=W.require.loader,h=!1;return{f:{state:!1,holder:c,hold:function(e){this.holder.hold(e)}},k:p(function(e,m){var p=function(){O.state="locked";for(var e=0;10>e;e++){var t=r;if(s[e])for(;t=s[e].shift();)t.call(W,W)}O.state=!0,f.emit("unlock")},v=function(){return 0==h?j(t).once("ready",v):d[o]==a?d.once(u,v):"reading"==l[o]?l.once("ready",v):l[o]==a?l.on(u,v):(c.complete(p),void 0)};e===n?v():i(e)&&("locked"===O.state?f.once("unlock",function(){O(e,m)}):(s[m=m===n?9:m]||(s[m]=[]),s[m].push(e),v()))}),l:function(){function n(){o.off("load",i),a.off(u?c:l,i)}function i(){(u||e.event&&"load"===e.event.type||t.readyState===s)&&(n(),j.united("script").each(function(e,t){j.behaviorScript(t.dom,!1)}),h=!0,a.emit("ready"))}var o=j(e),a=j(t),u=t.addEventListener,s="complete",c="DOMContentLoaded",l="readystatechange";if(t.readyState==s)return i();if(u)a.on(c,i),o.on("load",i);else{a.on(l,i),o.on("load",i);var f=!1;try{f=e.frameElement==r&&t.documentElement}catch(d){}f&&f.doScroll?function m(){if(!h){try{f.doScroll("left")}catch(e){return p(m,30)()}i()}}():i()}}}})}(window,document,null,void 0,isFunction=function(e){return"function"==typeof e},isNumber=function(e){return"number"==typeof e},isString=function(e){return"string"==typeof e},isObject=function(e){return"object"==typeof e&&null!==e},isArray=function(e){return e instanceof Array},isPlainObject=function(){var e={}.hasOwnProperty,t="constructor";return function(r){if(!isObject(r)||r.nodeType||r===window)return!1;try{if(r[t]&&!e.call(r,t)&&!e.call(r[t].prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(var i in r)if(!e.call(r,i))return!1;return!0}}(),isEmpty=function(e){if(null==e)return!0;if(isPlainObject(e)&&!isArray(e)){for(var t in e)return!1;return!0}return isElement(e)||e instanceof Std.dom?!Std.dom(e).children():0===e.length},isWidget=function(e){return isObject(e)&&e instanceof Std.ui.modules.widget},isLayout=function(e){return isObject(e)&&e instanceof Std.ui.modules.layout},isBool=function(e){return"boolean"==typeof e},isElement=function(e){return isObject(e)&&1===e.nodeType&&isString(e.nodeName)},isNumeric=function(e){return!isNaN(float(e))&&isFinite(e)},isEqual=function(e,t){if(typeof e!=typeof t)return!1;if(!isObject(e))return e===t;if(isArray(e)){if(e.length!=t.length)return!1;for(var r=0,n=e.length;n>r;r++)if(!isEqual(e[r],t[r]))return!1}else{var i,o=isPlainObject(e);if(o!==isPlainObject(t))return!1;if(!o)return e===t;for(i in e)if(!isEqual(e[i],t[i]))return!1;for(i in t)if(!isEqual(e[i],t[i]))return!1}return!0});