text: 
  (function(a,b){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],b);}else if(typeof exports!=="undefined"){b(exports);}else if(typeof module!=="undefined"&&module.exports){b(module.exports);}else{b(a.gpf={});}}(this,function(gpf){"use strict";var a="0.1",b,c,d;if("undefined"!==typeof WScript){b="wscript";c=function(){return this;}.apply(null,[]);d="ms";c.console={log:function(e){WScript.Echo("    "+e);},info:function(e){WScript.Echo("[?] "+e);},warn:function(e){WScript.Echo("/!\\ "+e);},error:function(e){WScript.Echo("(X) "+e);}};}else if("undefined"!==typeof phantom&&phantom.version){b="phantomjs";c=window;d="node";}else if("undefined"!==typeof module&&module.exports){b="nodejs";c=global;d="node";}else if("undefined"!==typeof window){b="browser";c=window;}else{b="unknown";c=this;}if(d){gpf[d]={};}gpf.version=function(){return a;};gpf.host=function(){return b;};gpf.context=function(e){var f,g,h;if(undefined===e){return c;}else{if("string"===typeof e){e=e.split(".");}f=e.length;g=0;if(e[0]==="gpf"){h=gpf;++g;}else{h=c;}for(;g<f;++g){h=h[e[g]];if(undefined===h){break;}}return h;}};gpf.loaded=function(e){if(e){e();}return true;};gpf.ASSERT=function(){};(function(){"use strict";if(undefined===Array.prototype.indexOf){Array.prototype.indexOf=function(e){var f=this.length;while(f--){if(this[f]===e){return f;}}return-1;};}if(undefined===Object.defineProperty){gpf.setReadOnlyProperty=function(e,f,g){e[f]=g;return e;};}else{gpf.setReadOnlyProperty=function(e,f,g){Object.defineProperty(e,f,{enumerable:true,configurable:false,writable:false,value:g});return e;};}}());var e=function(r,s,t){var u,v=r.length,w;for(w=0;w<v;++w){u=s.apply(this,[w,r[w]]);if(undefined!==u){return u;}}return t;},f=function(r,s){var t=r.length,u;for(u=0;u<t;++u){s.apply(this,[u,r[u]]);}},g=function(r,s,t){var u,v;for(v in r){if(r.hasOwnProperty(v)){u=s.apply(this,[v,r[v]]);if(undefined!==u){return u;}}}return t;},h=function(r,s){var t;for(t in r){if(r.hasOwnProperty(t)){s.apply(this,[t,r[t]]);}}},i=function(r,s){this[0][r]=s;},j=function(r,s){var t=this[0],u=this[2];if(undefined!==t[r]){u(t,r,s);}else{t[r]=s;}},k=function(r,s,t){var u,v,w,x=r.length;for(u=0;u<x;++u){v=r[u].a;w=r[u].b;if(v===s&&w===t||w===s&&v===t){return u;}}return undefined;},l=function(r,s,t){if(t&&("object"===typeof r||"object"===typeof s)){if(r instanceof String||s instanceof String){return r.toString()===s.toString();}if(r instanceof Number||s instanceof Number){return r.valueOf()===s.valueOf();}return false;}return false;},m=function(r,s,t,u){if(r!==s){if(typeof r!==typeof s&&!l(r,s,t)){return false;}if(null===r||null===s||"object"!==typeof r){return false;}if(undefined===k(u.done,r,s)){u.todo.push(r);u.todo.push(s);}}return true;},n=function(r,s,t){var u,v,w={todo:[r,s],done:[]};while(0!==w.todo.length){s=w.todo.pop();r=w.todo.pop();if(r.prototype!==s.prototype){return false;}w.done.push({a:r,b:s});v=0;for(u in r){if(r.hasOwnProperty(u)){++v;if(!m(r[u],s[u],t,w)){return false;}}}for(u in s){if(s.hasOwnProperty(u)){--v;}}if(0!==v){return false;}}return true;},o={boolean:function(r,s,t){if("string"===s){if("yes"===r||"true"===r){return true;}return 0!==parseInt(r,10);}if("number"===s){return 0!==r;}return t;},number:function(r,s,t){if("string"===s){return parseFloat(r);}return t;},string:function(r,s,t){gpf.interfaces.ignoreParameter(s);gpf.interfaces.ignoreParameter(t);if(r instanceof Date){return gpf.dateToComparableFormat(r);}return r.toString();},object:function(r,s,t){if(t instanceof Date&&"string"===s){return gpf.dateFromComparableFormat(r);}return t;}},p=Function,q=function(){return undefined;};if("browser"===gpf.host()&&window.HTMLCollection){gpf.isArrayLike=function(r){return r instanceof Array||r instanceof window.HTMLCollection||r instanceof window.NodeList;};}else{gpf.isArrayLike=function(r){return r instanceof Array;};}gpf.each=function(r,s,t){if(undefined===t){if(gpf.isArrayLike(r)){f.apply(this,arguments);}else{h.apply(this,arguments);}return undefined;}if(gpf.isArrayLike(r)){return e.apply(this,arguments);}return g.apply(this,arguments);};gpf.extend=function(r,s,t){var u;if(undefined===t){u=i;}else{u=j;}gpf.each.apply(arguments,[s,u]);return r;};gpf.extend(gpf,{_alpha:"abcdefghijklmnopqrstuvwxyz",_ALPHA:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",_digit:"0123456789",_func:function(r){if(!r){return q;}else{return new p(r);}},emptyFunction:function(){return q;},value:function(r,s,t){var u=typeof r;if(!t){t=typeof s;}if(t===u){return r;}if("undefined"===u||!r){return s;}return o[t](r,u,s);},like:function(r,s,t){if(r===s){return true;}if(typeof r!==typeof s){return l(r,s,t);}if(null===r||null===s||"object"!==typeof r){return false;}return n(r,s,t);},clone:function(r){return gpf.json.parse(gpf.json.stringify(r));},test:function(r,s){var t;if(r instanceof Array){t=r.length;while(t>0){if(r[--t]===s){return t;}}}else{for(t in r){if(r.hasOwnProperty(t)&&r[t]===s){return t;}}}return undefined;},set:function(r,s){gpf.ASSERT(r instanceof Array,"gpf.set must be used with an Array");var t=r.length;while(t>0){if(r[--t]===s){return r;}}r.push(s);return r;},clear:function(r,s){var t;if(r instanceof Array){t=r.length;while(t>0){if(r[--t]===s){r.splice(t,1);break;}}}else{for(t in r){if(r.hasOwnProperty(t)&&r[t]===s){break;}}}return r;},xor:function(r,s){return r&&!s||!r&&s;},capitalize:function(r){return r.charAt(0).toUpperCase()+r.substr(1);},Callback:function(r,s){if(r){this._handler=r;}if(s){this._scope=s;}}});gpf.extend(gpf.Callback.prototype,{_handler:gpf._func(""),_scope:null,handler:function(){return this._handler;},scope:function(){return this._scope;},call:function(){var r=arguments[0],s=[],t=arguments.length,u;for(u=1;u<t;++u){s.push(arguments[u]);}return this.apply(r,s);},apply:function(r,s){var t=gpf.Callback.resolveScope(this._scope||r);return this._handler.apply(t,s||[]);}});gpf.extend(gpf.Callback,{resolveScope:function(r){if(null===r||undefined===r){r=gpf.context();}return r;},buildParamArray:function(r,s){var t,u,v;if(s){t=s.length;u=new Array(r+t);for(v=0;v<t;++v){u[r]=s[v];++r;}}else{u=new Array(r);}return u;},doApply:function(r,s,t){var u=arguments.length,v=3,w=0;while(v<u){t[w]=arguments[v];++v;++w;}return r.apply(s,t);},bind:function(r,s){gpf.ASSERT("string"===typeof s,"Provide method name");var t=s+":boundToThis";gpf.ASSERT("function"===typeof r[s],"Only methods can be bound");if(undefined===r[t]){r[t]=function(){return r[s].apply(r,arguments);};}return r[t];}});if(gpf.node){gpf.node.buffer2JsArray=function(r){var s=[],t=r.length,u;for(u=0;u<t;++u){s.push(r.readUInt8(u));}return s;};}var r=0,s=function(x,y,z){var A,B;if(z instanceof t){z._broadcastEvent(x);}else if("function"===typeof z||z instanceof gpf.Callback){z.apply(y,[x]);}else{A=z[x.type()];if(undefined===A){A=z["*"];}if(undefined!==A){B=z.scope;if(undefined!==B){y=B;}A.apply(y,[x]);}}},t=function(x){var y,z,A;this._listeners={};if(undefined!==x){this._events=x;z=x.length;for(y=0;y<z;++y){A=x[y];this["on"+A.charAt(0).toUpperCase()+A.substr(1)]=this._onEVENT(y);this._listeners[A]=[];}}},u=function(x){return function(){var y=[this._events[x]],z=arguments.length,A;for(A=0;A<z;++A){y.push(arguments[A]);}return this.addEventListener.apply(this,y);};},v=function(){t.apply(this,arguments);},w=function(x,y,z,A){this._type=x;if(undefined!==y){this._params=y;}if(z){this._cancelable=true;}if(A){this._scope=A;}};gpf.extend(t.prototype,{_listeners:{},_events:null,_onEVENT:function(x){var y=v.prototype._onEVENT.closures,z;if(!y){y=v.prototype._onEVENT.closures=[];}gpf.ASSERT(y.length>=x,"calls must be sequential");while(y.length<=x){z=y.length;y.push(u(z));}return y[x];},addEventListener:function(x,y,z){var A=this._listeners;if(!z){z=false;}if(undefined===A[x]){A[x]=[];}if(z){A[x].unshift(y);}else{A[x].push(y);}return this;},removeEventListener:function(x,y){var z=this._listeners[x],A;if(undefined!==z){A=z.indexOf(y);if(-1!==A){z.splice(A,1);}}return this;},_broadcastEvent:function(x,y){var z,A,B;if(x instanceof w){A=x.type();}else{A=x;}B=this._listeners[A];if(undefined===B){return this;}if(!(x instanceof w)){x=new gpf.events.Event(x,y,true,this);}for(z=0;z<B.length;++z){gpf.events.fire.apply(this,[x,B[z]]);if(x._propagationStopped){break;}}return this;}});v.prototype=new t;gpf.extend(v.prototype,{broadcastEvent:function(){return this._broadcastEvent.apply(this,arguments);}});gpf.extend(w.prototype,{_type:"",_params:{},_cancelable:false,_propagationStopped:false,_defaultPrevented:false,_scope:null,type:function(){return this._type;},scope:function(){return gpf.Callback.resolveScope(this._scope);},cancelable:function(){return this._cancelable;},preventDefault:function(){this._defaultPrevented=true;},defaultPrevented:function(){return this._defaultPrevented;},stopPropagation:function(){this._propagationStopped=true;},get:function(x){return this._params[x];},fire:function(x){return gpf.events.fire(this,x);}});gpf.events={Target:t,Broadcaster:v,Event:w,fire:function(x,y,z){var A;if(undefined===z){z=y;y=undefined;}if(!(x instanceof w)){x=new gpf.events.Event(x,y,true,this);}A=gpf.Callback.resolveScope(this);if(++r>10){gpf.defer(s,0,null,[x,A,z]);}else{s(x,A,z);}--r;return x;}};var x=0,y={},z=function(H){var I=H.scriptTag,J=H.headTag;I.onerror=I.onload=I.onreadystatechange=null;if(J&&I.parentNode){J.removeChild(I);}delete y[H.id];},A=function(){var H=y[this.id];if(!H.done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){z(H);setTimeout(function(){H.done=true;gpf.events.fire("load",{url:H.src},H.eventsHandler);},0);}},B=function(){var H=y[this.id];if(!H.done){H.done=true;gpf.events.fire("error",{url:H.src},H.eventsHandler);z(H);}},C={application:{javascript:"js"},image:{gif:0,jpeg:"jpg,jpeg",png:0},text:{css:0,html:"htm,html",plain:"txt,text,log"}},D=null,E=null,F=function(H,I){var J,K,L,M,N,O;for(J in I){if(I.hasOwnProperty(J)){if(H){K=H+"/"+J;}else{K=J;}M=I[J];if(0===M){L="."+J;E[L]=K;if(undefined===D[K]){D[K]=L;}}else if("string"===typeof M){M=M.split(",");N=M.length;for(O=0;O<N;++O){L="."+M[O];E[L]=K;if(undefined===D[K]){D[K]=L;}}}else{F(K,M);}}}},G=function(){if(null===E){E={};D={};F("",C);}};gpf.http={include:function(H,I){var J={src:H,id:"__gpf_http_"+ ++x,headTag:document.getElementsByTagName("head")[0]||document.documentElement,scriptTag:document.createElement("script"),done:false},K;if(undefined===I){I=new gpf.events.Broadcaster(["load","error"]);}J.eventsHandler=I;y[J.id]=J;K=J.scriptTag;K.language="javascript";K.src=H;K.id=J.id;K.onload=K.onreadystatechange=A;K.onerror=B;if(undefined!==K.async){K.async=true;}setTimeout(function(){J.headTag.insertBefore(K,J.headTag.firstChild);},0);},getMimeType:function(H){var I;G();I=E[H.toLowerCase()];if(undefined===I){I="application/octet-stream";}return I;},getFileExtension:function(H){var I;G();I=D[H.toLowerCase()];if(undefined===I){I=".bin";}return I;}};var H=function(J,K,L){if("string"===typeof J){J=gpf._func(J);}if(!K){K=null;}if(!L){L=[];}return function(){J.apply(gpf.Callback.resolveScope(K),L);};},I;gpf.runAsyncQueue=gpf._func();if("browser"===gpf.host()){H=function(J){J[0].apply(gpf.Callback.resolveScope(J[1]),J[2]);};gpf.defer=function(J,K,L,M){if("string"===typeof J){J=gpf._func(J);}if(!K){K=0;}setTimeout(H,K,[J,L,M]);};}else if("undefined"!==typeof setTimeout){gpf.defer=function(J,K,L,M){if(!K){K=0;}setTimeout(H(J,L,M),K);};}else{gpf._asyncQueue=[];I=function(J,K){return J._dt-K._dt;};gpf.defer=function(J,K,L,M){var N=H(J,L,M);if(!K){K=0;}N._dt=new Date(new Date- -K);gpf._asyncQueue.push(N);gpf._asyncQueue.sort(I);};gpf.runAsyncQueue=function(){var J=gpf._asyncQueue,K;while(J.length){K=J.shift();if(K._dt>new Date){WScript.Sleep(K._dt-new Date);}K();}};}var J=gpf._ALPHA+gpf._alpha+gpf._digit+"+/",K="0123456789ABCDEF",L=function(N,O,P,Q){var R=N.length,S=gpf.bin.isPow2(R),T,U,V=[],W;if(-1<S&&(undefined===P||P*S<=32)){if(undefined===P){T=32;}else{T=P*S;}U=(1<<T-S)-1;T=(1<<S)-1;while(0!==O){W=O&T;V.unshift(N.charAt(W));O=O>>S&U;}}else{while(0!==O){W=O%R;V.unshift(N.charAt(W));O=(O-W)/R;}}if(undefined!==P){if(undefined===Q){Q=N.charAt(0);}while(V.length<P){V.unshift(Q.charAt(V.length%Q.length));}}else if(0===V.length){V=[N.charAt(0)];}return V.join("");},M=function(N,O,P){var Q=N.length,R=0,S=0;if(undefined===P){P=N.charAt(0);}while(S<O.length){if(-1===P.indexOf(O.charAt(S))){break;}else{++S;}}while(S<O.length){R=Q*R+N.indexOf(O.charAt(S++));}return R;};gpf.bin={pow2:function(N){return 1<<N;},isPow2:function(N){if(0<N&&0===(N&N-1)){var O=0;while(1<N){++O;N>>=1;}return O;}else{return-1;}},toBaseANY:L,fromBaseANY:M,toHexa:function(N,O,P){return L(K,N,O,P);},fromHexa:function(N,O){return M(K,N,O);},toBase64:function(N,O,P){return L(J,N,O,P);},fromBase64:function(N,O){return M(J,N,O);},test:function(N,O){return(N&O)===O;},clear:function(N,O){return N&~O;}};gpf.json={};if("undefined"===typeof JSON){var N=function(P){var Q,R,S,T;Q=P instanceof Array;R=[];for(S in P){if("function"===typeof P[S]){continue;}T=O(P[S]);if(Q){R.push(T);}else{R.push(S+": "+T);}}if(Q){return"["+R.join(", ")+"]";}else{return"{"+R.join(", ")+"}";}},O=function(P){var Q=typeof P;if("undefined"===Q||"function"===Q){return;}else if("number"===Q||"boolean"===Q){return P.toString();}else if("string"===Q){return gpf.escapeFor(P,"javascript");}if(null===P){return"null";}else{return N(P);}};gpf.json.stringify=O;gpf.json.parse=function(P){return gpf._func("return "+P)();};}else{gpf.json.stringify=JSON.stringify;gpf.json.parse=JSON.parse;}var S="public|protected|private|static".split("|"),T=0,U=1,V=3,W=true,X=0,Y=gpf._alpha+gpf._ALPHA+gpf._digit+"_",Z=function(bb){var cb;bb=bb.toString();cb=bb.indexOf("._super");if(-1===cb){return false;}return-1===Y.indexOf(bb.charAt(cb+7));},ab=function(bb,cb){return function(){var db=this._super,eb;this._super=bb;eb=cb.apply(this,arguments);if(undefined===db){delete this._super;}else{this._super=db;}return eb;};};gpf.ClassDefinition=function(bb,cb,db){this._uid=++X;this._Subs=[];if("function"===typeof bb){this._Constructor=bb;}else{this._name=bb;this._Base=cb;this._definition=db;this._build();}};gpf.extend(gpf.ClassDefinition.prototype,{_uid:0,uid:function(){return this._uid;},_name:"",name:function(){return this._name;},nameOnly:function(){var bb=this._name,cb=bb.lastIndexOf(".");if(-1===cb){return bb;}else{return bb.substr(cb+1);}},_Base:Object,Base:function(){return this._Base;},_Subs:[],Subs:function(){return this._Subs;},_attributes:null,attributes:function(){if(!this._attributes){this._attributes=new gpf.attributes.Map;}return this._attributes;},_Constructor:function(){},_defConstructor:null,Constructor:function(){return this._Constructor;},_definition:null,addMember:function(bb,cb,db){var eb=this._Constructor.prototype;gpf.ASSERT(bb!=="constructor","No constructor can be added");gpf.ASSERT(undefined===eb[bb],"No member can be overridden");if(undefined===db){db=T;}else if("string"===typeof db){db=S.indexOf(db);if(-1===db){db=T;}}this._addMember(bb,cb,db);},_addMember:function(bb,cb,db){var eb=this._Constructor.prototype;if(V===db){gpf.setReadOnlyProperty(eb.constructor,bb,cb);}else{eb[bb]=cb;}},_processMember:function(bb,cb){var db=this._definition[bb],eb=bb==="constructor",fb,gb,hb;fb=typeof db;if(V===cb){this._addMember(bb,db,V);return;}if(eb){gb=this._Base;}else{gb=this._Base.prototype[bb];}hb=typeof gb;if("undefined"!==hb&&null!==gb&&fb!==hb){throw gpf.Error.ClassMemberOverloadWithTypeChange();}if("function"===fb&&"undefined"!==hb&&Z(db)){db=ab(gb,db);}if(eb){this._defConstructor=db;}else{this._addMember(bb,db,cb);}},_processAttribute:function(bb){var cb,db=this._definition[bb];bb=bb.substr(1,bb.length-2);if(!this._attributes){this._attributes={};}cb=this._attributes[bb];if(undefined===cb){cb=[];}this._attributes[bb]=cb.concat(db);},_processDefWithVisibility:function(bb){var cb=this._definition,db,eb;eb=S[bb];db=cb[eb];this._definition=db;try{for(eb in db){if(db.hasOwnProperty(eb)){if("["===eb.charAt(0)&&"]"===eb.charAt(eb.length-1)){this._processAttribute(eb);}else if("public"===eb||"private"===eb||"protected"===eb||"static"===eb){throw gpf.Error.ClassInvalidVisibility();}else{this._processMember(eb,bb);}}}if("wscript"===gpf.host()&&db.constructor!==Object){this._processMember("constructor",bb);}}catch(e){throw e;}finally{this._definition=cb;}},_processDefinition:function(){var bb=this._definition,cb,db;for(cb in bb){if(bb.hasOwnProperty(cb)){if("["===cb.charAt(0)&&"]"===cb.charAt(cb.length-1)){this._processAttribute(cb);}else{db=S.indexOf(cb);if(-1===db){if(cb.charAt(0)==="_"){db=U;}else{db=T;}this._processMember(cb,db);}else{this._processDefWithVisibility(db);}}}}if("wscript"===gpf.host()&&bb.constructor!==Object){this._processMember("constructor",T);}},_processAttributes:function(){var bb=this._attributes,cb,db,eb;if(bb){delete this._attributes;cb=this._Constructor;db=cb.prototype;for(eb in bb){if(bb.hasOwnProperty(eb)){if(eb in db||eb==="Class"){gpf.attributes.add(cb,eb,bb[eb]);}else{console.error("gpf.define: Invalid attribute name '"+eb+"'");}}}}},_build:function(){var bb,cb,db;bb=gpf._func(R(this._name))(gpf);this._Constructor=bb;bb._gpf=this;W=false;cb=new this._Base;W=true;bb.prototype=cb;cb.constructor=bb;db=gpf.classDef(this._Base);db.Subs().push(bb);this._processDefinition();this._processAttributes();}});gpf.classDef=function(bb){if(undefined===bb._gpf){bb._gpf=new gpf.ClassDefinition(bb);}return bb._gpf;};gpf._classInit=function(bb,cb){if(W){var db=gpf.classDef(bb);if(db._defConstructor){db._defConstructor.apply(this,cb);}else{db._Base.apply(this,cb);}}};function P(){var gpf=arguments[0],bb=_CONSTRUCTOR_=function(){gpf._classInit.apply(this,[bb,arguments]);};return bb;}function Q(){var gpf=arguments[0],bb=function _CONSTRUCTOR_(){gpf._classInit.apply(this,[bb,arguments]);};return bb;}function R(bb){var cb,db,eb,fb;if(-1<bb.indexOf(".")){cb=P;}else{cb=Q;}db=cb.toString().replace("_CONSTRUCTOR_",bb);eb=db.indexOf("{")+1;fb=db.lastIndexOf("}")-1;return db.substr(eb,fb-eb+1);}gpf.define=function(bb,cb,db){var eb,fb,gb,hb,ib;if("string"===typeof cb){cb=gpf.context(cb);}else if("object"===typeof cb){db=cb;cb=undefined;}if(undefined===cb){cb=Object;}if(-1<bb.indexOf(".")){fb=bb.split(".");hb=fb.pop();gb=gpf.context(fb);}ib=new gpf.ClassDefinition(bb,cb,db||{});eb=ib.Constructor();if(undefined!==gb){gb[hb]=eb;}return eb;};gpf._genDefHandler=function(bb,cb){bb=bb+".";return function(db,eb,fb){var gb;if(undefined===fb&&"object"===typeof eb){fb=eb;eb=bb+cb;}else if(undefined===eb){eb=bb+cb;}if(-1===db.indexOf(".")){db=bb+db;}gb=gpf.define(db,eb,fb);return gb;};};var cb=0,db=gpf._genDefHandler("gpf.attributes","Attribute");gpf.attributes={};function bb(eb,fb){fb="$"+fb;gpf[fb]=function(){var gb=gpf._func("return function "+fb+"(args) {"+"this.constructor.apply(this, args);"+"};")();gb.prototype=eb.prototype;return function(){return new gb(arguments);};}();}gpf._defAttr=function(eb,fb,gb){var hb=eb.charAt(0)==="$",ib,jb;if(hb){eb=eb.substr(1);ib=eb+"Attribute";}else{ib=eb;}jb=db(ib,fb,gb);if(hb){bb(jb,eb);}return jb;};gpf._defAttr("Attribute",{protected:{_member:"",_alterPrototype:function(eb){gpf.interfaces.ignoreParameter(eb);}},public:{member:function(){return this._member;}}});gpf._defAttr("$Alias",{private:{_name:""},protected:{_alterPrototype:function(eb){bb(eb.constructor,this._name);}},public:{constructor:function(eb){this._name=eb;}}});gpf.define("gpf.attributes.Array",{private:{_array:[]},public:{constructor:function(){this._array=[];},has:function(eb){gpf.ASSERT("function"===typeof eb,"Expected a class parameter");gpf.ASSERT(eb.prototype instanceof gpf.attributes.Attribute,"Expected an Attribute-like class parameter");var fb,gb=this._array,hb=gb.length,ib;for(fb=0;fb<hb;++fb){ib=gb[fb];if(ib instanceof eb){return ib;}}return null;},filter:function(eb){gpf.ASSERT("function"===typeof eb,"Expected a class parameter");gpf.ASSERT(eb.prototype instanceof gpf.attributes.Attribute,"Expected an Attribute-like class parameter");var fb,gb=this._array,hb=gb.length,ib,jb=new gpf.attributes.Array,kb=jb._array;for(fb=0;fb<hb;++fb){ib=gb[fb];if(ib instanceof eb){kb.push(ib);}}return jb;},each:function(eb,fb,gb){fb=gpf.Callback.resolveScope(fb);gb=gpf.Callback.buildParamArray(1,gb);var hb,ib=this._array,jb=ib.length,kb;for(hb=0;hb<jb;++hb){kb=gpf.Callback.doApply(eb,fb,gb,ib[hb]);if(undefined!==kb){return kb;}}}}});gpf.define("gpf.attributes.Map",{private:{_members:{},_count:0,_copyTo:function(eb,fb,gb){var hb=this._members,ib,jb,kb,lb;if(this._count){for(ib in hb){if(hb.hasOwnProperty(ib)){jb=hb[ib]._array;for(kb=0;kb<jb.length;++kb){lb=jb[kb];if(!fb||fb(ib,lb,gb)){eb.add(ib,lb);}}}}}},_filterCallback:function(eb,fb,gb){gpf.interfaces.ignoreParameter(eb);return fb instanceof gb;}},public:{constructor:function(eb){this._members={};this._count=0;if(undefined!==eb){this.fillFromObject(eb);}},count:function(){return this._count;},add:function(eb,fb){var gb=this._members[eb];if(undefined===gb){gb=this._members[eb]=new gpf.attributes.Array;}gb._array.push(fb);++this._count;},fillFromObject:function(eb){return this.fillFromClassDef(gpf.classDef(eb.constructor));},fillFromClassDef:function(eb){var fb;while(eb){fb=eb.attributes();if(fb){fb._copyTo(this);}if(eb.Base()!==Object){eb=gpf.classDef(eb.Base());}else{break;}}return this._count;},filter:function(eb){gpf.ASSERT("function"===typeof eb,"Expected a class parameter");gpf.ASSERT(eb.prototype instanceof gpf.attributes.Attribute,"Expected an Attribute-like class parameter");var fb=new gpf.attributes.Map;this._copyTo(fb,this._filterCallback,eb);return fb;},member:function(eb){var fb=this._members[eb];if(undefined===fb||!(fb instanceof gpf.attributes.Array)){if(0===cb){cb=new gpf.attributes.Array;}fb=cb;}return fb;},members:function(){var eb=this._members,fb=[],gb;for(gb in eb){if(eb.hasOwnProperty(gb)){fb.push(gb);}}return fb;},each:function(eb,fb,gb){fb=gpf.Callback.resolveScope(fb);gb=gpf.Callback.buildParamArray(2,gb);var hb=this._members,ib,jb;for(ib in hb){if(hb.hasOwnProperty(ib)){jb=gpf.Callback.doApply(eb,fb,gb,ib,hb[ib]);if(undefined!==jb){return jb;}}}},addTo:function(eb){var fb=this._members,gb;for(gb in fb){if(fb.hasOwnProperty(gb)){gpf.attributes.add(eb,gb,fb[gb]);}}}}});gpf.attributes.add=function(eb,fb,gb){var hb,ib,jb,kb;hb=gpf.classDef(eb).attributes();ib=gb.length;for(jb=0;jb<ib;++jb){kb=gb[jb];kb._member=fb;hb.add(fb,kb);kb._alterPrototype(eb.prototype);}};gpf.define("gpf.Error",{public:{code:0,name:"Error",message:""}});var eb={"NotImplemented":"Not implemented","Abstract":"Abstract","AssertionFailed":"Assertion failed: {message}","ClassMemberOverloadWithTypeChange":"You can't overload a member to change its type","ClassInvalidVisibility":"Invalid visibility keyword","InterfaceExpected":"Expected interface not implemented: {name}","EnumerableInvalidMember":"$Enumerable can be associated to arrays only","PatternUnexpected":"Invalid syntax (unexpected)","PatternEmpty":"Empty pattern","PatternInvalidSyntax":"Invalid syntax","PatternEmptyGroup":"Syntax error (empty group)","HtmlHandlerMultiplicityError":"Too many $HtmlHandler attributes for '{member}'","HtmlHandlerMissing":"No $HtmlHandler attributes","HtmlHandlerNoDefault":"No default $HtmlHandler attribute","EngineStackUnderflow":"Stack underflow","EngineTypeCheck":"Type check","EncodingNotSupported":"Encoding not supported","EncodingEOFWithUnprocessedBytes":"Unexpected end of stream: unprocessed bytes","XmlInvalidName":"Invalid XML name","ParamsNameRequired":"Missing name","ParamsTypeUnknown":"Type unknown","ParamsRequiredMissing":"Required parameter '{name}' is missing","FileNotFound":"File not found"},fb=function(ib,jb){var kb=eb[jb],lb=function(mb){var nb=new gpf.Error,ob,pb;nb.code=ib;nb.name=jb;if(mb){ob={};for(pb in mb){if(mb.hasOwnProperty(pb)){ob["{"+pb+"}"]=mb[pb].toString();}}nb.message=gpf.replaceEx(eb[jb],ob);}else{nb.message=kb;}return nb;};lb.CODE=ib;lb.NAME=jb;lb.MESSAGE=kb;return lb;},gb,hb=0;for(gb in eb){if(eb.hasOwnProperty(gb)){++hb;gpf.Error["CODE_"+gb.toUpperCase()]=hb;gpf.Error[gb]=fb(hb,gb);}}var ib=function(){return this._MEMBER_;},jb=function(){var lb=this._MEMBER_;if(0<arguments.length){this._MEMBER_=arguments[0];}return lb;},kb=gpf._defAttr("ClassAttribute");gpf._defAttr("$ClassProperty",kb,{private:{_writeAllowed:false,_publicName:undefined,_visibility:undefined},protected:{_alterPrototype:function(lb){var mb=this._member,nb=this._publicName,ob=gpf.classDef(lb.constructor),pb,qb,rb;if(!nb){nb=mb.substr(1);}if(this._writeAllowed){pb=jb.toString();}else{pb=ib.toString();}pb=pb.split("_MEMBER_").join(mb);qb=pb.indexOf("{")+1;rb=pb.lastIndexOf("}")-1;pb=pb.substr(qb,rb-qb+1);ob.addMember(nb,gpf._func(pb),this._visibility);}},public:{constructor:function(lb,mb,nb){if(lb){this._writeAllowed=true;}if("string"===typeof mb){this._publicName=mb;}if("string"===typeof nb){this._visibility=nb;}}}});gpf._defAttr("$ClassEventHandler",kb,{});gpf._defAttr("$ClassExtension",kb,{private:{_ofClass:gpf.emptyFunction(),_publicName:""},public:{constructor:function(lb,mb){this._ofClass=lb;if("string"===typeof mb){this._publicName=mb;}}}});var lb=gpf._defAttr("JsonAttribute",{}),mb=gpf._defAttr("$JsonIgnore",lb,{});gpf.json.load=function(nb,ob){var pb=nb.constructor.prototype,qb=new gpf.attributes.Map(nb),rb,sb;for(rb in pb){if("function"===typeof pb[rb]||qb.member(rb).has(mb)){continue;}if(0===rb.indexOf("_")){sb=rb.substr(1);}else{sb=rb;}if(sb in ob){nb[rb]=ob[sb];}else{nb[rb]=pb[rb];}}return nb;};gpf.json.save=function(nb){var ob={},pb=nb.constructor.prototype,qb=new gpf.attributes.Map(nb),rb,sb,tb;for(rb in pb){if("function"===typeof pb[rb]||qb.member(rb).has(mb)){continue;}if(0===rb.indexOf("_")){sb=rb.substr(1);}else{sb=rb;}tb=nb[rb];if(tb!==pb[rb]){ob[sb]=tb;}}return ob;};gpf.interfaces={isImplementedBy:function(pb,qb){var rb;for(rb in qb.prototype){if("constructor"===rb||"extend"===rb){continue;}if(typeof qb.prototype[rb]!==typeof pb[rb]){return false;}}return true;},query:function(pb,qb,rb){var sb=null;if(gpf.interfaces.isImplementedBy(pb,qb)){return pb;}else if(gpf.interfaces.isImplementedBy(pb,gpf.interfaces.IUnknown)){sb=pb.queryInterface(qb);}if(null===sb&&rb){throw gpf.Error.InterfaceExpected({name:gpf.classDef(qb).name()});}return sb;}};if(!gpf.interfaces.ignoreParameter){gpf.interfaces.ignoreParameter=function(){};}gpf._defIntrf=gpf._genDefHandler("gpf.interfaces","Interface");gpf._defIntrf("Interface");gpf._defIntrf("IEventTarget",{addEventListener:function(pb,qb,rb,sb){gpf.interfaces.ignoreParameter(pb);gpf.interfaces.ignoreParameter(qb);gpf.interfaces.ignoreParameter(rb);gpf.interfaces.ignoreParameter(sb);},removeEventListener:function(pb,qb,rb){gpf.interfaces.ignoreParameter(pb);gpf.interfaces.ignoreParameter(qb);gpf.interfaces.ignoreParameter(rb);}});gpf._defIntrf("IUnknown",{queryInterface:function(pb){gpf.interfaces.ignoreParameter(pb);return null;}});function nb(pb){var qb=new gpf.attributes.Map(this).member("Class").filter(gpf.attributes.InterfaceImplementAttribute),rb,sb;for(rb=0;rb<qb.length();++rb){sb=qb.get(rb);if(sb._interfaceDefinition===pb){if(sb._builder){return sb._builder(this);}break;}}return null;}function ob(pb){return function(){var qb=nb.apply(this,arguments);if(null===qb){qb=pb.apply(this,arguments);}return qb;};}gpf._defAttr("$InterfaceImplement",{private:{"[_interfaceDefinition]":[gpf.$ClassProperty(false,"which")],_interfaceDefinition:gpf.emptyFunction(),"[_builder]":[gpf.$ClassProperty(false,"how")],_builder:null},protected:{_alterPrototype:function(pb){var qb=this._interfaceDefinition.prototype,rb=gpf.classDef(this._interfaceDefinition),sb,tb;tb=new gpf.attributes.Map;tb.fillFromClassDef(rb);tb.addTo(pb.constructor);if(!this._builder){for(sb in qb){if(!(sb in pb)){pb[sb]=qb[sb];}}return;}if(undefined!==pb.queryInterface){if(nb!==pb.queryInterface){pb.queryInterface=ob(pb.queryInterface);}}else{pb.queryInterface=nb;gpf.attributes.add(pb.constructor,"Class",[gpf.$InterfaceImplement(gpf.interfaces.IUnknown)]);}}},public:{constructor:function(pb,qb){this._interfaceDefinition=pb;if(qb){this._builder=qb;}}}});var rb=gpf.interfaces,sb=gpf.attributes;gpf._defIntrf("IEnumerable",{reset:function(){},moveNext:function(){return false;},current:function(){return null;}});function pb(tb){var ub=-1;return{reset:function(){ub=-1;},moveNext:function(){++ub;return ub<tb.length;},current:function(){return tb[ub];}};}function qb(tb){var ub=new sb.Map(tb).filter(sb.EnumerableAttribute),vb=ub.members();gpf.ASSERT(vb.length===1,"Only one member can be defined as enumerable");return pb(tb[vb[0]]);}gpf._defAttr("$Enumerable",sb.ClassAttribute,{_alterPrototype:function(tb){if(!gpf.isArrayLike(tb[this._member])){throw gpf.Error.EnumerableInvalidMember();}sb.add(tb.constructor,"Class",[new sb.InterfaceImplementAttribute(rb.IEnumerable,qb)]);}});var tb=gpf.interfaces,ub=gpf.attributes,vb;vb=gpf._defIntrf("IReadOnlyArray",{length:function(){return 0;},get:function(wb){tb.ignoreParameter(wb);return undefined;}});gpf._defIntrf("IArray",vb,{set:function(wb,xb){tb.ignoreParameter(wb);tb.ignoreParameter(xb);return undefined;}});gpf._defAttr("ClassArrayInterfaceAttribute",ub.ClassAttribute,{"[Class]":[gpf.$Alias("ClassIArray")],_writeAllowed:false,constructor:function(wb){if(wb){this._writeAllowed=true;}},_alterPrototype:function(wb){var xb;if(this._writeAllowed){xb=tb.IArray;}else{xb=tb.IReadOnlyArray;}ub.add(wb.constructor,"Class",[gpf.$InterfaceImplement(xb)]);wb.length=gpf._func("return this."+this._member+".length;");wb.get=gpf._func("return this."+this._member+"[arguments[0]];");if(this._writeAllowed){wb.set=gpf._func("var i=arguments[0],"+"v=this."+this._name+"[i];this."+this._member+"[i]=arguments[1];return v;");}}});ub.add(ub.Array,"_array",[gpf.$ClassIArray(false)]);gpf.arrayOrItem=function(wb,xb){if(undefined===xb){return Array.prototype.slice.call(wb,0);}else if(0===wb.length){return undefined;}else if(-1===xb){return wb[wb.length-1];}else if(xb<-1||xb>wb.length-1){return undefined;}else{return wb[xb];}};var xb=gpf.interfaces,yb=gpf.events.fire,zb=256,Ab=0,Bb=1,Cb=2,Db=3;gpf._defIntrf("IReadableStream",{"[read]":[gpf.$ClassEventHandler()],read:function(Eb,Fb){gpf.interfaces.ignoreParameter(Eb);gpf.interfaces.ignoreParameter(Fb);},static:{EVENT_ERROR:"error",EVENT_DATA:"data",EVENT_END_OF_STREAM:"eos",EXCEPTION_READ_IN_PROGRESS:{message:"Read in progress"}}});gpf._defIntrf("IWritableStream",{"[write]":[gpf.$ClassEventHandler()],write:function(Eb,Fb){gpf.interfaces.ignoreParameter(Eb);gpf.interfaces.ignoreParameter(Fb);},static:{EVENT_ERROR:"error",EVENT_READY:"ready",EXCEPTION_WRITE_IN_PROGRESS:{message:"Read in progress"}}});gpf._defIntrf("IStream",{"[read]":[gpf.$ClassEventHandler()],read:function(Eb,Fb){gpf.interfaces.ignoreParameter(Eb);gpf.interfaces.ignoreParameter(Fb);},"[write]":[gpf.$ClassEventHandler()],write:function(Eb,Fb){gpf.interfaces.ignoreParameter(Eb);gpf.interfaces.ignoreParameter(Fb);}});gpf._defIntrf("ITextStream",xb.IStream,{});gpf.stream={pipe:function(Eb,Fb,Gb,Hb){var Ib=new wb(Eb,Fb,Gb,Hb);Ib.ready();}};function wb(Eb,Fb,Gb,Hb){this._readable=xb.queryInterface(Eb,xb.IReadableStream,true);this._writable=xb.queryInterface(Fb,xb.IWritableStream,true);if(undefined===Hb){this._options={};this._eventsHandler=Gb;}else{this._options=Gb;this._eventsHandler=Hb;}this.scope=this;}wb.prototype={_readable:null,_writable:null,_options:null,_eventsHandler:null,scope:null};wb.prototype.ready=function(){var Eb=this._options.chunkSize||4096;this._readable.read(Eb,this);};wb.prototype.eos=function(){yb("done",this._eventsHandler);};wb.prototype.data=function(Eb){var Fb=Eb.get("buffer");this._writable.write(Fb,this);};wb.prototype["*"]=function(Eb){yb(Eb,this._eventsHandler);};gpf.define("gpf.stream.Out",{"[Class]":[gpf.$InterfaceImplement(xb.IWritableStream)],public:{constructor:function(){this._buffer=[];},write:function(Eb,Fb){if("string"===typeof Eb){this._writeString(Eb,Fb);}else{this._writeBuffer(Eb,Fb);}}},private:{_buffer:[],_writeString:function(Eb,Fb){var Gb=Eb.split("\n"),Hb,Ib;Hb=Gb.length;if(Hb){if(1<Hb){console.log(this._buffer.join("")+this._trimFinalR(Gb[0]));this._buffer=[];}--Hb;if(Gb[Hb].length){this._buffer.push(Gb[Hb]);}for(Ib=1;Ib<Hb;++Ib){console.log(this._trimFinalR(Gb[Ib]));}}yb.apply(this,[xb.IWritableStream.EVENT_READY,Fb]);},_trimFinalR:function(Eb){var Fb=Eb.length-1;if(-1<Fb&&Eb.charAt(Fb)==="\r"){return Eb.substr(0,Fb);}return Eb;},_writeBuffer:function(Eb,Fb){gpf.interfaces.ignore(Eb);gpf.interfaces.ignore(Fb);throw gpf.Error.NotImplemented();}}});gpf.define("gpf.stream.BufferedOnRead",{"[Class]":[gpf.$InterfaceImplement(xb.IReadableStream)],protected:{_buffer:[],_bufferLength:0,_readSize:zb,_addToBuffer:function(Eb){gpf.interfaces.ignoreParameter(Eb);throw gpf.Error.Abstract();},_endOfInputStream:function(){},_readFromBuffer:function(Eb){gpf.ASSERT(0!==this._buffer.length,"Buffer is not empty");if("string"===this._buffer[0]){return this._readFromStringBuffer(Eb);}else{return this._readFromByteBuffer(Eb);}},_readFromStringBuffer:function(Eb){var Fb=gpf.stringExtractFromStringArray(this._buffer,Eb);this._bufferLength-=Fb.length;return Fb;},_readFromByteBuffer:function(Eb){this._bufferLength-=Eb;return this._buffer.splice(0,Eb);}},public:{constructor:function(Eb){this._iStream=xb.query(Eb,xb.IReadableStream,true);this._buffer=[];},read:function(Eb,Fb){var Gb=this._iState,Hb=this._bufferLength;if(Bb===Gb){throw xb.IReadableStream.EXCEPTION_READ_IN_PROGRESS;}else if(Eb<Hb||Hb&&Db===Gb){if(0===Eb||Eb>Hb){Eb=Hb;}yb.apply(this,[xb.IReadableStream.EVENT_DATA,{buffer:this._readFromBuffer(Eb)},Fb]);}else if(Db===Gb){yb.apply(this,[xb.IReadableStream.EVENT_END_OF_STREAM,Fb]);}else{if(Ab===this._iState){this._cbRead=new gpf.Callback(this._onRead,this);}this._iState=Bb;this._size=Eb;this._eventsHandler=Fb;this._iStream.read(this._readSize,this._cbRead);}}},private:{_iStream:null,_cbRead:null,_iState:Ab,_size:0,_eventsHandler:null,_onRead:function(Eb){var Fb=Eb.type();if(Fb===xb.IReadableStream.EVENT_END_OF_STREAM){this._iState=Db;this._endOfInputStream();return this.read(this._size,this._eventsHandler);}else if(Fb===xb.IReadableStream.EVENT_ERROR){yb.apply(this,[Eb,this._eventsHandler]);}else{this._iState=Cb;this._addToBuffer(Eb.get("buffer"));if(0<this._bufferLength){return this.read(this._size,this._eventsHandler);}else{this._iStream.read(zb,this._cbRead);}}}}});gpf.define("gpf.stream.BitReader","gpf.stream.BufferedOnRead",{"[Class]":[gpf.$InterfaceImplement(xb.IReadableStream)],protected:{_addToBuffer:function(Eb){this._buffer=this._buffer.concat(Eb);this._bufferLength+=Eb.length*8;},_readFromBuffer:function(Eb){var Fb=this._buffer,Gb=[],Hb=this._bit,Ib,Jb=0,Kb=0;Ib=Fb[0];while(0<Eb){--Eb;Kb<<=1;if(0!==(Ib&Hb)){Kb|=1;}--this._bufferLength;if(Hb===1){Fb.shift();Ib=Fb[0];Hb=128;}else{Hb>>=1;}if(Jb===7){Gb.push(Kb);Kb=0;Jb=0;}else{++Jb;}}if(Jb!==0){Gb.push(Kb);}this._bit=Hb;return Gb;}},private:{_bit:128}});var Eb=gpf.define("AbstractStreamReader",{public:{constructor:function(Hb,Ib){this._scope=gpf.Callback.resolveScope(Hb);this._eventsHandler=Ib;},read:function(Hb){Hb.read(this._readSize,gpf.Callback.bind(this,"callback"));}},protected:{_readSize:0,_consolidateBuffer:function(){throw gpf.Error.Abstract();},_addBuffer:function(Hb){gpf.interfaces.ignoreParameter(Hb);throw gpf.Error.Abstract();}},private:{_scope:null,_eventsHandler:null,callback:function(Hb){var Ib=Hb.type(),Jb=Hb.scope();if(Ib===xb.IReadableStream.EVENT_END_OF_STREAM){yb.apply(this._scope,[xb.IReadableStream.EVENT_DATA,{buffer:this._consolidateBuffer()},this._eventsHandler]);}else if(Ib===xb.IReadableStream.EVENT_ERROR){yb.apply(this._scope,[Hb,this._eventsHandler]);}else{this._addBuffer(Hb.get("buffer"));this.read(Jb);}}}}),Fb=gpf.define("StreamReader",Eb,{public:{constructor:function(Hb,Ib,Jb){this._super(Hb,Ib);this._concatMethod=Jb;}},protected:{_consolidateBuffer:function(){return this._concatMethod(this._buffer);},_addBuffer:function(Hb){this._buffer=this._concatMethod(this._buffer,Hb);}},private:{_buffer:undefined,_concatMethod:null}}),Gb=gpf.define("B64StreamReader",Eb,{public:{constructor:function(Hb,Ib){this._super(Hb,Ib);this._buffer=[];}},protected:{_readSize:6,_consolidateBuffer:function(){return this._buffer.join("");},_addBuffer:function(Hb){this._buffer.push(gpf.bin.toBase64(Hb[0]));}},private:{_buffer:[]}});gpf.stream.readAll=function(Hb,Ib,Jb){Hb=gpf.interfaces.query(Hb,xb.IReadableStream,true);new Fb(this,Jb,Ib).read(Hb);};gpf.stream.readAllAsB64=function(Hb,Ib){Hb=new gpf.stream.BitReader(Hb);new Gb(this,Ib).read(Hb);};if(gpf.node){gpf.define("gpf.node.ReadableStream",{"[Class]":[gpf.$InterfaceImplement(xb.IReadableStream)],public:{constructor:function(Hb){this._stream=Hb;Hb.on("end",gpf.Callback.bind(this,"_onEnd"));Hb.on("error",gpf.Callback.bind(this,"_onError"));},"[read]":[gpf.$ClassEventHandler()],read:function(Hb,Ib){var Jb;if(null!==this._eventsHandler){throw xb.IReadableStream.EXCEPTION_READ_IN_PROGRESS;}this._eventsHandler=Ib;if(this._readable){Jb=this._stream.read(Hb);if(Jb){this._onData(Jb);return;}this._readable=false;}this._size=Hb;this._stream.once("readable",gpf.Callback.bind(this,"_onReadable"));}},protected:{_readable:false,_eventsHandler:null,_size:0,_getEventsHandler:function(){var Hb=this._eventsHandler;gpf.ASSERT(null!==Hb,"Event handler expected");this._eventsHandler=null;return Hb;},_onReadable:function(){this._readable=true;this._onData(this._stream.read(this._size));},_onData:function(Hb){gpf.events.fire("data",{buffer:gpf.node.buffer2JsArray(Hb)},this._getEventsHandler());},_onEnd:function(){gpf.events.fire("eos",this._getEventsHandler());},_onError:function(Hb){gpf.events.fire("error",{error:Hb},this._getEventsHandler());}},private:{_stream:null}});gpf.define("gpf.node.WritableStream",{"[Class]":[gpf.$InterfaceImplement(xb.IWritableStream)],public:{constructor:function(Hb){this._stream=Hb;},"[write]":[gpf.$ClassEventHandler()],write:function(Hb,Ib){gpf.interfaces.ignoreParameter(Hb);gpf.interfaces.ignoreParameter(Ib);}},private:{_stream:null}});}var Jb=gpf.interfaces,Kb=gpf.events.fire,Lb={javascript:{"\\":"\\\\","\"":"\\\"","\n":"\\n","\r":"\\r","\t":"\\t"},xml:{"&":"&amp;","<":"&lt;",">":"&gt;"},html:{"&":"&amp;","<":"&lt;",">":"&gt;","\xE9":"&eacute;","\xE8":"&egrave;","\xEA":"&ecirc;","\xE1":"&aacute;","\xE0":"&agrave;"}},Mb=gpf.define("StringStream",{"[Class]":[gpf.$InterfaceImplement(gpf.interfaces.ITextStream)],public:{constructor:function(Nb){if(undefined!==Nb&&Nb.length){this._buffer=[Nb];}else{this._buffer=[];}},read:function(Nb,Ob){var Pb;if(0===this._buffer.length){Kb.apply(this,[Jb.IReadableStream.EVENT_END_OF_STREAM,Ob]);}else{Pb=gpf.stringExtractFromStringArray(this._buffer,Nb);Kb.apply(this,[Jb.IReadableStream.EVENT_DATA,{buffer:Pb},Ob]);}},write:function(Nb,Ob){gpf.ASSERT(Nb&&Nb.length,"Write must contain data");this._buffer.push(Nb);Kb.apply(this,[Jb.IReadableStream.EVENT_READY,Ob]);},consolidateString:function(){return this._buffer.join("");}},private:{_buffer:[]}});gpf.extend(gpf,{"[capitalize]":[gpf.$ClassExtension(String)],"[replaceEx]":[gpf.$ClassExtension(String)],replaceEx:function(Nb,Ob){var Pb=Nb,Qb;for(Qb in Ob){if(Ob.hasOwnProperty(Qb)){if(-1<Pb.indexOf(Qb)){Pb=Pb.split(Qb).join(Ob[Qb]);}}}return Pb;},"[escapeFor]":[gpf.$ClassExtension(String)],escapeFor:function(Nb,Ob){var Pb=Lb[Ob];if(undefined!==Pb){Nb=gpf.replaceEx(Nb,Pb);if("javascript"===Ob){Nb="\""+Nb+"\"";}}return Nb;},"[stringExtractFromStringArray]":[gpf.$ClassExtension(String,"fromStringArray")],stringExtractFromStringArray:function(Nb,Ob){var Pb=Nb.length,Qb,Rb,Sb,Tb;if(!Ob){Qb=Nb.splice(0,Pb).join("");}else{Rb=0;do{Sb=Nb[Rb];Tb=Sb.length;if(Tb<=Ob){++Rb;Ob-=Tb;}else{break;}}while(0<Ob&&Rb<Pb);if(0===Ob){Qb=Nb.splice(0,Rb).join("");}else if(Rb<Pb){Qb=[];if(0<Rb){Qb.push(Nb.splice(0,Rb-1).join(""));}Sb=Nb.shift();Qb.push(Sb.substr(0,Ob));Nb.unshift(Sb.substr(Ob));Qb=Qb.join("");}else{Qb=Nb.splice(0,Pb).join("");}}return Qb;},"[stringToStream]":[gpf.$ClassExtension(String,"toStream")],stringToStream:function(Nb){return new Mb(Nb);},"[stringFromStream]":[gpf.$ClassExtension(String,"fromStream")],stringFromStream:function(Nb,Ob){if(Nb instanceof Mb){Kb.apply(this,[Jb.IReadableStream.EVENT_DATA,{buffer:Nb.consolidateString()},Ob]);}else{gpf.stream.readAll(Nb,Hb,Ob);}},"[stringFromFile]":[gpf.$ClassExtension(String,"fromFile")],stringFromFile:function(Nb,Ob,Pb){gpf.fs.getInfo(Nb,new Ib(Nb,Ob,Pb));}});function Hb(Nb,Ob){if(undefined===Nb){return[Ob];}else if(undefined!==Ob){Nb.push(Ob);return Nb;}else{return Nb.join("");}}function Ib(Nb,Ob,Pb){this._path=Nb;this._encoding=Ob;this._eventsHandler=Pb;this.scope=this;}Ib.prototype={_path:null,_encoding:"",_eventsHandler:null,_step:0,scope:null};Ib.prototype.ready=function(Nb){if(0===this._step){var Ob=Nb.get("info");if(Ob.type===gpf.fs.TYPE_NOT_FOUND){gpf.events.fire("error",{error:gpf.Error.FileNotFound()},this._eventsHandler);return;}this._step=1;gpf.fs.readAsBinaryStream(this._path,this);}else{var Pb=Nb.get("stream");var Qb=gpf.encoding.createDecoder(Pb,this._encoding);gpf.stringFromStream(Qb,this);}};Ib.prototype["*"]=function(Nb){gpf.events.fire(Nb,this._eventsHandler);};var Ob=gpf.interfaces,Pb=gpf.events.fire,Qb=gpf.define("ArrayStream",{"[Class]":[gpf.$InterfaceImplement(gpf.interfaces.IStream)],public:{constructor:function(Rb){if(undefined!==Rb&&Rb.length){this._buffer=[].concat(Rb);}else{this._buffer=[];}},read:function(Rb,Sb){var Tb;if(0===this._buffer.length){Pb.apply(this,[Ob.IReadableStream.EVENT_END_OF_STREAM,Sb]);}else if(undefined===Rb||Rb>this._buffer.length){Tb=this._buffer;this._buffer=[];Pb.apply(this,[Ob.IReadableStream.EVENT_DATA,{buffer:Tb},Sb]);}else{Tb=this._buffer.splice(0,Rb);Pb.apply(this,[Ob.IReadableStream.EVENT_DATA,{buffer:Tb},Sb]);}},write:function(Rb,Sb){gpf.ASSERT(Rb&&Rb.length,"Write must contain data");this._buffer=this._buffer.concat(Rb);Pb.apply(this,[Ob.IWritableStream.EVENT_READY,Sb]);},consolidateArray:function(){return[].concat(this._buffer);}},private:{_buffer:[]}});gpf.extend(gpf,{"[arrayToStream]":[gpf.$ClassExtension(Array,"toStream")],arrayToStream:function(Rb){return new Qb(Rb);},"[arrayFromStream]":[gpf.$ClassExtension(Array,"fromStream")],arrayFromStream:function(Rb,Sb){if(Rb instanceof Qb){Pb.apply(this,[Ob.IReadableStream.EVENT_DATA,{buffer:Rb.consolidateArray()},Sb]);return;}else{gpf.stream.readAll(Rb,Nb,Sb);}}});function Nb(Rb,Sb){if(undefined===Rb){return Sb;}else if(undefined!==Sb){Rb=Rb.concat(Sb);return Rb;}else{return Rb;}}var Rb=function(Sb){if(10>Sb){return"0"+Sb;}else{return Sb;}};gpf.extend(gpf,{"[dateToComparableFormat]":[gpf.$ClassExtension(Date,"toComparableFormat")],dateToComparableFormat:function(Sb,Tb){if(undefined===Tb){Tb=true;}var Ub=[Sb.getFullYear(),"-",Rb(Sb.getMonth()+1),"-",Rb(Sb.getDate())];if(Tb){Ub.push(" ",Rb(Sb.getHours()),":",Rb(Sb.getMinutes()),":",Rb(Sb.getSeconds()));}return Ub.join("");},"[dateFromComparableFormat]":[gpf.$ClassExtension(String)],dateFromComparableFormat:function(Sb){var Tb=new Date;Tb.setFullYear(parseInt(Sb.substr(0,4),10),parseInt(Sb.substr(5,2),10)-1,parseInt(Sb.substr(8,2),10));if(10<Sb.length){Tb.setHours(parseInt(Sb.substr(11,2),10),parseInt(Sb.substr(14,2),10),parseInt(Sb.substr(17,2),10),0);}else{Tb.setHours(0,0,0,0);}return Tb;}});var Sb=gpf.events.fire,Tb=function(Vb){var Wb;if(this._list.length){Wb=this._list.shift();this._pos=0;Sb.apply(this,[gpf.Promise.THEN,Vb,Wb]);}},Ub=function(Vb){var Wb,Xb;while(this._list.length){Wb=this._list.shift();if(undefined===Xb){Xb=Sb.apply(this,[gpf.Promise.FAIL,Vb,Wb]);}else{Sb.apply(this,[Xb,Wb]);}if(Xb._propagationStopped){break;}}};gpf.define("gpf.Promise",{private:{_list:[],_pos:0},public:{constructor:function(){this._list=[];},then:function(Vb){this._list.splice(this._pos,0,Vb);++this._pos;return this;},resolve:function(Vb){gpf.defer(Tb,0,this,[Vb]);},reject:function(Vb){gpf.defer(Ub,0,this,[Vb]);}},static:{THEN:"then",REJECT:"reject"}});var Vb=gpf.interfaces,Wb=gpf.events.fire,Xb={},Yb=function(dc){return function(){this._calls.push(new bc(true,dc,arguments,0));this._start();return this;};},Zb=function(dc,ec){return function(){this._calls.push(new bc(false,dc,arguments,ec));this._start();return this;};},ac=function(dc){var ec={public:{},static:{interface:dc}},fc=ec.public,gc=new gpf.attributes.Map,hc=dc.prototype,ic,jc;gc.fillFromClassDef(gpf.classDef(dc));for(ic in hc){if(hc.hasOwnProperty(ic)){jc=hc[ic];if("constructor"===ic){continue;}gpf.ASSERT("function"===typeof jc,"Only methods");if(gc.member(ic).has(gpf.attributes.ClassEventHandlerAttribute)){fc[ic]=Zb(ic,jc.length);}else{fc[ic]=Yb(ic);}}}return ec;},bc=gpf.define("MethodCall",{private:{_synchronous:true,_name:"",_args:[],_length:0},public:{constructor:function(dc,ec,fc,gc){this._synchronous=dc;this._name=ec;this._args=fc;this._length=gc;},apply:function(dc,ec){var fc=this._args,gc=dc[this._name],hc,ic,jc;if(this._synchronous){gc.apply(dc,fc);ec.call();}else{ic=this._length;hc=new Array(ic);hc[--ic]=ec;if(ic>fc.length){ic=fc.length;}for(jc=0;jc<ic;++jc){hc[jc]=fc[jc];}gc.apply(dc,hc);}}}}),cc=gpf.define("WrapInterface",{private:{_iHandler:null,_calls:[],_callback:null,_catch:null,_finally:null,_finalEventType:"done",_asyncResult:function(dc){var ec=this._iHandler,fc;if(dc&&dc.type()==="error"){if(this._catch){Wb.apply(ec,[dc,this._catch]);}return;}fc=this._calls;if(fc.length){fc.shift().apply(ec,this._callback);}else if(this._finally){Wb.apply(ec,[this._finalEventType,this._finally]);}},_needStart:true,_start:function(){if(this._needStart){this._needStart=false;gpf.defer(this._asyncResult,0,this);}}},public:{constructor:function(dc){this._iHandler=Vb.query(dc,this.constructor.interface);this._calls=[];this._callback=new gpf.Callback(this._asyncResult,this);},$catch:function(dc){this._catch=dc;this._start();return this;},$finally:function(dc,ec){this._finally=dc;if(ec){this._finalEventType=ec;}this._start();return this;}}});Vb.wrap=function(dc){var ec=gpf.classDef(dc),fc=Xb[ec.uid()],gc;if(undefined===fc){if(dc===Vb.Interface){fc=cc;}else{gc=Vb.wrap(ec.Base());fc=gpf.define("Wrap"+ec.nameOnly(),gc,ac(dc));}Xb[ec.uid()]=fc;}return fc;};gpf.define("gpf.Parser",{public:{constructor:function(){this.reset();},reset:function(dc){this._pos=0;this._line=0;this._column=0;this._setParserState(dc);},currentPos:function(){return{pos:this._pos,line:this._line,column:this._column};},parse:function(){var dc=arguments.length,ec,fc;for(ec=0;ec<dc;++ec){fc=arguments[ec];if(null===fc){this._finalizeParserState();}else{gpf.ASSERT("string"===typeof fc,"string expected");this._parse(fc);}}},setOutputHandler:function(dc){gpf.ASSERT(dc instanceof Array||dc.apply,"Invalid output handler");this._outputHandler=dc;}},protected:{_initialParserState:null,_ignoreCarriageReturn:false,_ignoreLineFeed:false,_finalizeParserState:function(){this._pState(0);},_setParserState:function(dc){if(!dc){dc=this._initialParserState;}if(dc!==this._pState){this._pState=dc;}},_output:function(dc){var ec=this._outputHandler;if(ec instanceof Array){ec.push(dc);}else if(null!==ec){ec.apply(this,[dc]);}}},private:{_pos:0,_line:0,_column:0,_pState:null,_outputHandler:null,_parse:function(dc){var ec,fc,gc,hc,ic=false;ec=dc.length;for(fc=0;fc<ec;++fc){gc=dc.charAt(fc);if("\r"===gc&&this._ignoreCarriageReturn){gc=0;}if("\n"===gc&&this._ignoreLineFeed){ic=true;gc=0;}if(gc){hc=this._pState.apply(this,[gc]);if(undefined!==hc){this._setParserState(hc);}}++this._pos;if("\n"===gc||ic){++this._line;this._column=0;}else{++this._column;}}}},static:{FINALIZE:null}});gpf.define("gpf.ParserStream",gpf.stream.BufferedOnRead,{public:{constructor:function(dc,ec){this._super(ec);this._parser=dc;this._parser.setOutputHandler(new gpf.Callback(this._output,this));}},protected:{_addToBuffer:function(dc){this._parser.parse(dc);},_endOfInputStream:function(){this._parser.parse(gpf.Parser.FINALIZE);},_readFromBuffer:gpf.stream.BufferedOnRead.prototype._readFromStringBuffer},private:{_output:function(dc){this._buffer.push(dc);this._bufferLength+=dc.length;}}});var dc=gpf.bin.test,ec=gpf.bin.clear,fc=gpf._defIntrf("ITokenizer",{write:function(mc){gpf.interfaces.ignoreParameter(mc);return-1;}}),gc=gpf.define("PatternItem",{private:{"[_min]":[gpf.$ClassProperty(true)],_min:1,"[_max]":[gpf.$ClassProperty(true)],_max:1},public:{parse:function(mc){gpf.interfaces.ignoreParameter(mc);throw gpf.Error.Abstract();},finalize:function(){},reset:function(mc){gpf.interfaces.ignoreParameter(mc);},write:function(mc,nc){gpf.interfaces.ignoreParameter(mc);gpf.interfaces.ignoreParameter(nc);throw gpf.Error.Abstract();}},static:{PARSE_IGNORED:0,PARSE_PROCESSED:1,PARSE_END_OF_PATTERN:2,PARSE_PROCESSED_EOP:3,CHARS_QUANTIFICATION:"?*+",WRITE_NO_MATCH:-1,WRITE_NEED_DATA:0,WRITE_MATCH:1,WRITE_PATTERN_END:2,WRITE_FINAL_MATCH:3}}),hc=gpf.define("PatternChar",gc,{private:{_match:""},public:{parse:function(mc){this._match=mc;return gc.PARSE_PROCESSED_EOP;},write:function(mc,nc){gpf.interfaces.ignoreParameter(mc);if(nc===this._match){return gc.WRITE_FINAL_MATCH;}return gc.WRITE_NO_MATCH;}}}),ic=gpf.define("PatternRange",gc,{private:{_inc:"",_exc:"",_inRange:false,_parse:function(mc,nc){var oc,pc;if("^"===mc){this._exc=[];}else if("]"===mc){if(this._inRange){throw gpf.Error.PatternInvalidSyntax();}return true;}else if("-"===mc){if(this._inRange||0===nc.length){throw gpf.Error.PatternInvalidSyntax();}this._inRange=true;}else{if(this._inRange){oc=nc[nc.length-1].charCodeAt(0);pc=mc.charCodeAt(0);while(--pc>oc){nc.push(String.fromCharCode(pc));}nc.push(mc);delete this._inRange;}else{nc.push(mc);}}return false;}},public:{parse:function(mc){var nc;if(this.hasOwnProperty("_exc")){if("^"===mc){throw gpf.Error.PatternInvalidSyntax();}nc=this._exc;}else{nc=this._inc;}if("["===mc){if(this.hasOwnProperty("_inc")){throw gpf.Error.PatternInvalidSyntax();}this._inc=[];}else if(this._parse(mc,nc)){return gc.PARSE_PROCESSED_EOP;}return gc.PARSE_PROCESSED;},finalize:function(){this._inc=this._inc.join("");if(this.hasOwnProperty("_exc")){this._exc=this._exc.join("");}},write:function(mc,nc){gpf.interfaces.ignoreParameter(mc);var oc;if(this._inc.length){oc=-1<this._inc.indexOf(nc);}else{oc=true;}if(oc&&this._exc.length){oc=-1===this._exc.indexOf(nc);}if(oc){return gc.WRITE_FINAL_MATCH;}else{return gc.WRITE_NO_MATCH;}}}}),jc=gpf.define("PatternGroup",gc,{private:{_items:[],_choice:false,_optionals:[],_parsedParenthesis:false,_parsedItem:null,_getItems:function(mc){if(this._choice){if(undefined===mc){mc=this._items.length-1;}return this._items[mc];}return this._items;},_lastItem:function(){var mc=this._getItems();return mc[mc.length-1];},_push:function(mc){this._getItems().push(mc);this._parsedItem=mc;return mc;},_parseItem:function(mc){var nc=this._parsedItem,oc;if(nc){oc=nc.parse(mc);if(dc(oc,gc.PARSE_END_OF_PATTERN)){nc.finalize();this._parsedItem=null;oc=ec(oc,gc.PARSE_END_OF_PATTERN);}}else{oc=0;}return oc;},_parseQuantity:function(mc){var nc=this._lastItem();if("*"===mc){nc._min=0;nc._max=0;}else if("+"===mc){nc._max=0;}else if("?"===mc){nc._min=0;}return gc.PARSE_PROCESSED;},_getOptional:function(mc){var nc;nc=mc.length;while(nc--){if(0!==mc[nc].min()){++nc;break;}}return nc;},_reset:function(mc,nc){nc.count=0;nc.sub={};mc.reset(nc.sub);},_getItem:function(mc,nc){var oc=this._getItems(mc.choice);if(nc<oc.length){return oc[nc];}return null;},_writeNoMatch:function(mc,nc,oc){if(nc.count<mc.min()||nc.length>nc.matchingLength+1){return gc.WRITE_NO_MATCH;}mc=this._getItem(nc,nc.index+1);if(null===mc){return gc.WRITE_NO_MATCH;}++nc.index;this._reset(mc,nc);return this.write(nc,oc);},_writeMatch:function(mc,nc){var oc=this._getItem(nc,nc.index+1),pc;if(this._choice&&-1<nc.choice){pc=this._optionals[nc.choice];}else{pc=this._optionals[0];}++nc.count;if(0===mc.max()){this._reset(mc,nc);if(null!==oc&&pc>nc.index){return gc.WRITE_NEED_DATA;}else{return gc.WRITE_MATCH;}}else if(nc.count===mc.max()){if(null===oc){return gc.WRITE_FINAL_MATCH;}++nc.index;this._reset(oc,nc);if(pc<=nc.index){return gc.WRITE_MATCH;}}return gc.WRITE_NEED_DATA;}},public:{constructor:function(){this._items=[];},parse:function(mc){var nc=this._parseItem(mc);if(0!==nc){return nc;}if(-1<gc.CHARS_QUANTIFICATION.indexOf(mc)){return this._parseQuantity(mc);}if("|"===mc){if(!this._choice){this._items=[this._items];this._choice=true;}this._items.push([]);return gc.PARSE_PROCESSED;}else if("["===mc){this._push(new ic);}else if("("===mc){if(this._parsedParenthesis){this._push(new jc);}else{this._parsedParenthesis=true;return gc.PARSE_PROCESSED;}}else if(")"===mc){return gc.PARSE_PROCESSED_EOP;}else{this._push(new hc);}return this._parseItem(mc);},finalize:function(){var mc,nc,oc;oc=this._optionals=[];if(this._choice){mc=this._items.length;for(nc=0;nc<mc;++nc){oc.push(this._getOptional(this._items[nc]));}}else{oc.push(this._getOptional(this._items));}},reset:function(mc){var nc;mc.index=0;if(this._choice){mc.choice=-1;}nc=this._getItems(0)[0];this._reset(nc,mc);},write:function(mc,nc){var oc,pc,qc,rc;if(this._choice&&-1===mc.choice){oc=this._items.length;for(pc=0;pc<oc;++pc){qc=this._items[pc][0];this._reset(qc,mc);rc=qc.write(mc.sub,nc);if(gc.WRITE_NO_MATCH!==rc){mc.choice=pc;return this._writeMatch(qc,mc);}}if(pc===oc){return gc.WRITE_NO_MATCH;}}qc=this._getItem(mc,mc.index);rc=qc.write(mc.sub,nc);if(gc.WRITE_NEED_DATA===rc){return rc;}else if(gc.WRITE_NO_MATCH===rc){return this._writeNoMatch(qc,mc,nc);}else{return this._writeMatch(qc,mc);}}}}),kc=gpf.define("PatternParser",gpf.Parser,{private:{"[_patternItem]":[gpf.$ClassProperty()],_patternItem:null},protected:{_initialParserState:function(mc){this._patternItem.parse(mc);},_finalizeParserState:function(){var mc=this._patternItem;mc.parse(")");mc.finalize();}},public:{constructor:function(){this._super.apply(this,arguments);this._patternItem=new jc;this._patternItem.parse("(");}}}),lc=gpf.define("PatternTokenizer",{"[Class]":[gpf.$InterfaceImplement(fc)],private:{_patternItem:null,_stopMatching:false,_lastResult:0,_totalLength:0,_state:{}},public:{constructor:function(mc){this._patternItem=mc;this._state={};this._patternItem.reset(this._state);},write:function(mc){var nc;if(this._stopMatching){return this._lastResult;}++this._totalLength;nc=this._patternItem.write(this._state,mc);if(0<nc){this._lastResult=this._totalLength;this._stopMatching=dc(nc,gc.WRITE_PATTERN_END);}else if(gc.WRITE_NO_MATCH===nc){this._stopMatching=true;if(0===this._lastResult){this._lastResult=-1;}}return this._lastResult;}}});gpf.define("gpf.Pattern",{private:{_patternItem:null},public:{constructor:function(mc){var nc=new kc;nc.parse(mc,null);this._patternItem=nc.patternItem();},allocate:function(){return new lc(this._patternItem);}}});var mc="error",nc="unknown",oc="keyword",pc="identifier",qc="string",rc="number",sc="symbol",tc="comment",uc="space",vc=99,wc=0,xc=gpf._alpha+gpf._ALPHA+"_$",yc=2,zc=3,Ac=4,Bc=5,Cc=6,Dc=7,Ec=8,Fc=9,Gc="(){}[]<>|&?,.;:!=+-*/%^~",Hc=10,Ic=11,Jc=" \t\r\n",Kc=12,Lc=0,Mc=0,Nc=1,Oc=2,Pc=3,Qc=4,Rc=["Parsing aborted","Unknown token","Unterminated string","Unterminated comment","Invalid or unsupported string escape"],Sc=function(){return{pos:0,line:0,column:0,state:wc,chars:[],nextPos:0,nextLine:0,nextColumn:0,eventsHandler:null,that:null};},Tc=("break,case,catch,continue,debugger,default,delete,do,"+"else,finally,for,function,if,in,instanceof,new,return,switch,"+"this,throw,try,typeof,var,void,while,with").split(","),Uc=function(){var fd={};fd[wc]=nc;fd[Hc]=sc;fd[Ec]=tc;fd[Fc]=tc;fd[zc]=qc;fd[Bc]=qc;fd[Ic]=rc;fd[Kc]=uc;return fd;}(),Vc=function(fd,gd){var hd,id,jd,kd={token:"",pos:fd.pos,line:fd.line,column:fd.column,code:0,message:""};if(undefined!==gd){id=mc;fd.state=vc;kd.code=gd;kd.message=Rc[gd-Lc];}else{hd=fd.chars.join("");if(yc===fd.state){if(undefined!==gpf.test(Tc,hd)){id=oc;}else{id=pc;}}else{id=Uc[fd.state];}kd.token=hd;}jd=gpf.events.fire.apply(fd.that,[id,kd,fd.eventsHandler]);if(jd.defaultPrevented()){Vc(fd,Mc);}else if(undefined!==gd){throw 0;}fd.state=wc;fd.chars=[];fd.pos=fd.nextPos;fd.line=fd.nextLine;fd.column=fd.nextColumn;},Wc=[0,function(fd,gd,hd){gpf.interfaces.ignoreParameter(gd);if(-1<"(){}[].,;:?".indexOf(fd)){return false;}if(-1<"!^~*/%".indexOf(fd)){return"="===hd;}return"="===hd||fd===hd;},function(fd,gd,hd){if(-1<"+-|&".indexOf(fd)){return false;}if("<"===fd){return"<"===gd[1]&&"="===hd;}if(-1<"=!".indexOf(fd)){return"="===hd;}if(">"===fd){return"="!==gd[1]&&("="===hd||">"===hd);}return false;},function(fd,gd,hd){return">"===fd&&"="!==gd[2]&&"="===hd;},function(){return false;}],Xc=function(fd,gd){var hd=fd[0];return Wc[fd.length](hd,fd,gd);},Yc=function(){var fd={};fd[yc]=function(gd,hd){if(-1===xc.indexOf(hd)&&("0">hd||hd>"9")){Vc(gd);}else{gd.chars.push(hd);}};fd[Ic]=function(gd,hd){if("0">hd||hd>"9"){Vc(gd);}else{gd.chars.push(hd);}};fd[zc]=fd[Bc]=function(gd,hd){gd.chars.push(hd);if("\\"===hd){++gd.state;}else if("\n"===hd){Vc(gd,Oc);}else if(zc===gd.state&&"\""===hd){Vc(gd);return true;}else if(Bc===gd.state&&"'"===hd){Vc(gd);return true;}return false;};fd[Ac]=fd[Cc]=function(gd,hd){if("\\"===hd||"r"===hd||"n"===hd||"t"===hd||"\""===hd||"'"===hd){--gd.state;gd.chars.push(hd);}else{Vc(gd,Qc);}};fd[Dc]=function(gd,hd){if("/"===hd){gd.state=Ec;gd.chars.push(hd);}else if("*"===hd){gd.state=Fc;gd.chars.push(hd);}else{gd.state=Hc;if(Xc(gd.chars,hd)){gd.chars.push(hd);}else{Vc(gd);}}};fd[Ec]=function(gd,hd){if("\n"===hd){Vc(gd);}else{gd.chars.push(hd);}};fd[Fc]=function(gd,hd){gd.chars.push(hd);if("/"===hd&&gd.chars[gd.chars.length-2]==="*"){Vc(gd);return true;}return false;};fd[Kc]=function(gd,hd){if(-1<Jc.indexOf(hd)){gd.chars.push(hd);}else{Vc(gd);}};fd[Hc]=function(gd,hd){if(-1<Gc.indexOf(hd)){if(Xc(gd.chars,hd)){gd.chars.push(hd);}else{Vc(gd);}}else{Vc(gd);}};return fd;}(),Zc=function(fd,gd){fd.chars=[gd];if(-1<xc.indexOf(gd)){fd.state=yc;}else if("0"<=gd&&gd<="9"){fd.state=Ic;}else if("\""===gd){fd.state=zc;}else if("'"===gd){fd.state=Bc;}else if("/"===gd){fd.state=Dc;}else if(-1<Gc.indexOf(gd)){fd.state=Hc;}else if(-1<Jc.indexOf(gd)){fd.state=Kc;}else{Vc(fd,Nc);}},ad=function(fd,gd){var hd=Yc[fd.state];if(undefined!==hd){if(hd(fd,gd)){return;}}if(wc===fd.state){Zc(fd,gd);}},bd=function(fd,gd){++fd.nextPos;if("\n"===gd){++fd.nextLine;fd.nextColumn=0;}else{++fd.nextColumn;}},cd=function(fd,gd){ad(fd,gd);bd(fd,gd);},dd=function(){var fd={};fd[yc]=1;fd[Ic]=1;fd[Ec]=1;fd[Hc]=1;fd[Dc]=2;fd[Fc]=3;fd[zc]=4;fd[Bc]=4;fd[Ac]=4;fd[Cc]=4;return fd;}(),ed=function(fd){var gd=dd[fd.state];if(1===gd){Vc(fd);}else if(2===gd){fd.state=Hc;Vc(fd);}else if(3===gd){Vc(fd,Pc);}else if(4===gd){Vc(fd,Oc);}gpf.ASSERT(wc===fd.state||vc===fd.state||Kc===fd.state,"Unexpected non-final state");};gpf.js={};gpf.extend(gpf.js,{keywords:function(){return Tc;},"[tokenize]":[gpf.$ClassEventHandler()],tokenize:function(fd,gd){var hd,id,jd=Sc();jd.eventsHandler=gd;jd.that=this;try{for(hd=0,id=fd.length;hd<id;++hd){cd(jd,fd.charAt(hd));}ed(jd);}catch(e){if("number"!==typeof e){throw e;}}},tokenizeEx:function(fd,gd,hd){var id,jd;if(undefined===hd){hd=Sc();}hd.eventsHandler=gd;hd.that=this;try{if(null===fd){ed(hd);hd=null;}else{for(id=0,jd=fd.length;id<jd;++id){cd(hd,fd.charAt(id));}}}catch(e){if("number"!==typeof e){throw e;}}return hd;}});(function(){"use strict";var fd=function(kd){var ld=[],md=kd.length,nd,od;for(nd=0;nd<md;++nd){od=kd.charCodeAt(nd);if(od<128){ld.push(od);}else if(od>127&&od<2048){ld.push(od>>6|192);ld.push(od&63|128);}else{ld.push(od>>12|224);ld.push(od>>6&63|128);ld.push(od&63|128);}}return ld;},gd=function(kd,ld){var md=[],nd=kd.length,od=0,pd,qd,rd;while(od<nd){pd=kd[od];if(pd<128){md.push(String.fromCharCode(pd));}else if(pd>191&&pd<224){if(od+1===nd){break;}qd=kd[++od];md.push(String.fromCharCode((pd&31)<<6|qd&63));}else{if(od+2>=nd){break;}qd=kd[++od];rd=kd[++od];md.push(String.fromCharCode((pd&15)<<12|(qd&63)<<6|rd&63));}++od;}while(od<nd){ld.push(kd[od++]);}return md.join("");},hd={"utf-8":[fd,gd]},id=gpf.define("EncoderStream",gpf.stream.BufferedOnRead,{public:{constructor:function(kd,ld){this._super(ld);this._encoder=kd;}},protected:{_addToBuffer:function(kd){this._buffer=this._buffer.concat(this._encoder(kd));this._bufferLength=this._buffer.length;},_readFromBuffer:gpf.stream.BufferedOnRead.prototype._readFromByteBuffer},private:{_encoder:null}}),jd=gpf.define("DecoderStream",gpf.stream.BufferedOnRead,{public:{constructor:function(kd,ld){this._super(ld);this._decoder=kd;}},protected:{_addToBuffer:function(kd){var ld;if(this._unprocessed.length){kd=this._unprocessed.concat(kd);}this._unprocessed=[];ld=this._decoder(kd,this._unprocessed);this._buffer.push(ld);this._bufferLength+=ld.length;},_endOfInputStream:function(){if(this._unprocessed.length){throw gpf.Error.EncodingEOFWithUnprocessedBytes();}},_readFromBuffer:gpf.stream.BufferedOnRead.prototype._readFromStringBuffer},private:{_decoder:null,_unprocessed:[]}});gpf.encoding={UTF_8:"utf-8",createEncoder:function(kd,ld){var md=hd[ld];if(undefined===md){throw gpf.Error.EncodingNotSupported();}return new id(md[0],kd);},createDecoder:function(kd,ld){var md=hd[ld];if(undefined===md){throw gpf.Error.EncodingNotSupported();}return new jd(md[1],kd);}};}());var fd=gpf.interfaces,gd=gpf.attributes,hd=gpf.events.fire;gpf.xml={};gpf._defIntrf("IXmlSerializable",{"[toXml]":[gpf.$ClassEventHandler()],toXml:function(id,jd){fd.ignoreParameter(id);fd.ignoreParameter(jd);}});gpf._defIntrf("IXmlContentHandler",{"[characters]":[gpf.$ClassEventHandler()],characters:function(id,jd){fd.ignoreParameter(id);fd.ignoreParameter(jd);},"[endDocument]":[gpf.$ClassEventHandler()],endDocument:function(id){fd.ignoreParameter(id);},"[endElement]":[gpf.$ClassEventHandler()],endElement:function(id){fd.ignoreParameter(id);},endPrefixMapping:function(id){fd.ignoreParameter(id);},"[ignorableWhitespace]":[gpf.$ClassEventHandler()],ignorableWhitespace:function(id,jd){fd.ignoreParameter(id);fd.ignoreParameter(jd);},"[processingInstruction]":[gpf.$ClassEventHandler()],processingInstruction:function(id,jd,kd){fd.ignoreParameter(id);fd.ignoreParameter(jd);fd.ignoreParameter(kd);},setDocumentLocator:function(id){fd.ignoreParameter(id);},skippedEntity:function(id){fd.ignoreParameter(id);},"[startDocument]":[gpf.$ClassEventHandler()],startDocument:function(id){fd.ignoreParameter(id);},"[startElement]":[gpf.$ClassEventHandler()],startElement:function(id,jd,kd,ld,md){fd.ignoreParameter(id);fd.ignoreParameter(jd);fd.ignoreParameter(kd);fd.ignoreParameter(ld);fd.ignoreParameter(md);},startPrefixMapping:function(id,jd){fd.ignoreParameter(id);fd.ignoreParameter(jd);}});var id=gpf._defAttr("XmlAttribute",{protected:{_alterPrototype:function(wd){if(undefined===wd.toXml){gd.add(wd.constructor,"Class",[gpf.$InterfaceImplement(fd.IXmlSerializable)]);wd.toXml=td;gd.add(wd.constructor,"Class",[gpf.$InterfaceImplement(fd.IXmlContentHandler,vd)]);}}}}),jd=gpf._defAttr("$XmlIgnore",id,{}),kd=gpf._defAttr("$XmlAttribute",id,{private:{"[_name]":[gpf.$ClassProperty()],_name:""},public:{constructor:function(wd){gpf.ASSERT(gpf.xml.isValidName(wd),"Valid XML attribute name");this._name=wd;}}}),ld=gpf._defAttr("XmlRawElementAttribute",id,{private:{"[_name]":[gpf.$ClassProperty()],_name:""},public:{constructor:function(wd){gpf.ASSERT(gpf.xml.isValidName(wd),"Valid XML element name");this._name=wd;}}}),md=gpf._defAttr("$XmlElement",ld,{private:{"[_objClass]":[gpf.$ClassProperty()],_objClass:null},public:{constructor:function(wd,xd){this._super(wd);if(xd){this._objClass=xd;}}}}),nd=gpf._defAttr("$XmlList",ld,{}),od=function(wd,xd){var yd,zd,Ad=null,Bd=null,Cd;for(yd=0;yd<wd.length();++yd){zd=wd.get(yd);if(!(zd instanceof md)){continue;}Cd=zd.objClass();if(Cd){if(xd instanceof Cd){if(!Bd||Cd.prototype instanceof Bd.objClass()){Bd=zd;}}}else if(!Ad){Ad=zd;}}if(null!==Bd){return Bd;}else{return Ad;}},pd=function(wd,xd,yd,zd){var Ad;if(xd instanceof Array||zd.has(nd)||"object"===yd||zd.has(md)){return"";}Ad=zd.has(kd);if(Ad&&Ad.name()){wd=Ad.name();}else{if("_"===wd.charAt(0)){wd=wd.substr(1);}}return wd;},qd=function(wd,xd,yd,zd){var Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd;Ad=wd[xd];if(Ad instanceof Date){Ad=gpf.dateToComparableFormat(Ad,true);}Bd=zd.member(xd);if("_"===xd.charAt(0)){xd=xd.substr(1);}Cd=Bd.has(nd);if(Ad instanceof Array||Cd){if(Cd&&Cd.name()){Dd=true;yd.startElement("",Cd.name());}Bd=Bd.filter(md);for(Ed=0;Ed<Ad.length;++Ed){Fd=Ad[Ed];Gd=od(Bd,Fd);if(Gd&&Gd.name()){Hd=Gd.name();}else{Hd="item";}sd(Fd,yd,Hd);}if(Dd){yd.endElement();}return;}Cd=Bd.has(md);if(Cd&&Cd.name()){Hd=Cd.name();}sd(Ad,yd,Hd);},rd=function(wd,xd,yd,zd){var Ad,Bd,Cd,Dd,Ed,Fd=0,Gd=0,Hd;for(Bd in wd.constructor.prototype){Cd=wd[Bd];if(Cd instanceof Date){Cd=gpf.dateToComparableFormat(Cd,true);}Dd=typeof Cd;if("function"===Dd){continue;}Ad=zd.member(Bd);if(Ad.has(jd)){continue;}Ed=pd(Bd,Cd,Dd,Ad);if(Ed){if(0===Gd){Gd={};}Gd[Ed]=Cd.toString();}else{if(0===Fd){Fd=[];}Fd.push(Bd);}}xd.startElement("",yd,yd,Gd);if(Fd){for(Hd=0;Hd<Fd.length;++Hd){qd(wd,Fd[Hd],xd,zd);}}},sd=function(wd,xd,yd){var zd=new gd.Map(wd).filter(id),Ad;if(!yd){Ad=zd.member("Class").has(md);if(Ad){yd=Ad.name();}else{yd=gpf.classDef(wd.constructor).name();if(!yd){yd="object";}}}if("object"!==typeof wd){xd.startElement("",yd);xd.characters(gpf.value(wd,""));}else{rd(wd,xd,yd,zd);}xd.endElement();},td=function(wd,xd){var yd=gpf.interfaces.wrap(fd.IXmlContentHandler),zd=new yd(wd);zd.$catch(xd).$finally(xd,"ready");sd(this,zd);},ud=gpf.define("FromXmlContentHandler",{"[Class]":[gpf.$InterfaceImplement(fd.IXmlContentHandler)],_target:null,_firstElement:true,_forward:[],constructor:function(wd){this._target=wd;this._firstElement=true;this._forward=[];},_fillFromAttributes:function(wd){var xd=new gd.Map(this._target),yd=this._target.constructor.prototype,zd,Ad,Bd;for(zd in yd){if("function"===typeof yd[zd]){continue;}Ad=xd.member(zd).filter(kd);if(0<Ad.length()){gpf.ASSERT(Ad.length()===1,"Expected one attribute only");Bd=Ad.get(0).name();}else{if(zd.charAt(0)==="_"){Bd=zd.substr(1);}else{continue;}}if(Bd in wd){this._target[zd]=gpf.value(wd[Bd],yd[zd]);}}},_fillFromElement:function(wd,xd,yd,zd){var Ad=new gd.Map(this._target).filter(ld),Bd=this._forward[0],Cd,Dd,Ed,Fd,Gd,Hd;gpf.interfaces.ignoreParameter(wd);gpf.interfaces.ignoreParameter(yd);gpf.interfaces.ignoreParameter(zd);if(undefined===Bd){Cd=Ad.members();}else{gpf.ASSERT(Bd.type!==0,"No content handler here");Cd=[Bd.member];}for(Dd=0;Dd<Cd.length;++Dd){Ed=Cd[Dd];Fd=Ad.member(Ed);for(Gd=0;Gd<Fd.length();++Gd){Hd=Fd.get(Gd);if(Hd.name()===xd){if(this._fillFromRawElement(Ed,Hd)){return;}}}}},_fillFromRawElement:function(wd,xd){var yd,zd;if(xd instanceof md){if(xd.objClass()){yd=new(xd.objClass());this._target[wd]=yd;zd=fd.query(yd,fd.IXmlContentHandler);}if(zd){zd={type:0,iXCH:zd};}else{zd={type:1,member:wd,buffer:[]};}}else if(xd instanceof nd){this._target[wd]=[];zd={type:2,member:wd};}if(zd){zd.depth=1;this._forward.unshift(zd);return true;}else{return false;}},characters:function(wd,xd){var yd=this._forward[0];if(undefined!==yd){if(0===yd.type){yd.iXCH.characters.apply(yd.iXCH,arguments);}else if(1===yd.type){yd.buffer.push(wd);}}hd.apply(this,["ready",xd]);},endDocument:function(wd){hd.apply(this,["ready",wd]);},endElement:function(wd){var xd=this._forward[0],yd,zd;if(undefined!==xd){if(0===xd.type){xd.iXCH.endElement.apply(xd.iXCH,arguments);}else if(1===xd.type){yd=this._target[xd.member];zd=xd.buffer.join("");if(yd instanceof Array){yd.push(zd);}else{this._target[xd.member]=gpf.value(zd,yd);}}if(0===--xd.depth){this._forward.shift();}}hd.apply(this,["ready",wd]);},endPrefixMapping:function(wd){fd.ignoreParameter(wd);},ignorableWhitespace:function(wd,xd){fd.ignoreParameter(wd);hd.apply(this,["ready",xd]);},processingInstruction:function(wd,xd,yd){fd.ignoreParameter(wd);fd.ignoreParameter(xd);hd.apply(this,["ready",yd]);},setDocumentLocator:function(wd){fd.ignoreParameter(wd);},skippedEntity:function(wd){fd.ignoreParameter(wd);},startDocument:function(wd){hd.apply(this,["ready",wd]);},startElement:function(wd,xd,yd,zd,Ad){var Bd=this._forward[0];gpf.interfaces.ignoreParameter(wd);gpf.interfaces.ignoreParameter(xd);gpf.interfaces.ignoreParameter(yd);if(undefined!==Bd){if(0===Bd.type){++Bd.depth;Bd.iXCH.startElement.apply(Bd.iXCH,arguments);}else{this._fillFromElement.apply(this,arguments);}}else if(this._firstElement){this._firstElement=false;this._fillFromAttributes(zd);}else{this._fillFromElement.apply(this,arguments);}hd.apply(this,["ready",Ad]);},startPrefixMapping:function(wd,xd){fd.ignoreParameter(wd);fd.ignoreParameter(xd);}}),vd=function(wd){return new ud(wd);};gpf.define("gpf.xml.Writer",{"[Class]":[gpf.$InterfaceImplement(fd.IXmlContentHandler)],private:{_stream:null,_branch:[],_pendingPrefixMappings:[],_buffer:[],_eventsHandler:null,_closeLeafForContent:function(){var wd;if(this._branch.length){wd=this._branch[this._branch.length-1];if(!wd.hasContent){this._buffer.push(">");wd.hasContent=true;}}},_flush:function(wd){this._eventsHandler=wd;this._flushed();},_flushed:function(wd){var xd;if(wd&&wd.type()===fd.IWritableStream.EVENT_ERROR){hd.apply(this,[wd,this._eventsHandler]);}else if(0===this._buffer.length){xd=this._eventsHandler;this._eventsHandler=null;hd.apply(this,[fd.IWritableStream.EVENT_READY,xd]);}else{this._stream.write(this._buffer.shift(),gpf.Callback.bind(this,"_flushed"));}}},public:{constructor:function(wd){this._stream=fd.query(wd,fd.IWritableStream,true);this._branch=[];this._pendingPrefixMappings=[];this._buffer=[];},characters:function(wd,xd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");this._closeLeafForContent();this._buffer.push(wd);this._flush(xd);},endDocument:function(wd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");this._flush(wd);},endElement:function(wd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");var xd=this._branch.pop();if(xd.hasContent){this._buffer.push("</",xd.qName,">");}else{this._buffer.push("/>");}this._flush(wd);},endPrefixMapping:function(wd){gpf.interfaces.ignoreParameter(wd);},ignorableWhitespace:function(wd,xd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");this._closeLeafForContent();this._buffer.push(wd);this._flush(xd);},processingInstruction:function(wd,xd,yd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");this._buffer.push("<?",wd," ",gpf.escapeFor(xd,"xml"),"?>");this._flush(yd);},setDocumentLocator:function(wd){gpf.interfaces.ignoreParameter(wd);},skippedEntity:function(wd){gpf.interfaces.ignoreParameter(wd);},startDocument:function(wd){gpf.ASSERT(null===this._eventsHandler,"Write in progress");this._flush(wd);},startElement:function(wd,xd,yd,zd,Ad){gpf.ASSERT(null===this._eventsHandler,"Write in progress");var Bd,Cd,Dd,Ed;if(undefined===yd&&!wd){yd=xd;}this._closeLeafForContent();var Fd={hasContent:false,qName:yd};this._branch.push(Fd);this._buffer.push("<",yd);if(zd){for(Bd in zd){if(zd.hasOwnProperty(Bd)){this._buffer.push(" ",Bd,"=\"");Cd=gpf.escapeFor(zd[Bd].toString(),"xml");if(-1<Cd.indexOf("\"")){Cd=gpf.replaceEx(Cd,{"\"":"&quot;"});}this._buffer.push(Cd,"\"");}}}Dd=this._pendingPrefixMappings.length;if(Dd){for(Ed=0;Ed<Dd;++Ed){this._buffer.push(" ",this._pendingPrefixMappings[Ed]);}this._pendingPrefixMappings=[];}this._flush(Ad);},startPrefixMapping:function(wd,xd){this._pendingPrefixMappings.push(["xmlns:",wd,":\"",gpf.escapeFor(xd,"xml"),"\""].join(""));}}});gpf.xml.convert=function(wd,xd,yd){var zd;if("string"===typeof wd){throw gpf.Error.NotImplemented();}else if("object"===typeof wd){zd=fd.query(wd,fd.IXmlSerializable);if(null===zd){zd=new gpf.xml.ConstNode(wd);}zd.toXml(xd,yd);}};var wd=gpf._alpha+gpf._ALPHA+"_",xd=wd+"012345789.-";gpf.extend(gpf.xml,{isValidName:function(yd){var zd;if(0===yd.length||-1===wd.indexOf(yd.charAt(0))){return false;}for(zd=1;zd<yd.length;++zd){if(-1===xd.indexOf(yd.charAt(zd))){return false;}}return true;},toValidName:function(yd){var zd;if(gpf.xml.isValidName(yd)){return yd;}zd="_"+yd;if(!gpf.xml.isValidName(zd)){throw gpf.Error.XmlInvalidName();}return zd;}});var zd=gpf.interfaces;gpf.extend(gpf.xml,{NODE_INVALID:0,NODE_ELEMENT:1,NODE_ATTRIBUTE:2,NODE_TEXT:3,NODE_ENTITY_REFERENCE:5,NODE_PROCESSING_INSTRUCTION:7,NODE_COMMENT:8,NODE_DOCUMENT:9});gpf._defIntrf("IXmlConstNode",{attributes:function(Ad){gpf.interfaces.ignoreParameter(Ad);return"";},children:function(Ad){if(undefined===Ad){return[];}else{return undefined;}},localName:function(){return"";},namespaceURI:function(){return"";},nextSibling:function(){return null;},nodeName:function(){return"";},nodeType:function(){return 0;},nodeValue:function(){return null;},ownerDocument:function(){return null;},parentNode:function(){return null;},prefix:function(){return"";},previousSibling:function(){return null;},textContent:function(){return"";}});gpf.define("gpf.xml.ConstNode",{"[Class]":[gpf.$InterfaceImplement(zd.IXmlConstNode),gpf.$InterfaceImplement(zd.IXmlSerializable)],_obj:null,_name:"",_parentNode:null,_attributes:{},_elements:{},_children:[],constructor:function(Ad,Bd){this._obj=Ad;this._attributes=null;this._elements=null;this._children=null;if(undefined===Bd){this._name="root";}else{this._name=Bd;}},_members:function(){var Ad,Bd,Cd;this._attributes={};this._elements={};if("object"===typeof this._obj&&!(this._obj instanceof Array)){for(Ad in this._obj){if(this._obj.hasOwnProperty(Ad)){Bd=this._obj[Ad];if(null===Bd){continue;}Cd=gpf.xml.toValidName(Ad);if("object"===typeof Bd){this._elements[Ad]=Cd;}else{this._attributes[Ad]=Cd;}}}}},attributes:function(Ad){var Bd,Cd,Dd;if(null===this._attributes){this._members();}if(undefined===Ad){Bd={};for(Cd in this._attributes){if(this._attributes.hasOwnProperty(Cd)){Dd=this._attributes[Cd];Bd[Dd]=this._obj[Cd];}}return Bd;}for(Cd in this._attributes){if(this._attributes.hasOwnProperty(Cd)){if(Ad===this._attributes[Cd]){return this._obj[Cd];}}}return undefined;},children:function(Ad){var Bd,Cd,Dd,Ed;if(null===this._children){if(null===this._elements){this._members();}this._children=[];if(this._obj instanceof Array){for(Bd=0;Bd<this._obj.length;++Bd){Cd=new gpf.xml.ConstNode(this._obj[Bd],"item");Cd._parentNode=this;this._children.push(Cd);}}else{for(Dd in this._elements){if(this._elements.hasOwnProperty(Dd)){Ed=this._elements[Dd];Cd=new gpf.xml.ConstNode(this._obj[Dd],Ed);Cd._parentNode=this;this._children.push(Cd);}}}}return gpf.arrayOrItem(this._children,Ad);},localName:function(){return this._name;},namespaceURI:function(){return"";},nextSibling:function(){var Ad;if(null!==this._parentNode){Ad=gpf.test(this._parentNode._children,this);if(undefined!==Ad&&Ad<this._parentNode._children.length-1){return this._parentNode._children[Ad+1];}}return null;},nodeName:function(){return this._name;},nodeType:function(){return gpf.xml.NODE_ELEMENT;},nodeValue:function(){return this._obj;},ownerDocument:function(){return null;},parentNode:function(){return this._parentNode;},prefix:function(){return"";},previousSibling:function(){var Ad;if(null!==this._parentNode){Ad=gpf.test(this._parentNode._children,this);if(0<Ad){return this._parentNode._children[Ad-1];}}return null;},textContent:function(){if("object"!==typeof this._obj){return gpf.value(this._obj,"");}else{return"";}},toXml:function(Ad,Bd){gpf.xml.nodeToXml(this,Ad,Bd);}});function yd(Ad,Bd){var Cd=Ad.localName(),Dd=Ad.attributes(),Ed=Ad.children(),Fd=Ad.textContent(),Gd;Bd.startElement("",Cd,Cd,Dd);if(Fd){Bd.characters(Fd);}else{for(Gd=0;Gd<Ed.length;++Gd){yd(Ed[Gd],Bd);}}Bd.endElement();}gpf.xml.nodeToXml=function(Ad,Bd,Cd){var Dd=gpf.interfaces.wrap(zd.IXmlContentHandler),Ed=new Dd(Bd);Ed.$catch(Cd).$finally(Cd,"ready");yd(Ad,Ed);};function Ad(Gd,Hd,Id,Jd){var Kd,Ld;for(Kd=0;Kd<Gd.length;++Kd){Ld=Gd[Kd];Hd(Ld,Id,Jd);}}function Bd(Gd,Hd,Id){var Jd=Gd.children(),Kd,Ld,Md;for(Ld=0;Ld<Jd.length;++Ld){Md=true;Kd=Jd[Ld];if(Hd.name&&Kd.localName()!==Hd.name){Md=false;}else if(Hd.text&&Kd.textContent()!==Hd.text){Md=false;}if(Md){Id.push(Kd);}if(undefined!==Hd.relative&&!Hd.relative){Bd(Kd,Hd,Id);}}}function Cd(Gd,Hd,Id){var Jd,Kd,Ld;if(Hd.name){Ld=Gd.attributes(Hd.name);if(undefined!==Ld&&(!Hd.text||Ld===Hd.text)){Id.push(Gd);}}else{Jd=Gd.attributes();for(Kd in Jd){if(Jd.hasOwnProperty(Kd)){Ld=Jd[Kd];if(!Hd.text||Ld===Hd.text){Id.push(Gd);break;}}}}}function Dd(Gd,Hd,Id){if(gpf.xml.NODE_ELEMENT===Hd.type){Ad(Gd,Bd,Hd,Id);}else if(gpf.xml.NODE_ATTRIBUTE===Hd.type){Ad(Gd,Cd,Hd,Id);}}function Ed(Gd,Hd,Id){var Jd,Kd,Ld,Md,Nd;if(Hd.and){Kd=Hd.and;Ld=0;}else if(Hd.or){Kd=Hd.or;Ld=1;}for(Md=0;Md<Kd.length;++Md){Nd=Kd[Md];if(Nd.and||Nd.or){Jd=[];Ed(Gd,Nd,Jd);}else{Jd=Fd(Gd,Nd);}if(0===Ld&&Jd.length===0){return;}if(1===Ld&&Jd.length!==0){Id.push(Gd);return;}}if(0===Ld){Id.push(Gd);}}function Fd(Gd,Hd){var Id,Jd=[Gd];while(Hd){Id=[];Dd(Jd,Hd,Id);if(0===Id.length){return[];}Jd=Id;if(Hd.filter){Id=[];Ad(Jd,Ed,Hd.filter,Id);if(0===Id.length){return[];}Jd=Id;}Hd=Hd.then;}return Id;}gpf.define("gpf.xml.XPath",{_xpath:null,constructor:function(Gd){this._reset();if("string"===typeof Gd){this._xpath=this._compile(Gd);}else{this._xpath=Gd;}},_reset:function(){},_compile:function(Gd){gpf.interfaces.ignoreParameter(Gd);this._xpath=null;},selectNodes:function(Gd){return Fd(Gd,this._xpath);}});gpf.define("gpf.Parameter",{private:{"[_name]":[gpf.$ClassProperty(),gpf.$XmlAttribute("name")],_name:"","[_description]":[gpf.$ClassProperty(),gpf.$XmlElement("description")],_description:"","[_type]":[gpf.$ClassProperty(),gpf.$XmlAttribute("type")],_type:"string","[_required]":[gpf.$ClassProperty(),gpf.$XmlAttribute("required")],_required:false,"[_defaultValue]":[gpf.$ClassProperty(),gpf.$XmlElement("default")],_defaultValue:undefined,"[_prefix]":[gpf.$ClassProperty(),gpf.$XmlAttribute("prefix")],_prefix:"","[_multiple]":[gpf.$ClassProperty(),gpf.$XmlAttribute("multiple")],_multiple:false,"[_hidden]":[gpf.$ClassProperty(),gpf.$XmlAttribute("hidden")],_hidden:false},public:{},static:{VERBOSE:"verbose",HELP:"help",TYPE_BOOLEAN:"boolean",TYPE_NUMBER:"number",TYPE_STRING:"string",DEFAULTS:{"string":"","boolean":false,"number":0},create:function(Gd){var Hd=[],Id=Gd.length,Jd,Kd;for(Jd=0;Jd<Id;++Jd){Kd=Gd[Jd];if(!(Kd instanceof gpf.Parameter)){Kd=this._createFromObject(Kd);}Hd.push(Kd);}return Hd;},_createFromObject:function(Gd){var Hd=new gpf.Parameter,Id;if(Gd===gpf.Parameter.VERBOSE||Gd.prefix===gpf.Parameter.VERBOSE){Gd={name:"verbose",description:"Enable verbose mode",type:"boolean",defaultValue:false,prefix:gpf.Parameter.VERBOSE};}else if(Gd===gpf.Parameter.HELP||Gd.prefix===gpf.Parameter.HELP){Gd={name:"help",description:"Display help",type:"boolean",defaultValue:false,prefix:gpf.Parameter.HELP};}gpf.json.load(Hd,Gd);if(!Hd._name){throw gpf.Error.ParamsNameRequired();}if(!Hd._multiple){Id=this.DEFAULTS[Hd._type];if(undefined===Id){throw gpf.Error.ParamsTypeUnknown();}if(Hd.hasOwnProperty("_defaultValue")){Hd._defaultValue=gpf.value(Hd._defaultValue,Id,Hd._type);}}return Hd;},getOnPrefix:function(Gd,Hd){var Id,Jd,Kd;if(undefined===Hd){Hd=0;}Id=Gd.length;if("number"===typeof Hd){Jd=Hd;Hd="";}else{Jd=0;}for(;Jd<Id;++Jd){Kd=Gd[Jd];if(Kd._prefix===Hd){return Kd;}}return null;},getByName:function(Gd,Hd){var Id,Jd,Kd;Id=Gd.length;for(Jd=0;Jd<Id;++Jd){Kd=Gd[Jd];if(Kd._name===Hd){return Kd;}}return null;},parse:function(Gd,Hd){var Id={},Jd,Kd,Ld,Md,Nd,Od=0;Gd=gpf.Parameter.create(Gd);Jd=Hd.length;for(Kd=0;Kd<Jd;++Kd){Ld=this.getPrefixValuePair(Hd[Kd]);if(Ld instanceof Array){Md=this.getOnPrefix(Gd,Ld[0]);Ld=Ld[1];}else{Md=this.getOnPrefix(Gd,Od);Od=Gd.indexOf(Md)+1;}if(!Md){continue;}if(undefined===Ld){if("boolean"===Md._type){Ld=!Md._defaultValue;}else{continue;}}Ld=gpf.value(Ld,Md._defaultValue,Md._type);Nd=Md._name;if(Md._multiple){if(undefined===Id[Nd]){Id[Nd]=[];}Id[Nd].push(Ld);if(Md._prefix===""){--Od;}}else{Id[Nd]=Ld;}}this._finalizeParse(Gd,Id);return Id;},_finalizeParse:function(Gd,Hd){var Id,Jd,Kd,Ld,Md;Id=Gd.length;for(Jd=0;Jd<Id;++Jd){Kd=Gd[Jd];Ld=Kd._name;if(undefined===Hd[Ld]){if(Kd._required){throw gpf.Error.ParamsRequiredMissing({name:Ld});}Md=Kd._defaultValue;if(undefined!==Md){if(Kd._multiple){Md=[Md];}Hd[Ld]=Md;}else if(Kd._multiple){Hd[Ld]=[];}}}},getPrefixValuePair:function(Gd){var Hd;if(Gd.charAt(0)==="-"){Gd=Gd.substr(1);Hd=Gd.indexOf(":");if(-1<Hd){return[Gd.substr(0,Hd),Gd.substr(Hd+1)];}else{return[Gd];}}Hd=Gd.indexOf("=");if(-1<Hd){return[Gd.substr(0,Hd),Gd.substr(Hd+1)];}return Gd;},usage:function(Gd){gpf.interface.ignoreParameter(Gd);return"";}}});gpf.fs={TYPE_NOT_FOUND:0,TYPE_FILE:1,TYPE_DIRECTORY:2,TYPE_UNKNOWN:99,getInfo:function(Gd,Hd){gpf.interfaces.ignoreParameter(Gd);gpf.interfaces.ignoreParameter(Hd);throw gpf.Error.Abstract();},readAsBinaryStream:function(Gd,Hd){gpf.interfaces.ignoreParameter(Gd);gpf.interfaces.ignoreParameter(Hd);throw gpf.Error.Abstract();},writeAsBinaryStream:function(Gd,Hd){gpf.interfaces.ignoreParameter(Gd);gpf.interfaces.ignoreParameter(Hd);throw gpf.Error.Abstract();},close:function(Gd){gpf.interfaces.ignoreParameter(Gd);throw gpf.Error.Abstract();}};if(gpf.node){var Gd,Hd=function(){if(undefined===Gd){Gd=require("fs");}return Gd;},Id=function(Jd,Kd){gpf.events.fire("error",{error:Jd},Kd);};gpf.fs.getInfo=function(Jd,Kd){Hd().exists(Jd,function(Ld){if(Ld){Hd().stat(Jd,function(Md,Nd){var Od;if(Md){Id(Md,Kd);}else{Od={size:Nd.size,createdDateTime:Nd.ctime,modifiedDateTime:Nd.mtime};if(Nd.isDirectory()){Od.type=gpf.fs.TYPE_DIRECTORY;}else if(Nd.isFile()){Od.type=gpf.fs.TYPE_FILE;}else{Od.type=gpf.fs.TYPE_UNKNOWN;}gpf.events.fire("ready",{info:Od},Kd);}});}else{gpf.events.fire("ready",{info:{type:gpf.fs.TYPE_NOT_FOUND}},Kd);}});};gpf.fs.readAsBinaryStream=function(Jd,Kd){var Ld=Hd().createReadStream(Jd);gpf.events.fire("ready",{stream:new gpf.node.ReadableStream(Ld)},Kd);};gpf.fs.writeAsBinaryStream=function(Jd,Kd){var Ld=Hd().createWriteStream(Jd);gpf.events.fire("ready",{stream:new gpf.node.WritableStream(Ld)},Kd);};gpf.fs.close=function(Jd){gpf.interfaces.ignoreParameter(Jd);};}gpf.html={ELEMENT_NODE:1,TEXT_NODE:3};var Vd=gpf.interfaces,Wd=gpf.events.fire;gpf.define("gpf.html.MarkdownParser","gpf.Parser",{public:{constructor:function(){this._super.apply(this,arguments);this._openedTags=[];}},protected:{_ignoreCarriageReturn:true,_initialParserState:function(Xd){var Yd,Zd=0<this._openedTags.length;if("#"===Xd){this._hLevel=1;Yd=this._parseTitle;}else if("*"===Xd||"0"<=Xd&&"9">=Xd){if(Xd!=="*"){this._numericList=1;}else{this._numericList=0;}Yd=this._parseList;Zd=false;}else if(" "!==Xd&&"\t"!==Xd&&"\n"!==Xd){if(Zd){this._output(" ");Zd=false;}else{this._openTag("p");}Yd=this._parseContent(Xd);if(!Yd){Yd=this._parseContent;}}if(Zd){this._closeTags();}return Yd;},_finalizeParserState:function(){this._closeTags();}},private:{_openedTags:[],_closeTags:function(){var Xd;while(this._openedTags.length){Xd=this._openedTags.pop();this._output("</"+Xd+">");if("p"===Xd){break;}}},_openList:function(Xd){var Yd,Zd=this._openedTags.length;while(Zd){Yd=this._openedTags.pop();--Zd;this._output("</"+Yd+">");if("li"===Yd){break;}}if(Zd){Yd=this._openedTags[Zd-1];if(Yd!==Xd){this._openedTags.pop();this._output("</"+Yd+">");}else{return;}}this._openTag(Xd);},_toggleTag:function(Xd){var Yd=this._openedTags.length;if(Yd&&this._openedTags[Yd-1]===Xd){this._openedTags.pop();this._output("</"+Xd+">");}else{this._openTag(Xd);}},_openTag:function(Xd){this._output("<"+Xd+">");this._openedTags.push(Xd);},_hLevel:1,_parseTitle:function(Xd){if("#"===Xd){++this._hLevel;}else{this._openTag("h"+this._hLevel);return this._parseText;}},_numericList:false,_parseList:function(Xd){var Yd=0<this._openedTags.length,Zd;if(" "===Xd){if(this._numericList){Zd="ol";}else{Zd="ul";}this._openList(Zd);this._openTag("li");}else if(this._numericList&&("0"<=Xd&&"9">=Xd||"."===Xd)){return;}else if("*"===Xd){if(Yd){this._output(" ");}this._openTag("strong");}return this._parseContent;},_handleEntities:function(Xd){if("<"===Xd){this._output("&lt;");}else if(">"===Xd){this._output("&gt;");}else if("&"===Xd){this._output("&amp;");}else{return false;}return true;},_escapeChar:"",_escapeCount:0,_parseEscape:function(Xd){var Yd=this._escapeChar,Zd;if(Xd===Yd){Zd=++this._escapeCount;if("-"===Yd&&3===Zd){this._output("&mdash;");return this._parseContent;}}else{Zd=this._escapeCount+1;while(--Zd){this._output(Yd);}this._setParserState(this._parseContent);return this._parseContent(Xd);}},_parseContent:function(Xd){if(this._handleEntities(Xd)){return;}if("*"===Xd){return this._parseItalic;}else if("`"===Xd){this._toggleTag("code");return this._parseMonospace;}else if("["===Xd){return this._startLink(0);}else if("!"===Xd){return this._parseImage;}else if("-"===Xd){this._escapeCount=1;this._escapeChar="-";return this._parseEscape;}else if("\n"===Xd){return null;}else{this._output(Xd);}},_parseItalic:function(Xd){if("*"===Xd){this._toggleTag("strong");}else{this._toggleTag("em");this._output(Xd);}return this._parseContent;},_parseText:function(Xd){if(this._handleEntities(Xd)){return;}if("\n"===Xd){this._closeTags();return null;}else{this._output(Xd);}},_parseMonospace:function(Xd){if("`"===Xd){this._toggleTag("code");return this._parseContent;}else{this._output(Xd);}},_linkType:0,_linkState:0,_linkText:[],_linkUrl:[],_startLink:function(Xd){this._linkType=Xd;this._linkState=0;this._linkText=[];this._linkUrl=[];return this._parseLink;},_finishLink:function(){var Xd=this._linkUrl.join(""),Yd=this._linkText.join("");if(0===this._linkType){this._output("<a href=\"");this._output(Xd);this._output("\">");this._output(Yd);this._output("</a>");}else if(1===this._linkType){this._output("<img src=\"");this._output(Xd);this._output("\" alt=\"");this._output(Yd);this._output("\" title=\"");this._output(Yd);this._output("\">");}return this._parseContent;},_parseLink:function(Xd){var Yd=this._linkState;if("]"===Xd&&0===Yd){++this._linkState;}else if("("===Xd&&1===Yd){++this._linkState;}else if(")"===Xd&&2===Yd){return this._finishLink();}else if(0===Yd){this._linkText.push(Xd);}else if(2===Yd){if(-1==="\t\n".indexOf(Xd)){this._linkUrl.push(Xd);}}},_parseImage:function(Xd){if("["===Xd){return this._startLink(1);}else{this._output("!");this._setParserState(this._parseContent);return this._parseContent(Xd);}}}});gpf.define("gpf.html.File",{"[Class]":[gpf.$InterfaceImplement(gpf.interfaces.ITextStream)],public:{constructor:function(Xd){this._file=Xd;},name:function(){return this._file.name;},size:function(){return this._file.size;},read:function(Xd,Yd){var Zd=this,ae=this._reader,be=this._file.size-this._pos,ce;if(0===be){Wd.apply(this,[Vd.IReadableStream.EVENT_END_OF_STREAM,Yd]);return;}this._eventsHandler=Yd;if(null===ae){ae=this._reader=new FileReader;ae.onloadend=function(de){Zd._onLoadEnd(de);};}if(0===Xd||Xd>be){Xd=be;}ce=this._file.slice(this._pos,Xd);this._pos+=Xd;ae.readAsArrayBuffer(ce);}},private:{_file:null,_reader:null,_pos:0,_eventsHandler:null,_onLoadEnd:function(Xd){var Yd=Xd.target,Zd,ae,be,ce;gpf.ASSERT(Yd===this._reader,"Unexpected change of reader");if(Yd.error){Wd.apply(this,[Vd.IReadableStream.ERROR,{error:{name:Yd.error.name,message:Yd.error.message}},this._eventsHandler]);}else if(Yd.readyState===FileReader.DONE){Zd=new Int8Array(Yd.result);ae=Zd.length;be=[];for(ce=0;ce<ae;++ce){be.push(Zd[ce]);}Wd.apply(this,[Vd.IReadableStream.EVENT_DATA,{buffer:be},this._eventsHandler]);}}}});var Xd=gpf._defAttr("HtmlAttribute",{}),Yd=gpf._defAttr("$HtmlHandler",Xd,{private:{_selector:"",_globalSelector:false},protected:{_select:function(ae){var be=this._selector;if(be){if(this._globalSelector){return document.querySelector(be);}else{return ae.querySelector(be);}}return undefined;}},public:{constructor:function(ae,be){if(ae){this._selector=ae;}if(undefined!==be){this._globalSelector=be===true;}}}}),Zd=gpf._defAttr("$HtmlEvent",Yd,{private:{_event:""},public:{constructor:function(ae,be,ce){Yd.apply(this,[be,ce]);this._event=ae;}}});function Jd(ae,be){var ce;if(1!==be.length()){throw gpf.Error.HtmlHandlerMultiplicityError({member:ae});}ce=be.get(0);if(!(ce instanceof Zd)){return ce;}return null;}function Kd(ae,be){var ce=Jd(ae,be);if(ce&&!ce._selector){return ce;}}gpf.html.handle=function(ae,be){var ce=new gpf.attributes.Map(ae).filter(Xd),de=ce.filter(Yd),ee,fe;if(0===de.count()){throw gpf.Error.HtmlHandlerMissing();}ee=de.each(Kd);if(undefined===ee){throw gpf.Error.HtmlHandlerNoDefault();}ee=ee.member();if(undefined===be){be=ae[ee];gpf.ASSERT(be,"Handle not previously set");}else{if("string"===typeof be){be=document.querySelector(be);}gpf.ASSERT(be,"Selector does not resolve to DOM");if(!be){return;}ae[ee]=be;}de.each(Ld,ae,[be]);fe=ce.filter(Zd);if(0<fe.count()){fe.each(Md,ae,[be]);}return be;};function Ld(ae,be,ce){var de=Jd(ae,be);if(!de||!de._selector){return;}ce=de._select(ce);if(!ce){return;}this[ae]=ce;}function Md(ae,be,ce){be.each(Nd,this,[ae,ce]);}function Nd(ae,be,ce){var de=ae._event,ee=be+":$HtmlEvent("+de+","+ae._selector+")";ce=ae._select(ce);if(!ce){return;}if(!this[ee]){ce.addEventListener(de,gpf.Callback.bind(this,be));this[ee]=true;}}gpf.extend(gpf.html,{hasClass:function(ae,be){var ce,de,ee;if("string"===typeof be){be=[be];}gpf.ASSERT(be instanceof Array,"Expected array");ce=ae.className.split(" ");de=be.length;for(ee=0;ee<de;++ee){if(undefined!==gpf.test(ce,be[ee])){return true;}}return false;},alterClass:function(ae,be,ce){var de,ee,fe,ge;if(ae.className){de=ae.className.split(" ");}else{de=[];}ee=de.length;if(undefined!==ce){if("string"===typeof ce){ce=[ce];}gpf.ASSERT(ce instanceof Array,"Expected array");fe=ce.length;for(ge=0;ge<fe;++ge){gpf.clear(de,ce[ge]);}}if(undefined!==be){if("string"===typeof be){be=[be];}gpf.ASSERT(be instanceof Array,"Expected array");fe=be.length;for(ge=0;ge<fe;++ge){gpf.set(de,be[ge]);}}if(ee!==de.length){ae.className=de.join(" ");}return ae;},addClass:function(ae,be){return gpf.html.alterClass(ae,be,undefined);},removeClass:function(ae,be){return gpf.html.alterClass(ae,undefined,be);}});var ae=null,be=null,ce=false,de,ee,fe,ge="";function Od(){var he=[];if(ce){he.push(".gpf-top { top: ",fe,"px; }\n");}be.innerHTML=he.join("");}function Pd(){de=window.innerWidth;ee=window.innerHeight;var he,ie=false,je=[],ke=[];if(de>ee){he="gpf-landscape";}else{he="gpf-portrait";}if(ge!==he){je.push(ge);ge=he;ke.push(he);ie=true;}gpf.html.alterClass(document.body,ke,je);ae.broadcastEvent("resize",{width:de,height:ee});if(ie){ae.broadcastEvent("rotate",{orientation:he});}}function Qd(){fe=window.scrollY;if(ce&&be){Od();}ae.broadcastEvent("scroll",{top:fe});}function Rd(){Pd();Qd();}gpf.html.responsive=function(he){var ie,je;if(he&&undefined!==he.monitorTop){ce=he.monitorTop;}ie=ce;if(ie){if(!be){je=document.getElementsByTagName("head")[0]||document.documentElement;be=document.createElement("style");be.setAttribute("type","text/css");be=je.appendChild(be);}}else if(be){be.parentNode.removeChild(be);be=null;}if(null===ae){ae=new gpf.events.Broadcaster(["resize","rotate","scroll"]);window.addEventListener("resize",Pd);window.addEventListener("scroll",Qd);gpf.defer(Rd,0);}return ae;};var he=[];function Sd(){var ie=document.getElementsByTagName("script"),je=ie.length,ke,le,me;for(ke=0;ke<je;++ke){le=ie[ke];me=le.getAttribute("gpf-loaded");if(me){le.removeAttribute("gpf-loaded");me=me.split(",");je=me.length;for(ke=0;ke<je;++ke){he.push(me[ke]);}}}if(he.length){Ud();}}function Td(ie){console.error("gpf-loaded: failed to include '"+ie.get("url")+"'");}function Ud(){if(!he.length){return;}var ie=he.shift();gpf.http.include(ie,{load:Ud,error:Td});}if("browser"===gpf.host()||"phantomjs"===gpf.host()){Sd();}function ie(je){var ke,le;if(je instanceof Array){je=gpf.Parameter.parse([{name:"port",type:"number",defaultValue:80,prefix:"port"},{name:"root",type:"string",defaultValue:".",prefix:"root"},{name:"chunkSize",type:"number",defaultValue:65536,prefix:"chunk"},gpf.Parameter.VERBOSE,gpf.Parameter.HELP],je);}console.log("GPF "+gpf.version()+" web server");if(je.root==="."){je.root=process.cwd();}if(je.verbose){le=0;for(ke in je){if(je.hasOwnProperty(ke)){if(ke.length>le){le=ke.length;}}}++le;for(ke in je){if(je.hasOwnProperty(ke)){console.log(["\t",ke,new Array(le-ke.length+1).join(" "),": ",je[ke]].join(""));}}}return je;}var je=null,ke=null,le=null,me=null,ne,oe=gpf.define("ResponseHandler",{private:{_options:null,_request:null,_response:null,_parsedUrl:null,_filePath:"",_extName:"",_startTimeStamp:null},public:{constructor:function(pe,qe,re){this._startTimeStamp=new Date;this._options=pe;this._request=qe;this._response=re;this._parsedUrl=ke.parse(qe.url);this._filePath=le.join(this._options.root,this._parsedUrl.pathname);this._extName=le.extname(this._filePath).toLowerCase();re._gpf=this;re.plain=oe._plain;},process:function(){if(me.existsSync(this._filePath)){if(".jsp"===this._extName){this.plain(500,"JSP not handled yet");}else{this.fromFile(this._filePath);}}else{this.plain(404,"No file found");}},plain:function(pe,qe){var re=this._response;re.writeHead(pe,{"Content-Type":"text/plain"});re.write(["port    : "+this._options.port,"method  : "+this._request.method,"url     : "+this._request.url,"root    : "+this._options.root,"path    : "+this._filePath,"headers : "+JSON.stringify(this._request.headers,null,"\t\t"),qe].join("\n"));re.end();},fromFile:function(pe){var qe=this,re=le.extname(pe).toLowerCase(),se,te;me.stat(pe,function(ue,ve){var we;if(ue){qe._response.plain(500,"Unable to access file ("+ue+")");return;}if(ve.isDirectory()){qe._response.plain(200,"Directory.");return;}else if(!ve.isFile()){qe._response.plain(200,"Not a file.");return;}se=ve.size;we=gpf.http.getMimeType(re);if(qe._options.verbose){console.log("\tMime type  : "+we);console.log("\tFile size  : "+se);}qe._response.writeHead(200,{"content-type":we,"content-length":se});te=me.createReadStream(pe);te.on("end",function(){if(qe._options.verbose){console.log("\tEnd      t+: "+(new Date-qe._startTimeStamp)+"ms");}qe._response.statusCode=200;qe._response.end();});te.pipe(qe._response);});}},static:{_plain:function(pe,qe){return this._gpf.plain(pe,qe);},_fromFile:function(pe){return this._gpf.fromFile(pe);}}});gpf.runWebServer=function(pe){pe=ie(pe);global.require=require;je=require("http");ke=require("url");le=require("path");me=require("fs");ne=new Date;je.createServer(function(qe,re){if(pe.verbose){var se=(new Date-ne).toString();console.log([se,"       ".substr(se.length)," ",qe.method,"     ".substr(qe.method.length),qe.url].join(""));}var te=new oe(pe,qe,re);te.process();}).on("close",function(){console.log("Closed.");}).listen(pe.port,function(){if(pe.verbose){console.log("Listening... (CTRL+C to stop)");}});};(function(){var pe,qe;if("nodejs"!==gpf.host()){return;}pe=require("path");qe=pe.basename(process.argv[1],".js");if(qe==="boot"||qe==="gpf"||qe==="gpf-debug"){gpf.runWebServer(process.argv.slice(2));}}());}));