FOSDEM-2025-keynote/lib/js/extra/headjs/site/assets/libs/packer/base2.min.js

2 lines
No EOL
43 KiB
JavaScript

function updateFlag(){this.nextSibling.style.color=this.value?"#898E79":"#A03333"}var base2={name:"base2",version:"1.0.1(pre)",exports:"Base, Package, Abstract, Module, Enumerable, Map, Collection, RegGrp, assert, assertArity, assertType, assignID, copy, counter, detect, extend, forEach, format, instanceOf, match, rescape, slice, trim, I, K, Undefined, Null, True, False, bind, delegate, flip, not, partial, unbind",global:this,namespace:"var global=base2.global;function base(o,a){return o.base.apply(o,a)};",detect:new function(n){var u=n,i/*@cc_on=@_jscript_version@*/,r,t;return n.navigator&&(r=document.createElement("span"),t=navigator.platform+" "+navigator.userAgent,i||(t=t.replace(/MSIE\s[\d.]+/,"")),t=t.replace(/([a-z])[\s\/](\d)/gi,"$1$2")),function(a){var r=!1,b=a.charAt(0)=="!";if(b&&(a=a.slice(1)),a.charAt(0)=="(")try{eval("r=!!"+a)}catch(error){}else r=new RegExp("("+a+")","i").test(t);return!!(b^r)}}(this)},bindings;new function(_){function _12(n,t){var i,r;for(i in t)r=t[i],!Module[i]&&typeof r=="function"&&r.call&&(n[i]=r)}function _23(n,t,i,r){var u=Module.extend(),f;return forEach(i.match(/\w+/g),function(t){u[t]=unbind(n.prototype[t])}),forEach(r,u.implement,u),f=function(){return u(this.constructor==u?t.apply(null,arguments):arguments[0])},f.prototype=u.prototype,forEach(u,function(t,i){n[i]&&delete u.prototype[i],f[i]=u[i]}),f.ancestor=Object,delete f.extend,n!=Array&&delete f.forEach,f}function extend(n,t){var f,e,i,r,u;if(n&&t){if(arguments.length>2&&(i=t,t={},t[i]=arguments[2]),f=(typeof t=="function"?Function:Object).prototype,e=_5.length,base2.__prototyping)while(i=_5[--e])r=t[i],r!=f[i]&&(_4.test(r)?_22(n,i,r):n[i]=r);for(i in t)if(f[i]===undefined){if(r=t[i],i.charAt(0)=="@"&&detect(i.slice(1))){arguments.callee(n,r);continue}u=n[i],u&&typeof r=="function"?r==u||u.method&&_11(r,u)||(r.__base||_4.test(r)?_22(n,i,r):n[i]=r):n[i]=r}}return n}function _11(n,t){while(t){if(!t.ancestor)return!1;if(t=t.ancestor,t==n)return!0}return!1}function _22(n,t,i){function r(){var t=this.base,n;return this.base=u,n=i.apply(this,arguments),this.base=t,n}var u=n[t];r.ancestor=u,r.method=i,r.toString=function(){return String(i)},n[t]=r}function forEach(n,t,i,r){if(n!=null){if(!r)if(typeof n=="function"&&n.call)r=Function;else{if(typeof n.forEach=="function"&&n.forEach!=arguments.callee){n.forEach(t,i);return}if(typeof n.length=="number"){_24(n,t,i);return}}_8(r||Object,n,t,i)}}function _24(n,t,i){if(n!=null){var u=n.length,r;if(typeof n=="string")for(r=0;r<u;r++)t.call(i,n.charAt(r),r,n);else for(r=0;r<u;r++){/*@if(@_jscript_version<5.2)if(n[r]!==undefined||$Legacy.has(n,r))@else@*/if(r in n)/*@end@*/t.call(i,n[r],r,n)}}}function _8(n,t,i,r){var f=function(){this.i=1},u,e;f.prototype={i:1},u=0;for(e in new f)u++;_8=u>1?function(n,t,i,r){var f={},u;for(u in t)f[u]||n.prototype[u]!==undefined||(f[u]=!0,i.call(r,t[u],u,t))}:function(n,t,i,r){for(var u in t)n.prototype[u]===undefined&&i.call(r,t[u],u,t)},_8(n,t,i,r)}function instanceOf(n,t){if(typeof t!="function")throw new TypeError("Invalid 'instanceOf' operand.");if(n==null)return!1;/*@if(@_jscript_version<5.1)if($Legacy.instanceOf(n,t))return!0;@else@*/if(n instanceof t)return!0;/*@end@*/if(Base.ancestorOf==t.ancestorOf)return!1;var i=n.constructor;if(typeof i!="function")return!1;if(Base.ancestorOf==i.ancestorOf)return t==Object;switch(t){case Array:return!!(typeof n=="object"&&n.join&&n.splice);case Function:return!!(typeof n=="function"&&n.call);case RegExp:return i.prototype.toString()==_6;case Date:return!!n.getTimezoneOffset;case String:case Number:case Boolean:return typeof n==typeof t.prototype.valueOf();case Object:return!0}return!1}function assert(n,t,i){if(!n)throw new(i||Error)(t||"Assertion failed.");}function assertArity(n,t,i){if(t==null&&(t=n.callee.length),n.length<t)throw new SyntaxError(i||"Not enough arguments.");}function assertType(n,t,i){if(t&&(typeof t=="function"?!instanceOf(n,t):typeof n!=t))throw new TypeError(i||"Invalid type.");}function assignID(n){return n.base2ID||(n.base2ID="b2_"+counter()),n.base2ID}function counter(){return _7++}function copy(n){var t=function(){};return t.prototype=n,new t}function format(n){var t=arguments,i=new RegExp("%([1-"+arguments.length+"])","g");return String(n).replace(i,function(n,i){return i<t.length?t[i]:n})}function match(n,t){return String(n).match(t)||[]}function rescape(n){return String(n).replace(_3,"\\$1")}function trim(n){return String(n).replace(_1,"").replace(_2,"")}function I(n){return n}function K(n){return function(){return n}}function bind(n,t){var r=slice(arguments,2),i=function(){return n.apply(t,r.concat(slice(arguments)))};return i._31=assignID(n),i}function delegate(n,t){return function(){return n.apply(t,[this].concat(slice(arguments)))}}function flip(n){return function(){return n.apply(this,Array2.swap(arguments,0,1))}}function not(n){return function(){return!n.apply(this,arguments)}}function partial(n){var t=slice.call(arguments,1);return function(){return n.apply(this,t.concat(slice(arguments)))}}function unbind(n){return function(t){return n.apply(t,slice(arguments,1))}}var detect=base2.detect,slice=Array.slice||function(n){return function(t){return n.apply(t,n.call(arguments,1))}}(Array.prototype.slice),Undefined=K(),Null=K(null),True=K(!0),False=K(!1),_0=/%([1-9])/g,_1=/^\s\s*/,_2=/\s\s*$/,_3=/([\/()[\]{}|*+-.,^$?\\])/g,_4=/eval/.test(detect)?/\bbase\s*\(/:/.*/,_5=["constructor","toString","valueOf"],_6=String(new RegExp),_7=1,Array2,String2;_8(),eval(base2.namespace);var _9=function(n,t){function i(){if(!base2.__prototyping)if(this.constructor==arguments.callee||this.__constructing)this.__constructing=!0,u.apply(this,arguments),delete this.__constructing;else return extend(arguments[0],r);return this}var r,u,f;base2.__prototyping=!0,r=new this,extend(r,n),delete base2.__prototyping,u=r.constructor,r.constructor=i;for(f in Base)i[f]=this[f];return i.toString=K(String(u)),i.ancestor=this,i.base=Undefined,i.init=Undefined,extend(i,t),i.prototype=r,i.init(),i},Base=_9.call(Object,{constructor:function(){arguments.length>0&&this.extend(arguments[0])},base:function(){},extend:delegate(extend)},Base={ancestorOf:delegate(_11),extend:_9,forEach:delegate(_8),implement:function(n){return typeof n=="function"?_11(Base,n)&&n(this.prototype):extend(this.prototype,n),this}}),Package=Base.extend({constructor:function(n,t){this.extend(t),this.init&&this.init(),this.name!="base2"&&(this.parent||(this.parent=base2),this.parent.addName(this.name,this),this.namespace=format("var %1=%2;",this.name,String(this).slice(1,-1)));var i=/[^\s,]+/g;n&&(n.imports=Array2.reduce(this.imports.match(i),function(a,b){return eval("var ns=base2."+b),assert(ns,format("Package not found: '%1'.",b)),a+ns.namespace},base2.namespace+JavaScript.namespace),n.exports=Array2.reduce(this.exports.match(i),function(n,t){var i=this.name+"."+t;return this.namespace+="var "+t+"="+i+";",n+("if(!"+i+")"+i+"="+t+";")},"",this))},exports:"",imports:"",name:"",namespace:"",parent:null,addName:function(n,t){this[n]||(this[n]=t,this.exports+=", "+n,this.namespace+=format("var %1=%2.%1;",n,this.name))},addPackage:function(n){this.addName(n,new Package(null,{name:n,parent:this}))},toString:function(){return format("[%1]",this.parent?String(this.parent).slice(1,-1)+"."+this.name:this.name)}}),Abstract=Base.extend({constructor:function(){throw new TypeError("Class cannot be instantiated.");}}),Module=Abstract.extend(null,{extend:function(n,t){var i=this.base();return _12(i,this),i.implement(n),extend(i,t),i.init(),i},implement:function(n){var t=this,i;return typeof n=="function"?(t.base(n),_11(Module,n)&&_12(t,n)):(i={},_8(Object,n,function(n,r){if(r.charAt(0)=="@")detect(r.slice(1))&&forEach(n,arguments.callee);else if(!Module[r]&&typeof n=="function"&&n.call){function u(){return t[r].apply(t,[this].concat(slice(arguments)))}u.__base=_4.test(n),i[r]=u}}),extend(t.prototype,i),extend(t,n)),t}});var Enumerable=Module.extend({every:function(n,t,i){var r=!0;try{this.forEach(n,function(u,f){if(r=t.call(i,u,f,n),!r)throw StopIteration;})}catch(u){if(u!=StopIteration)throw u;}return!!r},filter:function(n,t,i){var r=0;return this.reduce(n,function(u,f,e){return t.call(i,f,e,n)&&(u[r++]=f),u},[])},invoke:function(n,t){var i=slice(arguments,2);return this.map(n,typeof t=="function"?function(n){return n==null?undefined:t.apply(n,i)}:function(n){return n==null?undefined:n[t].apply(n,i)})},map:function(n,t,i){var r=[],u=0;return this.forEach(n,function(f,e){r[u++]=t.call(i,f,e,n)}),r},pluck:function(n,t){return this.map(n,function(n){return n==null?undefined:n[t]})},reduce:function(n,t,i,r){var u=arguments.length>2;return this.forEach(n,function(f,e){u?i=t.call(r,i,f,e,n):(i=f,u=!0)}),i},some:function(n,t,i){return!this.every(n,not(t),i)}},{forEach:forEach}),_14="#",Map=Base.extend({constructor:function(n){this.merge(n)},copy:delegate(copy),forEach:function(n,t){for(var i in this)i.charAt(0)==_14&&n.call(t,this[i],i.slice(1),this)},get:function(n){return this[_14+n]},getKeys:function(){return this.map(flip(I))},getValues:function(){return this.map(I)},has:function(n){/*@if(@_jscript_version<5.5)return $Legacy.has(this,_14+n)@*/;return _14+n in this},merge:function(){var n=flip(this.put);return forEach(arguments,function(t){forEach(t,n,this)},this),this},remove:function(n){delete this[_14+n]},put:function(n,t){arguments.length==1&&(t=n),this[_14+n]=t},size:function(){var n=0,t;for(t in this)t.charAt(0)==_14&&n++;return n},union:function(){return this.merge.apply(this.copy(),arguments)}});Map.implement(Enumerable);var _15="~",Collection=Map.extend({constructor:function(n){this[_15]=new Array2,this.base(n)},add:function(n){assert(!this.has(n),"Duplicate key '"+n+"'."),this.put.apply(this,arguments)},copy:function(){var n=this.base();return n[_15]=this[_15].copy(),n},forEach:function(n,t){for(var r=this[_15],u=r.length,i=0;i<u;i++)n.call(t,this[_14+r[i]],r[i],this)},getAt:function(n){n<0&&(n+=this[_15].length);var t=this[_15][n];return t===undefined?undefined:this[_14+t]},getKeys:function(){return this[_15].concat()},indexOf:function(n){return this[_15].indexOf(String(n))},insertAt:function(n,t){assert(Math.abs(n)<this[_15].length,"Index out of bounds."),assert(!this.has(t),"Duplicate key '"+t+"'."),this[_15].insertAt(n,String(t)),this.put.apply(this,slice(arguments,1))},item:Undefined,put:function(n,t){arguments.length==1&&(t=n),this.has(n)||this[_15].push(String(n));var i=this.constructor;i.Item&&!instanceOf(t,i.Item)&&(t=i.create.apply(i,arguments)),this[_14+n]=t},putAt:function(n){assert(Math.abs(n)<this[_15].length,"Index out of bounds."),arguments[0]=this[_15].item(n),this.put.apply(this,arguments)},remove:function(n){this.has(n)&&(this[_15].remove(String(n)),delete this[_14+n])},removeAt:function(n){this[_15].removeAt(n),delete this[_14+key]},reverse:function(){return this[_15].reverse(),this},size:function(){return this[_15].length},sort:function(n){if(n){var t=this;this[_15].sort(function(i,r){return n(t[_14+i],t[_14+r],i,r)})}else this[_15].sort();return this},toString:function(){return String(this[_15])}},{Item:null,init:function(){this.prototype.item=this.prototype.getAt},create:function(n,t){return this.Item?new this.Item(n,t):t},extend:function(n,t){var i=this.base(n);return i.create=this.create,extend(i,t),i.Item?typeof i.Item!="function"&&(i.Item=(this.Item||Base).extend(i.Item)):i.Item=this.Item,i.init(),i}}),_16=/\\(\d+)/g,_17=/\\./g,_18=/\(\?[:=!]|\[[^\]]+\]/g,_19=/\(/g,_20=/\$(\d+)/,_21=/^\$\d+$/,RegGrp=Collection.extend({constructor:function(n,t){this.base(n),typeof t=="string"&&(this.global=/g/.test(t),this.ignoreCase=/i/.test(t))},global:!0,ignoreCase:!1,exec:function(n,t){var u=(this.global?"g":"")+(this.ignoreCase?"i":""),i,r;return n=String(n)+"",arguments.length==1&&(i=this,r=this[_15],t=function(t){var e,u,s,o,f,h,c;if(t)for(u=1,s=0;e=i[_14+r[s++]];){if(o=u+e.length+1,arguments[u]){f=e.replacement;switch(typeof f){case"function":return h=slice(arguments,u,o),c=arguments[arguments.length-2],f.apply(i,h.concat(c,n));case"number":return arguments[u+f];default:return f}}u=o}return""}),n.replace(new RegExp(this,u),t)},insertAt:function(n,t){return instanceOf(t,RegExp)&&(arguments[1]=t.source),base(this,arguments)},test:function(n){return this.exec(n)!=n},toString:function(){var n=0;return"("+this.map(function(t){var i=String(t).replace(_16,function(t,i){return"\\"+(1+Number(i)+n)});return n+=t.length+1,i}).join(")|(")+")"}},{IGNORE:"$0",init:function(){forEach("add,get,has,put,remove".split(","),function(n){_22(this,n,function(n){return n&&n.source&&(arguments[0]=n.source),base(this,arguments)})},this.prototype)},Item:{constructor:function(n,t){if(n=n&&n.source?n.source:String(n),typeof t=="number"?t=String(t):t==null&&(t=""),typeof t=="string"&&_20.test(t))if(_21.test(t))t=parseInt(t.slice(1));else{var i=/'/.test(t.replace(/\\./g,""))?'"':"'";t=t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\$(\d+)/g,i+"+(arguments[$1]||"+i+i+")+"+i),t=new Function("return "+i+t.replace(/(['"])\1\+(.*)\+\1\1$/,"$1")+i)}this.length=RegGrp.count(n),this.replacement=t,this.toString=K(n)},length:0,replacement:""},count:function(n){return n=String(n).replace(_17,"").replace(_18,""),match(n,_19).length}}),JavaScript={name:"JavaScript",version:base2.version,exports:"Array2, Date2, String2",namespace:"",bind:function(n){forEach(this.exports.match(/\w+/g),function(t){var i=t.slice(0,-1);extend(n[i],this[t]),this[t](n[i].prototype)},this)}};(new Date).getYear()>1900&&(Date.prototype.getYear=function(){return this.getFullYear()-1900},Date.prototype.setYear=function(n){return this.setFullYear(n+1900)}),Function.prototype.prototype={},"".replace(/^/,K("$$"))=="$"&&extend(String.prototype,"replace",function(n,t){if(typeof t=="function"){var i=t;t=function(){return String(i.apply(null,arguments)).split("$").join("$$")}}return this.base(n,t)}),Array2=_23(Array,Array,"concat,join,pop,push,reverse,shift,slice,sort,splice,unshift",[Enumerable,{combine:function(n,t){return t||(t=n),this.reduce(n,function(n,i,r){return n[i]=t[r],n},{})},contains:function(n,t){return this.indexOf(n,t)!=-1},copy:function(n){var t=this.slice(n);return t.swap||this(t),t},flatten:function(n){return this.reduce(n,function(n,t){return this.like(t)?this.reduce(t,arguments.callee,n,this):n.push(t),n},[],this)},forEach:_24,indexOf:function(n,t,i){var u=n.length,r;for(i==null?i=0:i<0&&(i=Math.max(0,u+i)),r=i;r<u;r++)if(n[r]===t)return r;return-1},insertAt:function(n,t,i){return this.splice(n,t,0,i),i},item:function(n,t){return t<0&&(t+=n.length),n[t]},lastIndexOf:function(n,t,i){var u=n.length,r;for(i==null?i=u-1:from<0&&(i=Math.max(0,u+i)),r=i;r>=0;r--)if(n[r]===t)return r;return-1},map:function(n,t,i){var r=[];return this.forEach(n,function(u,f){r[f]=t.call(i,u,f,n)}),r},remove:function(n,t){var i=this.indexOf(n,t);return i!=-1&&this.removeAt(n,i),t},removeAt:function(n,t){return this.splice(n,t,1)},swap:function(n,t,i){var r=n[t];return n[t]=n[i],n[i]=r,n}}]),Array2.reduce=Enumerable.reduce,Array2.like=function(n){return!!(n&&typeof n=="object"&&typeof n.length=="number")};var _25=/^((-\d+|\d{4,})(-(\d{2})(-(\d{2}))?)?)?T((\d{2})(:(\d{2})(:(\d{2})(\.(\d{1,3})(\d)?\d*)?)?)?)?(([+-])(\d{2})(:(\d{2}))?|Z)?$/,_26={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14},_27={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20},_28=/(((00)?:0+)?:0+)?\.0+$/,_29=/(T[0-9:.]+)$/,Date2=_23(Date,function(n,t,i,r,u,f,e){switch(arguments.length){case 0:return new Date;case 1:return new Date(n);default:return new Date(n,t,arguments.length==2?1:i,r||0,u||0,f||0,e||0)}},"",[{toISOString:function(n){var t="####-##-##T##:##:##.###",i;for(i in _26)t=t.replace(/#+/,function(t){var r=n["getUTC"+i]();return i=="Month"&&r++,("000"+r).slice(-t.length)});return t.replace(_28,"").replace(_29,"$1Z")}}]);Date2.now=function(){return(new Date).valueOf()},Date2.parse=function(n,t){var i,r,f,u,e,o,s;if(arguments.length>1&&assertType(t,"number","defaultDate should be of type 'number'."),i=String(n).match(_25),i){i[_26.Month]&&i[_26.Month]--,i[_27.Hectomicroseconds]>=5&&i[_26.Milliseconds]++,r=new Date(t||0),f=i[_27.UTC]||i[_27.Hours]?"UTC":"";for(u in _26)if((e=i[_26[u]],e)&&(r["set"+f+u](e),r["get"+f+u]()!=i[_26[u]]))return NaN;return i[_27.Hours]&&(o=Number(i[_27.Sign]+i[_27.Hours]),s=Number(i[_27.Sign]+(i[_27.Minutes]||0)),r.setUTCMinutes(r.getUTCMinutes()+o*60+s)),r.valueOf()}return Date.parse(n)},String2=_23(String,function(n){return new String(arguments.length==0?"":n)},"charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase",[{trim:trim}]),typeof StopIteration=="undefined"&&(StopIteration=new Error("StopIteration")),base2=new Package(this,base2),eval(this.exports),base2.extend=extend,forEach(Enumerable,function(n,t){Module[t]||base2.addName(t,bind(n,Enumerable))}),JavaScript=new Package(this,JavaScript),eval(this.exports)},new function(_){function _44(n,t){if(_41.test(t))return parseInt(t);var i=n.style.left,r=n.runtimeStyle.left;return n.runtimeStyle.left=n.currentStyle.left,n.style.left=t||0,t=n.style.pixelLeft,n.style.left=i,n.runtimeStyle.left=r,t}function _45(n,t){var r=n.document.body.createTextRange(),i;return r.moveToElementText(n),i=r.queryCommandValue(t),format("rgb(%1,%2,%3)",i&255,(i&65280)>>8,(i&16711680)>>16)}function _48(n,t){return"[not("+_49.exec(trim(t)).replace(/\[1\]/g,"").replace(/^(\*|[\w-]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"}function _47(n,t,i){return"["+CSSParser._47(n,t,i||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"}var DOM=new base2.Package(this,{name:"DOM",version:"1.0 (beta 1)",exports:"Interface, Binding, Node, Document, Element, AbstractView, Event, EventTarget, DocumentEvent, NodeSelector, DocumentSelector, ElementSelector, StaticNodeList, ViewCSS, HTMLDocument, HTMLElement, Selector, Traversal, XPathParser",bind:function(n){if(n&&n.nodeType){var t=assignID(n);if(!arguments.callee[t]){switch(n.nodeType){case 1:typeof n.className=="string"?(HTMLElement.bindings[n.tagName]||HTMLElement).bind(n):Element.bind(n);break;case 9:n.writeln?HTMLDocument.bind(n):Document.bind(n);break;default:Node.bind(n)}arguments.callee[t]=!0}}return n},"@MSIE5.+win":{bind:function(n){return n&&n.writeln&&(n.nodeType=9),this.base(n)}}}),_32,_33,closures,names,_37,_38,_39,NodeSelector,_50,_51,Selector,HTMLDocument,HTMLElement;eval(this.imports),_32=detect("MSIE"),_33=detect("MSIE5"),detect("MSIE[56].+win")&&!detect("SV1")&&(closures={},extend(base2,"bind",function(n,t){var i,r,f,u;return!t||t.nodeType!=1?this.base(n,t):(i=t.uniqueID,r=assignID(n),closures[r]=n,n=null,t=null,closures[i]||(closures[i]={}),f=closures[i][r],f)?f:(u=function(){var n=document.all[i];return n?closures[r].apply(n,arguments):undefined},u._31=r,closures[i][r]=u,u)}),attachEvent("onunload",function(){closures=null}));var Interface=Module.extend(null,{implement:function(n){return typeof n=="object"&&forEach(n,function(n,t){t.charAt(0)=="@"?forEach(n,arguments.callee,this):this[t]||typeof n!="function"||this.createDelegate(t,n.length)},this),this.base(n)},createDelegate:function(a,b){if(!this[a]){var c="var fn=function _%1(%2){%3.base=%3.%1.ancestor;var m=%3.base?'base':'%1';return %3[m](%4)}",d="abcdefghij".split("").slice(-b);eval(format(c,a,d,d[0],d.slice(1))),this[a]=fn}}}),Binding=Interface.extend(null,{extend:function(n,t){var r,i;return t&&t.bind!=Function.bind&&(r=t.bind,delete t.bind),i=this.base(n,t),i.bind=this.bind,r&&extend(i,"bind",r),i},bind:function(n){return extend(n,this.prototype)}}),Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(n,t){if(Traversal.contains(n,t))return 20;if(Traversal.contains(t,n))return 10;var i=_34(n),r=_34(t);return i<r?4:i>r?2:0}}}),_34=document.documentElement.sourceIndex?function(n){return n.sourceIndex}:function(n){for(var t=0;n;)t=Traversal.getNodeIndex(n)+"."+t,n=n.parentNode;return t},Document=Node.extend(null,{bind:function(n){return extend(n,"createElement",function(n){return DOM.bind(this.base(n))}),AbstractView.bind(n.defaultView),n!=window.document&&new DOMContentLoadedEvent(n),this.base(n)},"@!(document.defaultView)":{bind:function(n){return n.defaultView=Traversal.getDefaultView(n),this.base(n)}}}),_35=/^(href|src|type|value)$/,_36={"class":"className","for":"htmlFor"},Element=Node.extend({"@MSIE.+win":{getAttribute:function(n,t){if(n.className===undefined)return this.base(n,t);var i=_37(n,t);return i&&i.specified?_35.test(t)?this.base(n,t,2):t=="style"?n.style.cssText:i.nodeValue:null},setAttribute:function(n,t,i){n.className===undefined?this.base(n,t,i):t=="style"?n.style.cssText=i:this.base(n,_36[t]||t,String(i))}},"@!(element.hasAttribute)":{hasAttribute:function(n,t){return this.getAttribute(n,t)!=null}}});extend(Element.prototype,"cloneNode",function(n){var t=this.base(n||!1);return t.base2ID=undefined,t}),_32&&(names="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc",extend(_36,Array2.combine(names.toLowerCase().split(","),names.split(","))),_37=_33?function(n,t){return n.attributes[t]||n.attributes[_36[t.toLowerCase()]]}:function(n,t){return n.getAttributeNode(t)});var TEXT=_32?"innerText":"textContent",Traversal=Module.extend({getDefaultView:function(n){return this.getDocument(n).defaultView},getNextElementSibling:function(n){while(n&&(n=n.nextSibling)&&!this.isElement(n))continue;return n},getNodeIndex:function(n){for(var t=0;n&&(n=n.previousSibling);)t++;return t},getOwnerDocument:function(n){return n.ownerDocument},getPreviousElementSibling:function(n){while(n&&(n=n.previousSibling)&&!this.isElement(n))continue;return n},getTextContent:function(n){return n[TEXT]},isEmpty:function(n){for(n=n.firstChild;n;){if(n.nodeType==3||this.isElement(n))return!1;n=n.nextSibling}return!0},setTextContent:function(n,t){return n[TEXT]=t},"@MSIE":{getDefaultView:function(n){return this.getDocument(n).parentWindow},"@MSIE5":{getOwnerDocument:function(n){return n.ownerDocument||n.document}}}},{contains:function(n,t){while(t&&(t=t.parentNode)&&n!=t)continue;return!!t},getDocument:function(n){return this.isDocument(n)?n:this.getOwnerDocument(n)},isDocument:function(n){return!!(n&&n.documentElement)},isElement:function(n){return!!(n&&n.nodeType==1)},"@(element.contains)":{contains:function(n,t){return n!=t&&(this.isDocument(n)?n==this.getOwnerDocument(t):n.contains(t))}},"@MSIE5":{isElement:function(n){return!!(n&&n.nodeType==1&&n.tagName!="!")}}}),AbstractView=Binding.extend(),Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(n,t,i,r){n.type=t,n.bubbles=i,n.cancelable=r,n.timeStamp=(new Date).valueOf()},"@MSIE":{initEvent:function(n,t,i,r){this.base(n,t,i,r),n.cancelBubble=!n.bubbles},preventDefault:function(n){n.cancelable!==!1&&(n.returnValue=!1)},stopPropagation:function(n){n.cancelBubble=!0}}}},{"@!(document.createEvent)":{"@MSIE":{"@Mac":{bind:function(n){return this.base(extend(copy(n),{preventDefault:function(){this.cancelable!==!1&&(this.returnValue=!1)}}))}},"@Windows":{bind:function(n){return n.timeStamp||(n.bubbles=!!_38[n.type],n.cancelable=!!_39[n.type],n.timeStamp=(new Date).valueOf()),n.target||(n.target=n.srcElement),n.relatedTarget=n[(n.type=="mouseout"?"to":"from")+"Element"],this.base(n)}}}}});_32&&(_38="abort,error,select,change,resize,scroll",_39="click,mousedown,mouseup,mouseover,mousemove,mouseout,keydown,keyup,submit,reset",_38=Array2.combine((_38+","+_39).split(",")),_39=Array2.combine(_39.split(",")));var EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(n,t,i){var e=assignID(n),o=i._31||assignID(i),u=_40[e],r,f;u||(u=_40[e]={}),r=u[t],f=n["on"+t],r||(r=u[t]={},f&&(r[0]=f)),r[o]=i,f!==undefined&&(n["on"+t]=delegate(_40.handleEvent))},dispatchEvent:function(n,t){return _40.handleEvent(n,t)},removeEventListener:function(n,t,i){var r=_40[n.base2ID];r&&r[t]&&delete r[t][i.base2ID]},"@MSIE.+win":{addEventListener:function(n,t,i,r){typeof i=="function"&&(i=bind(i,n)),this.base(n,t,i,r)},dispatchEvent:function(n,t){t.target=n;try{return n.fireEvent(t.type,t)}catch(i){return this.base(n,t)}}}}}),_40=new Base({handleEvent:function(n,t){var u=!0,f=_40[n.base2ID],r,e,i,o;if(f){t=Event.bind(t),r=f[t.type];for(e in r)i=r[e],o=i.handleEvent?i.handleEvent(t):i.call(n,t),(o===!1||t.returnValue===!1)&&(u=!1)}return u},"@MSIE":{handleEvent:function(n,t){return n.Infinity&&(n=n.document.parentWindow,t||(t=n.event)),this.base(n,t||Traversal.getDefaultView(n).event)}}}),DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(){return Event.bind({})},"@(document.createEventObject)":{createEvent:function(n){return Event.bind(n.createEventObject())}}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(n,t){return this.base(n,t=="Events"?"UIEvents":t)}}}}),DOMContentLoadedEvent=Base.extend({constructor:function(n){var t=!1;this.fire=function(){t||(t=!0,setTimeout(function(){var t=DocumentEvent.createEvent(n,"Events");Event.initEvent(t,"DOMContentLoaded",!1,!1),EventTarget.dispatchEvent(n,t)},1))},EventTarget.addEventListener(n,"DOMContentLoaded",function(){t=!0},!1),EventTarget.addEventListener(Traversal.getDefaultView(n),"load",this.fire,!1)},"@(attachEvent)":{constructor:function(){this.base(document),Traversal.getDefaultView(document).attachEvent("onload",this.fire)}},"@MSIE.+win":{constructor:function(n){if(this.base(n),n.readyState!="complete"){var t=this;n.write("<script id=__ready defer src=//:><\/script>"),n.all.__ready.onreadystatechange=function(){this.readyState=="complete"&&(this.removeNode(),t.fire())}}}},"@KHTML":{constructor:function(n){if(this.base(n),n.readyState!="complete")var t=this,i=setInterval(function(){/loaded|complete/.test(n.readyState)&&(clearInterval(i),t.fire())},100)}}});new DOMContentLoadedEvent(document),Document.implement(DocumentEvent),Document.implement(EventTarget),Element.implement(EventTarget);var _41=/^\d+(px)?$/i,_42=/(width|height|top|bottom|left|right|fontSize)$/,_43=/^(color|backgroundColor)$/,ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@MSIE":{getComputedStyle:function(n,t){var u=t.currentStyle,r={getPropertyValue:function(n){return this[ViewCSS.toCamelCase(n)]}},i;for(i in u)r[i]=_42.test(i)?_44(t,r[i])+"px":_43.test(i)?_45(t,i=="color"?"ForeColor":"BackColor"):u[i];return r}}}},{toCamelCase:function(n){return n.replace(/\-([a-z])/g,function(n,t){return t.toUpperCase()})}});AbstractView.implement(ViewCSS),NodeSelector=Interface.extend({"@!(element.querySelector)":{querySelector:function(n,t){return new Selector(t).exec(n,1)},querySelectorAll:function(n,t){return new Selector(t).exec(n)}}}),extend(NodeSelector.prototype,{querySelector:function(n){return DOM.bind(this.base(n))},querySelectorAll:function(n){return extend(this.base(n),"item",function(n){return DOM.bind(this.base(n))})}});var DocumentSelector=NodeSelector.extend(),ElementSelector=NodeSelector.extend({"@!(element.matchesSelector)":{matchesSelector:function(n,t){return new Selector(t).test(n)}}}),StaticNodeList=Base.extend({constructor:function(n){n=n||[],this.length=n.length,this.item=function(t){return n[t]}},length:0,forEach:function(n,t){for(var i=0;i<this.length;i++)n.call(t,this.item(i),i,this)},item:Undefined,"@(XPathResult)":{constructor:function(n){n&&n.snapshotItem?(this.length=n.snapshotLength,this.item=function(t){return n.snapshotItem(t)}):this.base(n)}}});StaticNodeList.implement(Enumerable);var CSSParser=RegGrp.extend({constructor:function(n){this.base(n),this.cache={},this.sorter=new RegGrp,this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE),this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:!0,escape:function(n){var i=/'/g,t=this._46=[];return this.optimise(this.format(String(n).replace(CSSParser.ESCAPE,function(n){return t.push(n.slice(1,-1).replace(i,"\\'")),"\x01"+t.length})))},format:function(n){return n.replace(CSSParser.WHITESPACE,"$1").replace(CSSParser.IMPLIED_SPACE,"$1 $2").replace(CSSParser.IMPLIED_ASTERISK,"$1*$2")},optimise:function(n){return this.sorter.exec(n.replace(CSSParser.WILD_CARD,">* "))},parse:function(n){return this.cache[n]||(this.cache[n]=this.unescape(this.exec(this.escape(n))))},unescape:function(n){var t=this._46;return n.replace(/\x01(\d+)/g,function(n,i){return t[i-1]})}},{ESCAPE:/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"/g,IMPLIED_ASTERISK:/([\s>+~,]|[^(]\+|^)([#.:@])/g,IMPLIED_SPACE:/(^|,)([^\s>+~])/g,WHITESPACE:/\s*([\s>+~(),]|^|$)\s*/g,WILD_CARD:/\s\*\s/g,_47:function(n,t,i,r,u,f,e,o){var h;r=/last/i.test(n)?r+"+1-":"",isNaN(t)?t=="even"?t="2n":t=="odd"&&(t="2n+1"):t="0n+"+t,t=t.split(/n\+?/);var s=t[0]?t[0]=="-"?-1:parseInt(t[0]):1,c=parseInt(t[1])||0,l=s<0;return l&&(s=-s,s==1&&c++),h=format(s==0?"%3%7"+(r+c):"(%4%3-%2)%6%1%70%5%4%3>=%2",s,c,i,r,f,e,o),l&&(h=u+"("+h+")"),h}}),XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.rules),this.sorter.putAt(1,"$1$4$3$6")},escape:function(n){return this.base(n).replace(/,/g,"\x02")},unescape:function(n){return this.base(n.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | "))},"@opera":{unescape:function(n){return this.base(n.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{init:function(){this.values.attributes[""]="[@$1]",forEach(this.types,function(n,t){forEach(this.values[t],n,this.rules)},this)},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML":{"(^|\\x02) (\\*|[\\w-]+)#([\\w-]+)":"$1id('$3')[self::$2]","([ >])(\\*|[\\w-]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(n,t,i,r,u,f){var e=t==" "?"//*":"/*";return e+=/^nth/i.test(r)?_47(r,f,"position()"):XPathParser.optimised.pseudoClasses[r],e+"[self::"+i+"]"}}}),types:{identifiers:function(n,t){this[rescape(t)+"([\\w-]+)"]=n},combinators:function(n,t){this[rescape(t)+"(\\*|[\\w-]+)"]=n},attributes:function(n,t){this["\\[([\\w-]+)\\s*"+rescape(t)+"\\s*([^\\]]*)\\]"]=n},pseudoClasses:function(n,t){this[":"+t.replace(/\(\)$/,"\\(([^)]+)\\)")]=n}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","!=":"[not(@$1='$2')]","=":"[@$1='$2']"},pseudoClasses:{empty:"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_48,"nth-child()":_47,"nth-last-child()":_47,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]",root:"[not(parent::*)]"}},"@opera":{init:function(){this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"],this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"],this.base()}}}),_49=new XPathParser;_50=":(checked|disabled|enabled|contains)|^(#[\\w-]+\\s*)?\\w+$",detect("KHTML")&&(detect("WebKit5")?_50+="|nth\\-|,":_50="."),_50=new RegExp(_50),Selector=Base.extend({constructor:function(n){this.toString=K(trim(n))},exec:function(n,t){return Selector.parse(this)(n,t)},test:function(n){var i=new Selector(this+"[-base2-test]"),t;return n.setAttribute("-base2-test",!0),t=i.exec(Traversal.getOwnerDocument(n),!0),n.removeAttribute("-base2-test"),t==n},toXPath:function(){return Selector.toXPath(this)},"@(XPathResult)":{exec:function(n,t){if(_50.test(this))return this.base(n,t);var r=Traversal.getDocument(n),u=t?9:7,i=r.evaluate(this.toXPath(),n,null,u,null);return t?i.singleNodeValue:i}},"@MSIE":{exec:function(n,t){if(typeof n.selectNodes!="undefined"&&!_50.test(this)){var i=t?"selectSingleNode":"selectNodes";return n[i](this.toXPath())}return this.base(n,t)}},"@(true)":{exec:function(n,t){try{var i=this.base(n||document,t)}catch(r){throw new SyntaxError(format("'%1' is not a valid CSS selector.",this));}return t?i:new StaticNodeList(i)}}},{toXPath:function(n){return _51||(_51=new XPathParser),_51.parse(n)}}),new function(){var s={"=":"%1=='%2'","!=":"%1!='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};s[""]="%1!=null";var a={checked:"e%1.checked",contains:"e%1[TEXT].indexOf('%2')!=-1",disabled:"e%1.disabled",empty:"Traversal.isEmpty(e%1)",enabled:"e%1.disabled===false","first-child":"!Traversal.getPreviousElementSibling(e%1)","last-child":"!Traversal.getNextElementSibling(e%1)","only-child":"!Traversal.getPreviousElementSibling(e%1)&&!Traversal.getNextElementSibling(e%1)",root:"e%1==Traversal.getDocument(e%1).documentElement"},h=detect("(element.sourceIndex)"),c="var p%2=0,i%2,e%2,n%2=e%1.",v=h?"e%1.sourceIndex":"assignID(e%1)",y="var g="+v+";if(!p[g]){p[g]=1;",p="r[r.length]=e%1;if(s)return e%1;",w="r.sort(sorter);",b="fn=function(e0,s){indexed++;var r=[],p={},reg=[%1],d=Traversal.getDocument(e0),c=d.body?'toUpperCase':'toString';",k=_32?function(n,t){var i=n.all[t]||null,r;if(!i||i.id==t)return i;for(r=0;r<i.length;r++)if(i[r].id==t)return i[r];return null}:function(n,t){return n.getElementById(t)},l=1;var d=h?function(n,t){return n.sourceIndex-t.sourceIndex}:Node.compareDocumentPosition,u,r,n,t,i,e,o={},f=new CSSParser({"^ \\*:root":function(){t=!1;return format("e%2=d.documentElement;if(Traversal.contains(e%1,e%2)){",n++,n)}," (\\*|[\\w-]+)#([\\w-]+)":function(r,u,f){t=!1;var e="var e%2=byId(d,'%4');if(e%2&&";return u!="*"&&(e+="e%2.nodeName=='%3'[c]()&&"),e+="Traversal.contains(e%1,e%2)){",i&&(e+=format("i%1=n%1.length;",i)),format(e,n++,n,u,f)}," (\\*|[\\w-]+)":function(r,u){e++,t=u=="*";var f=c;return f+=t&&_33?"all":"getElementsByTagName('%3')",f+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){",format(f,n++,i=n,u)},">(\\*|[\\w-]+)":function(r,u){var e=_32&&i,f;return t=u=="*",f=c,f+=e?"children":"childNodes",!t&&e&&(f+=".tags('%3')"),f+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){",t?(f+="if(e%2.nodeType==1){",t=_33):e||(f+="if(e%2.nodeName=='%3'[c]()){"),format(f,n++,i=n,u)},"\\+(\\*|[\\w-]+)":function(i,r){var u="";return t&&_32&&(u+="if(e%1.tagName!='!'){"),t=!1,u+="e%1=Traversal.getNextElementSibling(e%1);if(e%1",r!="*"&&(u+="&&e%1.nodeName=='%2'[c]()"),u+="){",format(u,n,r)},"~(\\*|[\\w-]+)":function(i,r){var u="";return t&&_32&&(u+="if(e%1.tagName!='!'){"),t=!1,e=2,u+="while(e%1=e%1.nextSibling){if(e%1.b2_adjacent==indexed)break;if(",r=="*"?(u+="e%1.nodeType==1",_33&&(u+="&&e%1.tagName!='!'")):u+="e%1.nodeName=='%2'[c]()",u+="){e%1.b2_adjacent=indexed;",format(u,n,r)},"#([\\w-]+)":function(r,u){t=!1;var f="if(e%1.id=='%2'){";return i&&(f+=format("i%1=n%1.length;",i)),format(f,n,u)},"\\.([\\w-]+)":function(i,u){return t=!1,r.push(new RegExp("(^|\\s)"+rescape(u)+"(\\s|$)")),format("if(e%1.className&&reg[%2].test(e%1.className)){",n,r.length-1)},":not\\((\\*|[\\w-]+)?([^)]*)\\)":function(t,i,r){var u=i&&i!="*"?format("if(e%1.nodeName=='%2'[c]()){",n,i):"";return u+=f.exec(r),"if(!"+u.slice(2,-1).replace(/\)\{if\(/g,"&&")+"){"},":nth(-last)?-child\\(([^)]+)\\)":function(i,r,u){t=!1,r=format("e%1.parentNode.b2_length",n);var f="if(p%1!==e%1.parentNode)p%1=register(e%1.parentNode);";return f+="var i=e%1[p%1.b2_lookup];if(",format(f,n)+CSSParser._47(i,u,"i",r,"!","&&","%","==")+"){"},":([\\w-]+)(\\(([^)]+)\\))?":function(t,i,r,u){return"if("+format(a[i]||"throw",n,u||"")+"){"},"\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]":function(t,i,u,e){var c=_36[i]||i,h,o;return u?(h="e%1.getAttribute('%2',2)",_35.test(i)||(h="e%1.%3||"+h),i=format("("+h+")",n,i,c)):i=format("Element.getAttribute(e%1,'%2')",n,i),o=s[u||""],instanceOf(o,RegExp)&&(r.push(new RegExp(format(o.source,rescape(f.unescape(e))))),o="reg[%2].test(%1)",e=r.length-1),"if("+format(o,i,e)+"){"}});Selector.parse=function(a){var b,i,c,d;if(!o[a]){for(r=[],u="",b=f.escape(a).split(","),i=0;i<b.length;i++)t=n=i=0,e=b.length>1?2:0,c=f.exec(b[i])||"throw;",t&&_32&&(c+=format("if(e%1.tagName!='!'){",n)),d=e>1?y:"",c+=format(d+p,n),c+=Array(match(c,/\{/g).length+1).join("}"),u+=c;b.length>1&&(u+=w),eval(format(b,r)+f.unescape(u)+"return s?null:r}"),o[a]=u}return o[a]}},Document.implement(DocumentSelector),Element.implement(ElementSelector),HTMLDocument=Document.extend(null,{"@(document.activeElement===undefined)":{bind:function(n){return n.activeElement=null,EventTarget.addEventListener(n,"focus",function(t){n.activeElement=t.target},!1),this.base(n)}}}),HTMLElement=Element.extend({addClass:function(n,t){this.hasClass(n,t)||(n.className+=(n.className?" ":"")+t)},hasClass:function(n,t){var i=new RegExp("(^|\\s)"+t+"(\\s|$)");return i.test(n.className)},removeClass:function(n,t){var i=new RegExp("(^|\\s)"+t+"(\\s|$)","g");n.className=n.className.replace(i,"$2")},toggleClass:function(n,t){this.hasClass(n,t)?this.removeClass(n,t):this.addClass(n,t)}},{bindings:{},tags:"*",extend:function(){var n=base(this,arguments),t=(n.tags||"").toUpperCase().split(",");return forEach(t,function(t){HTMLElement.bindings[t]=n}),n},"@!(element.ownerDocument)":{bind:function(n){return n.ownerDocument=Traversal.getOwnerDocument(n),this.base(n)}}}),eval(this.exports)},new function(_){var JSB=new base2.Package(this,{name:"JSB",version:"0.7",imports:"DOM",exports:"Behavior, Rule, RuleList"});eval(this.imports);var Behavior=Abstract.extend(),Call=Base.extend({constructor:function(n,t,i,r){this.release=function(){t.apply(n,i)},this.rank=r||100+Call.list.length}},{list:[],defer:function(n,t){return function(){Call.list?Call.list.push(new Call(this,n,arguments,t)):n.apply(this,arguments)}},init:function(){EventTarget.addEventListener(document,"DOMContentLoaded",function(){Call.list&&(DOM.bind(document),Call.list.sort(function(n,t){return n.rank-t.rank}),invoke(Call.list,"release"),delete Call.list,setTimeout(function(){var n=DocumentEvent.createEvent(document,"Events");Event.initEvent(n,"ready",!1,!1),EventTarget.dispatchEvent(document,n)},1))},!1)}}),_66=/^on[a-z]+$/,Rule=Base.extend({constructor:function(n,t){function e(n){var s=assignID(n),t,o,e;if(!u[s]){u[s]=!0,DOM.bind(n),extend(n,r),extend(n.style,f);for(t in i)o=n,e=i[t],t.indexOf("document")==0&&(o=document,t=t.slice(8),e=bind(e,n)),o.addEventListener(t,e,!1)}}n=new Selector(n),Behavior.ancestorOf(t)&&(t=t.prototype);var r={},i={},f=t.style,u={};forEach(t,function(n,t){t.charAt(0)=="@"?detect(t.slice(1))&&forEach(n,arguments.callee):typeof n=="function"&&_66.test(t)?i[t.slice(2)]=n:t!="style"&&(r[t]=n)}),this.refresh=Call.defer(function(){n.exec(document).forEach(e)}),this.toString=K(String(n)),this.refresh()},refresh:Undefined}),RuleList=Collection.extend({constructor:function(n){this.base(n),this.globalize()},globalize:Call.defer(function(){var n=/[^\s,]+/g,t=/^#[\w-]+$/;forEach(this,function(i,r){forEach(match(r,n),function(n){if(t.test(n)){var i=ViewCSS.toCamelCase(n.slice(1));window[i]=Document.querySelector(document,n)}})})},10),refresh:function(){this.invoke("refresh")}},{Item:Rule});eval(this.exports)},eval(base2.namespace);var DEFAULT="@0",IGNORE=RegGrp.IGNORE,Colorizer=RegGrp.extend({constructor:function(n,t,i){this.extend(i),this.patterns=n||{};var r={};forEach(n,function(n,i){r[i]=t[i]||DEFAULT}),forEach(t,function(n,i){r[i]=t[i]}),this.base(r)},patterns:null,tabStop:4,urls:!0,copy:function(){var n=this.base();return n.patterns=copy(this.patterns),n},exec:function(n,t){return n=this.base(this.escape(n)),t||(n=this._67(n),this.urls&&(n=Colorizer.urls.exec(n))),this.unescape(n)},escape:function(n){return String(n).replace(/</g,"\x01").replace(/&/g,"\x02")},put:function(n,t){return instanceOf(n,RegGrp.Item)||(typeof t=="string"&&(t=t.replace(/@(\d)/,function(t,i){return format(Colorizer.FORMAT,n,i)})),n=this.patterns[n]||Colorizer.patterns[n]||n,instanceOf(n,RegExp)&&(n=n.source),n=this.escape(n)),this.base(n,t)},unescape:function(n){return n.replace(/\x01/g,"&lt;").replace(/\x02/g,"&amp;")},_67:function(n){var t=this.tabStop,i;return t>0?(i=Array(t+1).join(" "),n.replace(Colorizer.TABS,function(n){if(n=n.replace(Colorizer.TAB,i),t>1){var r=(n.length-1)%t;r&&(n=n.slice(0,-r))}return n.replace(/ /g,"&nbsp;")})):n},"@MSIE":{_67:function(n){return this.base(n).replace(/\r?\n/g,"<br>")}}},{version:"0.8",FORMAT:'<span class="%1">$%2<\/span>',DEFAULT:DEFAULT,IGNORE:IGNORE,TAB:/\t/g,TABS:/\n([\t \xa0]+)/g,init:function(){forEach(this.patterns,function(n,t,i){instanceOf(n,Array)&&(i[t]=reduce(n,function(n,t){return n.add(i[t]),n},new RegGrp))}),this.urls=this.patterns.urls.copy(),this.urls.putAt(0,'<a href="mailto:$0">$0<\/a>'),this.urls.putAt(1,'<a href="$0">$0<\/a>')},addScheme:function(n,t,i,r){this[n]=new this(t,i,r)},patterns:{block_comment:/\/\*[^*]*\*+([^\/][^*]*\*+)*\//,email:/([\w.+-]+@[\w.-]+\.\w+)/,line_comment:/\/\/[^\r\n]*/,number:/\b\-?(0|[1-9]\d*)(\.\d+)?([eE][-+]?\d+)?\b/,string1:/'(\\.|[^'\\])*'/,string2:/"(\\.|[^"\\])*"/,url:/(http:\/\/+[\w\/\-%&#=.,?+$]+)/,comment:["block_comment","line_comment"],string:["string1","string2"],urls:["email","url"]},urls:null});base2.addPackage("code"),base2.code.addName("Colorizer",Colorizer);with(base2.code.Colorizer)addScheme("xml",{attribute:/(\w+)=("[^"]*"|'[^']*')/,cdata:/<!\[CDATA\[([^\]]|\][^\]]|\]\][^>])*\]\]>/,comment:/<!\s*(--([^-]|[\r\n]|-[^-])*--\s*)>/,entity:/&#?\w+;/,"processing-instruction":/<\?[\w-]+[^>]+>/,tag:/(<\/?)([\w:-]+)/,text:/[>;][^<>&]*/},{cdata:IGNORE,tag:"$1@2",attribute:'@1=<span class="attribute value">$2<\/span>',text:IGNORE},{tabStop:1});with(base2)code.Colorizer.addScheme("html",{conditional:/<!(--)?\[[^\]]*\]>|<!\[endif\](--)?>/,doctype:/<!(DOCTYPE|doctype)[^>]+>/,inline:/<(script|style)([^>]*)>((\\.|[^\\])*)<\/\1>/},{inline:function(n,t,i,r){return format(this.INLINE,t,this.exec(i,!0),r)}},{INLINE:'&lt;<span class="tag">%1<\/span>%2&gt;%3&lt;/<span class="tag">%1<\/span>&gt;',tabStop:1});with(base2.code.Colorizer)html.merge(xml);with(base2.code.Colorizer)addScheme("css",{at_rule:/@[\w\s]+/,bracketed:/\([^'\x22)]*\)/,comment:patterns.block_comment,property:/(\w[\w-]*\s*):([^;}]+)/,special:/(\-[\w-]*\s*):/,selector:/([\w-:\[.#][^{};]*)\{/},{bracketed:IGNORE,selector:"@1{",special:"@1:",property:'@1:<span class="property value">$2<\/span>'});with(base2.code.Colorizer)addScheme("javascript",{conditional:/\/\*@if\s*\([^\)]*\)|\/\*@[\s\w]*|@\*\/|\/\/@\w+|@else[\s\w]*/,global:/\b(clearInterval|clearTimeout|constructor|document|escape|hasOwnProperty|Infinity|isNaN|NaN|parseFloat|parseInt|prototype|setInterval|setTimeout|toString|unescape|valueOf|window)\b/,keyword:/\b(&&|\|\||arguments|break|case|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|typeof|var|void|while|with|undefined)\b/,regexp:/([\[(\^=,{}:;&|!*?]\s*)(\/(\\\/|[^\/*])(\\.|[^\/\n\\])*\/[mgi]*)/,special:/\b(assert\w*|alert|catch|confirm|console|debug|debugger|eval|finally|prompt|throw|try)\b/},{comment:DEFAULT,string:DEFAULT,regexp:"$1@2",number:DEFAULT});with(base2)with(code)Colorizer["html-multi"]=Colorizer.html.union({inline:function(n,t,i,r){var e=t=="style"?"css":"javascript";return r=Colorizer[e].exec(r,!0),r=format('<span class="%1">%2<\/span>',e,r),format(this.INLINE,t,this.exec(i,!0),r)}});with(base2.code.Colorizer.javascript)add("\\b("+(base2.exports+",base,base2,merge,union,implement,Array2,Date2,String2").match(/[^\s,]+/g).join("|")+")\\b",'<span class="base2">$0<\/span>'),insertAt(0,/("@[^"]+"):/,'<span class="special">$1<\/span>:'),tabStop=2;eval(base2.namespace),eval(DOM.namespace),eval(JSB.namespace),bindings=new RuleList,bindings.add("pre",{ondocumentready:function(){var t,n,i,r,u;for(this.hasClass("js")&&this.addClass("javascript"),t=this.className.split(/\s+/),n=0;n<t.length;n++)if(i=t[n],r=Colorizer[i],r instanceof Colorizer){u=Traversal.getTextContent(this),this.innerHTML=r.exec(u),this.addClass("highlight"),i=="html-multi"&&this.addClass("html");break}}}),bindings.add("input.required,textarea.required",{ondocumentready:updateFlag,ondocumentmouseup:updateFlag,ondocumentkeyup:updateFlag});
//# sourceMappingURL=base2.min.js.map