(function(){ var $hxClasses = $hxClasses || {},$estr = function() { return js.Boot.__string_rec(this,''); }; var EReg = $hxClasses["EReg"] = function(r,opt) { opt = opt.split("u").join(""); this.r = new RegExp(r,opt); }; EReg.__name__ = ["EReg"]; EReg.prototype = { customReplace: function(s,f) { var buf = new StringBuf(); while(true) { if(!this.match(s)) break; buf.b += Std.string(this.matchedLeft()); buf.b += Std.string(f(this)); s = this.matchedRight(); } buf.b += Std.string(s); return buf.b; } ,replace: function(s,by) { return s.replace(this.r,by); } ,split: function(s) { var d = "#__delim__#"; return s.replace(this.r,d).split(d); } ,matchedPos: function() { if(this.r.m == null) throw "No string matched"; return { pos : this.r.m.index, len : this.r.m[0].length}; } ,matchedRight: function() { if(this.r.m == null) throw "No string matched"; var sz = this.r.m.index + this.r.m[0].length; return this.r.s.substr(sz,this.r.s.length - sz); } ,matchedLeft: function() { if(this.r.m == null) throw "No string matched"; return this.r.s.substr(0,this.r.m.index); } ,matched: function(n) { return this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) { var $r; throw "EReg::matched"; return $r; }(this)); } ,match: function(s) { if(this.r.global) this.r.lastIndex = 0; this.r.m = this.r.exec(s); this.r.s = s; return this.r.m != null; } ,r: null ,__class__: EReg } var Hash = $hxClasses["Hash"] = function() { this.h = { }; }; Hash.__name__ = ["Hash"]; Hash.prototype = { toString: function() { var s = new StringBuf(); s.b += Std.string("{"); var it = this.keys(); while( it.hasNext() ) { var i = it.next(); s.b += Std.string(i); s.b += Std.string(" => "); s.b += Std.string(Std.string(this.get(i))); if(it.hasNext()) s.b += Std.string(", "); } s.b += Std.string("}"); return s.b; } ,iterator: function() { return { ref : this.h, it : this.keys(), hasNext : function() { return this.it.hasNext(); }, next : function() { var i = this.it.next(); return this.ref["$" + i]; }}; } ,keys: function() { var a = []; for( var key in this.h ) { if(this.h.hasOwnProperty(key)) a.push(key.substr(1)); } return HxOverrides.iter(a); } ,remove: function(key) { key = "$" + key; if(!this.h.hasOwnProperty(key)) return false; delete(this.h[key]); return true; } ,exists: function(key) { return this.h.hasOwnProperty("$" + key); } ,get: function(key) { return this.h["$" + key]; } ,set: function(key,value) { this.h["$" + key] = value; } ,h: null ,__class__: Hash } var HxOverrides = $hxClasses["HxOverrides"] = function() { } HxOverrides.__name__ = ["HxOverrides"]; HxOverrides.dateStr = function(date) { var m = date.getMonth() + 1; var d = date.getDate(); var h = date.getHours(); var mi = date.getMinutes(); var s = date.getSeconds(); return date.getFullYear() + "-" + (m < 10?"0" + m:"" + m) + "-" + (d < 10?"0" + d:"" + d) + " " + (h < 10?"0" + h:"" + h) + ":" + (mi < 10?"0" + mi:"" + mi) + ":" + (s < 10?"0" + s:"" + s); } HxOverrides.strDate = function(s) { switch(s.length) { case 8: var k = s.split(":"); var d = new Date(); d.setTime(0); d.setUTCHours(k[0]); d.setUTCMinutes(k[1]); d.setUTCSeconds(k[2]); return d; case 10: var k = s.split("-"); return new Date(k[0],k[1] - 1,k[2],0,0,0); case 19: var k = s.split(" "); var y = k[0].split("-"); var t = k[1].split(":"); return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]); default: throw "Invalid date format : " + s; } } HxOverrides.cca = function(s,index) { var x = s.charCodeAt(index); if(x != x) return undefined; return x; } HxOverrides.substr = function(s,pos,len) { if(pos != null && pos != 0 && len != null && len < 0) return ""; if(len == null) len = s.length; if(pos < 0) { pos = s.length + pos; if(pos < 0) pos = 0; } else if(len < 0) len = s.length + len - pos; return s.substr(pos,len); } HxOverrides.remove = function(a,obj) { var i = 0; var l = a.length; while(i < l) { if(a[i] == obj) { a.splice(i,1); return true; } i++; } return false; } HxOverrides.iter = function(a) { return { cur : 0, arr : a, hasNext : function() { return this.cur < this.arr.length; }, next : function() { return this.arr[this.cur++]; }}; } var IntHash = $hxClasses["IntHash"] = function() { this.h = { }; }; IntHash.__name__ = ["IntHash"]; IntHash.prototype = { toString: function() { var s = new StringBuf(); s.b += Std.string("{"); var it = this.keys(); while( it.hasNext() ) { var i = it.next(); s.b += Std.string(i); s.b += Std.string(" => "); s.b += Std.string(Std.string(this.get(i))); if(it.hasNext()) s.b += Std.string(", "); } s.b += Std.string("}"); return s.b; } ,iterator: function() { return { ref : this.h, it : this.keys(), hasNext : function() { return this.it.hasNext(); }, next : function() { var i = this.it.next(); return this.ref[i]; }}; } ,keys: function() { var a = []; for( var key in this.h ) { if(this.h.hasOwnProperty(key)) a.push(key | 0); } return HxOverrides.iter(a); } ,remove: function(key) { if(!this.h.hasOwnProperty(key)) return false; delete(this.h[key]); return true; } ,exists: function(key) { return this.h.hasOwnProperty(key); } ,get: function(key) { return this.h[key]; } ,set: function(key,value) { this.h[key] = value; } ,h: null ,__class__: IntHash } var IntIter = $hxClasses["IntIter"] = function(min,max) { this.min = min; this.max = max; }; IntIter.__name__ = ["IntIter"]; IntIter.prototype = { next: function() { return this.min++; } ,hasNext: function() { return this.min < this.max; } ,max: null ,min: null ,__class__: IntIter } var List = $hxClasses["List"] = function() { this.length = 0; }; List.__name__ = ["List"]; List.prototype = { map: function(f) { var b = new List(); var l = this.h; while(l != null) { var v = l[0]; l = l[1]; b.add(f(v)); } return b; } ,filter: function(f) { var l2 = new List(); var l = this.h; while(l != null) { var v = l[0]; l = l[1]; if(f(v)) l2.add(v); } return l2; } ,join: function(sep) { var s = new StringBuf(); var first = true; var l = this.h; while(l != null) { if(first) first = false; else s.b += Std.string(sep); s.b += Std.string(l[0]); l = l[1]; } return s.b; } ,toString: function() { var s = new StringBuf(); var first = true; var l = this.h; s.b += Std.string("{"); while(l != null) { if(first) first = false; else s.b += Std.string(", "); s.b += Std.string(Std.string(l[0])); l = l[1]; } s.b += Std.string("}"); return s.b; } ,iterator: function() { return { h : this.h, hasNext : function() { return this.h != null; }, next : function() { if(this.h == null) return null; var x = this.h[0]; this.h = this.h[1]; return x; }}; } ,remove: function(v) { var prev = null; var l = this.h; while(l != null) { if(l[0] == v) { if(prev == null) this.h = l[1]; else prev[1] = l[1]; if(this.q == l) this.q = prev; this.length--; return true; } prev = l; l = l[1]; } return false; } ,clear: function() { this.h = null; this.q = null; this.length = 0; } ,isEmpty: function() { return this.h == null; } ,pop: function() { if(this.h == null) return null; var x = this.h[0]; this.h = this.h[1]; if(this.h == null) this.q = null; this.length--; return x; } ,last: function() { return this.q == null?null:this.q[0]; } ,first: function() { return this.h == null?null:this.h[0]; } ,push: function(item) { var x = [item,this.h]; this.h = x; if(this.q == null) this.q = x; this.length++; } ,add: function(item) { var x = [item]; if(this.h == null) this.h = x; else this.q[1] = x; this.q = x; this.length++; } ,length: null ,q: null ,h: null ,__class__: List } var Reflect = $hxClasses["Reflect"] = function() { } Reflect.__name__ = ["Reflect"]; Reflect.hasField = function(o,field) { return Object.prototype.hasOwnProperty.call(o,field); } Reflect.field = function(o,field) { var v = null; try { v = o[field]; } catch( e ) { } return v; } Reflect.setField = function(o,field,value) { o[field] = value; } Reflect.getProperty = function(o,field) { var tmp; return o == null?null:o.__properties__ && (tmp = o.__properties__["get_" + field])?o[tmp]():o[field]; } Reflect.setProperty = function(o,field,value) { var tmp; if(o.__properties__ && (tmp = o.__properties__["set_" + field])) o[tmp](value); else o[field] = value; } Reflect.callMethod = function(o,func,args) { return func.apply(o,args); } Reflect.fields = function(o) { var a = []; if(o != null) { var hasOwnProperty = Object.prototype.hasOwnProperty; for( var f in o ) { if(hasOwnProperty.call(o,f)) a.push(f); } } return a; } Reflect.isFunction = function(f) { return typeof(f) == "function" && !(f.__name__ || f.__ename__); } Reflect.compare = function(a,b) { return a == b?0:a > b?1:-1; } Reflect.compareMethods = function(f1,f2) { if(f1 == f2) return true; if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) return false; return f1.scope == f2.scope && f1.method == f2.method && f1.method != null; } Reflect.isObject = function(v) { if(v == null) return false; var t = typeof(v); return t == "string" || t == "object" && !v.__enum__ || t == "function" && (v.__name__ || v.__ename__); } Reflect.deleteField = function(o,f) { if(!Reflect.hasField(o,f)) return false; delete(o[f]); return true; } Reflect.copy = function(o) { var o2 = { }; var _g = 0, _g1 = Reflect.fields(o); while(_g < _g1.length) { var f = _g1[_g]; ++_g; o2[f] = Reflect.field(o,f); } return o2; } Reflect.makeVarArgs = function(f) { return function() { var a = Array.prototype.slice.call(arguments); return f(a); }; } var Std = $hxClasses["Std"] = function() { } Std.__name__ = ["Std"]; Std["is"] = function(v,t) { return js.Boot.__instanceof(v,t); } Std.string = function(s) { return js.Boot.__string_rec(s,""); } Std["int"] = function(x) { return x | 0; } Std.parseInt = function(x) { var v = parseInt(x,10); if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) v = parseInt(x); if(isNaN(v)) return null; return v; } Std.parseFloat = function(x) { return parseFloat(x); } Std.random = function(x) { return Math.floor(Math.random() * x); } var StringBuf = $hxClasses["StringBuf"] = function() { this.b = ""; }; StringBuf.__name__ = ["StringBuf"]; StringBuf.prototype = { toString: function() { return this.b; } ,addSub: function(s,pos,len) { this.b += HxOverrides.substr(s,pos,len); } ,addChar: function(c) { this.b += String.fromCharCode(c); } ,add: function(x) { this.b += Std.string(x); } ,b: null ,__class__: StringBuf } var StringTools = $hxClasses["StringTools"] = function() { } StringTools.__name__ = ["StringTools"]; StringTools.urlEncode = function(s) { return encodeURIComponent(s); } StringTools.urlDecode = function(s) { return decodeURIComponent(s.split("+").join(" ")); } StringTools.htmlEscape = function(s) { return s.split("&").join("&").split("<").join("<").split(">").join(">"); } StringTools.htmlUnescape = function(s) { return s.split(">").join(">").split("<").join("<").split("&").join("&"); } StringTools.startsWith = function(s,start) { return s.length >= start.length && HxOverrides.substr(s,0,start.length) == start; } StringTools.endsWith = function(s,end) { var elen = end.length; var slen = s.length; return slen >= elen && HxOverrides.substr(s,slen - elen,elen) == end; } StringTools.isSpace = function(s,pos) { var c = HxOverrides.cca(s,pos); return c >= 9 && c <= 13 || c == 32; } StringTools.ltrim = function(s) { var l = s.length; var r = 0; while(r < l && StringTools.isSpace(s,r)) r++; if(r > 0) return HxOverrides.substr(s,r,l - r); else return s; } StringTools.rtrim = function(s) { var l = s.length; var r = 0; while(r < l && StringTools.isSpace(s,l - r - 1)) r++; if(r > 0) return HxOverrides.substr(s,0,l - r); else return s; } StringTools.trim = function(s) { return StringTools.ltrim(StringTools.rtrim(s)); } StringTools.rpad = function(s,c,l) { var sl = s.length; var cl = c.length; while(sl < l) if(l - sl < cl) { s += HxOverrides.substr(c,0,l - sl); sl = l; } else { s += c; sl += cl; } return s; } StringTools.lpad = function(s,c,l) { var ns = ""; var sl = s.length; if(sl >= l) return s; var cl = c.length; while(sl < l) if(l - sl < cl) { ns += HxOverrides.substr(c,0,l - sl); sl = l; } else { ns += c; sl += cl; } return ns + s; } StringTools.replace = function(s,sub,by) { return s.split(sub).join(by); } StringTools.hex = function(n,digits) { var s = ""; var hexChars = "0123456789ABCDEF"; do { s = hexChars.charAt(n & 15) + s; n >>>= 4; } while(n > 0); if(digits != null) while(s.length < digits) s = "0" + s; return s; } StringTools.fastCodeAt = function(s,index) { return s.charCodeAt(index); } StringTools.isEOF = function(c) { return c != c; } var ValueType = $hxClasses["ValueType"] = { __ename__ : ["ValueType"], __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] } ValueType.TNull = ["TNull",0]; ValueType.TNull.toString = $estr; ValueType.TNull.__enum__ = ValueType; ValueType.TInt = ["TInt",1]; ValueType.TInt.toString = $estr; ValueType.TInt.__enum__ = ValueType; ValueType.TFloat = ["TFloat",2]; ValueType.TFloat.toString = $estr; ValueType.TFloat.__enum__ = ValueType; ValueType.TBool = ["TBool",3]; ValueType.TBool.toString = $estr; ValueType.TBool.__enum__ = ValueType; ValueType.TObject = ["TObject",4]; ValueType.TObject.toString = $estr; ValueType.TObject.__enum__ = ValueType; ValueType.TFunction = ["TFunction",5]; ValueType.TFunction.toString = $estr; ValueType.TFunction.__enum__ = ValueType; ValueType.TClass = function(c) { var $x = ["TClass",6,c]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; } ValueType.TEnum = function(e) { var $x = ["TEnum",7,e]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; } ValueType.TUnknown = ["TUnknown",8]; ValueType.TUnknown.toString = $estr; ValueType.TUnknown.__enum__ = ValueType; var Type = $hxClasses["Type"] = function() { } Type.__name__ = ["Type"]; Type.getClass = function(o) { if(o == null) return null; return o.__class__; } Type.getEnum = function(o) { if(o == null) return null; return o.__enum__; } Type.getSuperClass = function(c) { return c.__super__; } Type.getClassName = function(c) { var a = c.__name__; return a.join("."); } Type.getEnumName = function(e) { var a = e.__ename__; return a.join("."); } Type.resolveClass = function(name) { var cl = $hxClasses[name]; if(cl == null || !cl.__name__) return null; return cl; } Type.resolveEnum = function(name) { var e = $hxClasses[name]; if(e == null || !e.__ename__) return null; return e; } Type.createInstance = function(cl,args) { switch(args.length) { case 0: return new cl(); case 1: return new cl(args[0]); case 2: return new cl(args[0],args[1]); case 3: return new cl(args[0],args[1],args[2]); case 4: return new cl(args[0],args[1],args[2],args[3]); case 5: return new cl(args[0],args[1],args[2],args[3],args[4]); case 6: return new cl(args[0],args[1],args[2],args[3],args[4],args[5]); case 7: return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6]); case 8: return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]); default: throw "Too many arguments"; } return null; } Type.createEmptyInstance = function(cl) { function empty() {}; empty.prototype = cl.prototype; return new empty(); } Type.createEnum = function(e,constr,params) { var f = Reflect.field(e,constr); if(f == null) throw "No such constructor " + constr; if(Reflect.isFunction(f)) { if(params == null) throw "Constructor " + constr + " need parameters"; return f.apply(e,params); } if(params != null && params.length != 0) throw "Constructor " + constr + " does not need parameters"; return f; } Type.createEnumIndex = function(e,index,params) { var c = e.__constructs__[index]; if(c == null) throw index + " is not a valid enum constructor index"; return Type.createEnum(e,c,params); } Type.getInstanceFields = function(c) { var a = []; for(var i in c.prototype) a.push(i); HxOverrides.remove(a,"__class__"); HxOverrides.remove(a,"__properties__"); return a; } Type.getClassFields = function(c) { var a = Reflect.fields(c); HxOverrides.remove(a,"__name__"); HxOverrides.remove(a,"__interfaces__"); HxOverrides.remove(a,"__properties__"); HxOverrides.remove(a,"__super__"); HxOverrides.remove(a,"prototype"); return a; } Type.getEnumConstructs = function(e) { var a = e.__constructs__; return a.slice(); } Type["typeof"] = function(v) { switch(typeof(v)) { case "boolean": return ValueType.TBool; case "string": return ValueType.TClass(String); case "number": if(Math.ceil(v) == v % 2147483648.0) return ValueType.TInt; return ValueType.TFloat; case "object": if(v == null) return ValueType.TNull; var e = v.__enum__; if(e != null) return ValueType.TEnum(e); var c = v.__class__; if(c != null) return ValueType.TClass(c); return ValueType.TObject; case "function": if(v.__name__ || v.__ename__) return ValueType.TObject; return ValueType.TFunction; case "undefined": return ValueType.TNull; default: return ValueType.TUnknown; } } Type.enumEq = function(a,b) { if(a == b) return true; try { if(a[0] != b[0]) return false; var _g1 = 2, _g = a.length; while(_g1 < _g) { var i = _g1++; if(!Type.enumEq(a[i],b[i])) return false; } var e = a.__enum__; if(e != b.__enum__ || e == null) return false; } catch( e ) { return false; } return true; } Type.enumConstructor = function(e) { return e[0]; } Type.enumParameters = function(e) { return e.slice(2); } Type.enumIndex = function(e) { return e[1]; } Type.allEnums = function(e) { var all = []; var cst = e.__constructs__; var _g = 0; while(_g < cst.length) { var c = cst[_g]; ++_g; var v = Reflect.field(e,c); if(!Reflect.isFunction(v)) all.push(v); } return all; } var com = com || {} if(!com.wiris) com.wiris = {} if(!com.wiris.js) com.wiris.js = {} com.wiris.js.JsBrowserData = $hxClasses["com.wiris.js.JsBrowserData"] = function() { }; com.wiris.js.JsBrowserData.__name__ = ["com","wiris","js","JsBrowserData"]; com.wiris.js.JsBrowserData.prototype = { identity: null ,versionSearch: null ,subString: null ,prop: null ,string: null ,__class__: com.wiris.js.JsBrowserData } com.wiris.js.JsOSData = $hxClasses["com.wiris.js.JsOSData"] = function() { }; com.wiris.js.JsOSData.__name__ = ["com","wiris","js","JsOSData"]; com.wiris.js.JsOSData.prototype = { identity: null ,subString: null ,string: null ,__class__: com.wiris.js.JsOSData } com.wiris.js.JsBrowser = $hxClasses["com.wiris.js.JsBrowser"] = function() { this.dataBrowser = new Array(); this.addBrowser("navigator.userAgent",null,"Chrome",null,"Chrome"); this.addBrowser("navigator.userAgent",null,"OmniWeb",null,"OmniWeb"); this.addBrowser("navigator.vendor",null,"Apple","Version","Safari"); this.addBrowser(null,"window.opera",null,"Version","Opera"); this.addBrowser("navigator.vendor",null,"iCab",null,"iCab"); this.addBrowser("navigator.vendor",null,"KDE",null,"Konkeror"); this.addBrowser("navigator.userAgent",null,"Firefox",null,"Firefox"); this.addBrowser("navigator.vendor",null,"Camino",null,"Camino"); this.addBrowser("navigator.userAgent",null,"Netscape",null,"Netscape"); this.addBrowser("navigator.userAgent",null,"MSIE","MSIE","Explorer"); this.addBrowser("navigator.userAgent",null,"Gecko","rv","Mozilla"); this.addBrowser("navigator.userAgent",null,"Mozilla","Mozilla","Netscape"); this.dataOS = new Array(); this.addOS("navigator.platform","Win","Windows"); this.addOS("navigator.platform","Mac","Mac"); this.addOS("navigator.userAgent","iPhone","iOS"); this.addOS("navigator.userAgent","iPad","iOS"); this.addOS("navigator.userAgent","Android","Android"); this.addOS("navigator.platform","Linux","Linux"); this.setBrowser(); this.setOS(); }; com.wiris.js.JsBrowser.__name__ = ["com","wiris","js","JsBrowser"]; com.wiris.js.JsBrowser.prototype = { isAndroid: function() { return this.os == "Android"; } ,isIOS: function() { return this.os == "iOS"; } ,isFF: function() { return this.browser == "Firefox"; } ,isChrome: function() { return this.browser == "Chrome"; } ,isIE: function() { return this.browser == "Explorer"; } ,getVersion: function() { return this.ver; } ,getOS: function() { return this.os; } ,getBrowser: function() { return this.browser; } ,searchVersion: function(prop,search) { var str = js.Boot.__cast(eval(prop) , String); var index = str.indexOf(search); if(index == -1) return null; return "" + Std.parseFloat(HxOverrides.substr(str,index + search.length + 1,null)); } ,setOS: function() { var i = HxOverrides.iter(this.dataOS); while(i.hasNext()) { var s = i.next(); var str = js.Boot.__cast(eval(s.string) , String); if(str.indexOf(s.subString) != -1) { this.os = s.identity; return; } } } ,setBrowser: function() { var i = HxOverrides.iter(this.dataBrowser); while(i.hasNext()) { var b = i.next(); if(b.string != null) { var obj = eval(b.string); if(obj != null) { var str = js.Boot.__cast(obj , String); if(str.indexOf(b.subString) != -1) { this.browser = b.identity; this.ver = this.searchVersion("navigator.userAgent",b.versionSearch); if(this.ver == null) this.ver = this.searchVersion("navigator.appVersion",b.versionSearch); return; } } } } } ,addOS: function(string,subString,identity) { var s = new com.wiris.js.JsOSData(); s.string = string; s.subString = subString; s.identity = identity; this.dataOS.push(s); } ,addBrowser: function(string,prop,subString,versionSearch,identity) { var b = new com.wiris.js.JsBrowserData(); b.string = string; b.prop = prop; b.subString = subString; b.versionSearch = versionSearch != null?versionSearch:identity; b.identity = identity; this.dataBrowser.push(b); } ,os: null ,ver: null ,browser: null ,dataOS: null ,dataBrowser: null ,__class__: com.wiris.js.JsBrowser } com.wiris.js.JsPluginTools = $hxClasses["com.wiris.js.JsPluginTools"] = function() { this.tryReady(); }; com.wiris.js.JsPluginTools.__name__ = ["com","wiris","js","JsPluginTools"]; com.wiris.js.JsPluginTools.instance = null; com.wiris.js.JsPluginTools.main = function() { var ev; ev = com.wiris.js.JsPluginTools.getInstance(); haxe.Timer.delay($bind(ev,ev.tryReady),100); } com.wiris.js.JsPluginTools.getInstance = function() { if(com.wiris.js.JsPluginTools.instance == null) com.wiris.js.JsPluginTools.instance = new com.wiris.js.JsPluginTools(); return com.wiris.js.JsPluginTools.instance; } com.wiris.js.JsPluginTools.bypassEncapsulation = function() { if(window.com == null) window.com = { }; if(window.com.wiris == null) window.com.wiris = { }; if(window.com.wiris.js == null) window.com.wiris.js = { }; if(window.com.wiris.js.JsPluginTools == null) window.com.wiris.js.JsPluginTools = com.wiris.js.JsPluginTools.getInstance(); } com.wiris.js.JsPluginTools.prototype = { md5encode: function(content) { return haxe.Md5.encode(content); } ,doLoad: function() { this.ready = true; com.wiris.js.JsPluginTools.instance = this; com.wiris.js.JsPluginTools.bypassEncapsulation(); } ,tryReady: function() { this.ready = false; if(js.Lib.document.readyState) { this.doLoad(); this.ready = true; } if(!this.ready) haxe.Timer.delay($bind(this,this.tryReady),100); } ,ready: null ,__class__: com.wiris.js.JsPluginTools } com.wiris.js.JsPluginViewer = $hxClasses["com.wiris.js.JsPluginViewer"] = function() { this._wrs_conf_imageFormat = null; this.javaServicePath = "/pluginwiris_engine/app"; this.performanceenabled = null; this.params = new Hash(); this.mode = com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE; this.zoom = 1; this.viewer = ""; this.lang = "inherit"; this.ready = false; this.extension = "@param.configuration.script.extension@"; this.localpath = "@param.configuration.script.local.path@"; this.absoluteURL = "@param.configuration.script.base.path@"; if(this.extension.indexOf("@") >= 0) this.extension = ""; if(this.localpath.indexOf("@") >= 0) this.localpath = "/app"; if(this.absoluteURL.indexOf("@") >= 0) this.absoluteURL = "/java-java-context-root"; }; com.wiris.js.JsPluginViewer.__name__ = ["com","wiris","js","JsPluginViewer"]; com.wiris.js.JsPluginViewer.instance = null; com.wiris.js.JsPluginViewer.main = function() { var ev; ev = com.wiris.js.JsPluginViewer.getInstance(); haxe.Timer.delay($bind(ev,ev.tryReady),100); } com.wiris.js.JsPluginViewer.getInstance = function() { if(com.wiris.js.JsPluginViewer.instance == null) com.wiris.js.JsPluginViewer.instance = new com.wiris.js.JsPluginViewer(); return com.wiris.js.JsPluginViewer.instance; } com.wiris.js.JsPluginViewer.bypassEncapsulation = function() { if(window.com == null) window.com = { }; if(window.com.wiris == null) window.com.wiris = { }; if(window.com.wiris.js == null) window.com.wiris.js = { }; if(window.com.wiris.js.JsPluginViewer == null) window.com.wiris.js.JsPluginViewer = com.wiris.js.JsPluginViewer.getInstance(); } com.wiris.js.JsPluginViewer.prototype = { getBaseURL: function() { return this.baseURL; } ,queryToParams: function(query) { var ss = query.split("&"); var h = new Hash(); var _g = 0; while(_g < ss.length) { var s = ss[_g]; ++_g; var kv = s.split("="); if(kv.length > 1) h.set(kv[0],StringTools.urlDecode(kv[1])); } return h; } ,isPerformanceEnabled: function() { var data; data = this.callGetVariableKeys("wirispluginperformance"); if(haxe.Json.parse(data).status != "ok") return false; else return haxe.Json.parse(data).result.wirispluginperformance == "true"?true:false; } ,callGetVariableKeys: function(variableKeys) { var con; var data; var url; url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/configurationjson" + this.extension; con = new js.XMLHttpRequest(); data = "?variablekeys=" + variableKeys; con.open("GET",url + data,false); con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8"); con.send(null); return con.responseText; } ,callService: function(mml,servicename) { var con; var height = 0; var width = 0; var baseline = 0; var text = null; var data; var url; con = new js.XMLHttpRequest(); url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/service" + this.extension; data = "service=" + servicename; data += "&metrics=true¢erbaseline=false&mml=" + StringTools.urlEncode(mml); data += "&lang=" + this.lang; if(this.zoom != 1) data += "&zoom=" + this.zoom; if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 535, className : "com.wiris.js.JsPluginViewer", methodName : "callService"}); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 537, className : "com.wiris.js.JsPluginViewer", methodName : "callService"}); con.open("POST",url,false); con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8"); con.send(data); return con.responseText; } ,callShowimage: function(mml,img) { var con; var height = 0; var width = 0; var baseline = 0; var text = null; var data; var url; con = new js.XMLHttpRequest(); var mmlEntities; mmlEntities = ""; var _g1 = 0, _g = mml.length; while(_g1 < _g) { var i = _g1++; var character; character = mml.charAt(i); if(HxOverrides.cca(mml,i) > 128) mmlEntities += "&#" + HxOverrides.cca(mml,i) + ";"; else mmlEntities += character; } var md5 = haxe.Md5.encode("centerbaseline=false\nmml=" + mmlEntities + "\n"); url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/showimage" + this.extension; data = "?formula=" + md5 + "&lang=" + this.lang; if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 474, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"}); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("GET:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 476, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"}); con.open("GET",url + data,false); con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8"); con.send(null); var s = con.responseText; if(haxe.Json.parse(con.responseText).status == "warning") { con.open("POST",url,false); con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8"); data = "centerbaseline=false&mml=" + StringTools.urlEncode(mml); con.send(data); s = con.responseText; } var result = haxe.Json.parse(con.responseText).result; img.src = result.format == "svg"?"data:image/svg+xml;base64,":"data:image/png;base64,"; img.src = img.src + Std.string(result.base64); if(result.height > 0) { if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber : 498, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"}); img.style.verticalAlign = "-" + this.calculateAlignment(result.height,result.baseline) + "px"; img.style.height = "" + Std.string(result.height) + "px"; img.style.width = "" + Std.string(result.width) + "px"; } img.setAttribute("data-mathml",mml); img.setAttribute("class","Wirisformula"); img.setAttribute("role","math"); if(result.alt != null) img.alt = result.alt; else { var accessibility = this.callService(mml,"mathml2accessible"); if(accessibility != null) img.alt = accessibility; } } ,callCreateImage: function(mml,img) { var con; var height = 0; var width = 0; var baseline = 0; var text = null; var data; var url; con = new js.XMLHttpRequest(); url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/createimage" + this.extension; data = "metrics=true¢erbaseline=false&mml=" + StringTools.urlEncode(mml); data += "&lang=" + this.lang; if(this.zoom != 1) data += "&zoom=" + this.zoom; if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 400, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"}); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 402, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"}); con.open("POST",url,false); con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8"); con.send(data); var s = con.responseText; var i = s.indexOf("?"); if(i >= 0) { var scaleDpi = 1; var h = this.queryToParams(HxOverrides.substr(s,i + 1,null)); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(h.get("formula"),{ fileName : "JsPluginViewer.hx", lineNumber : 425, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"}); if(h.exists("dpi")) scaleDpi = this.zoom * (Std.parseInt(h.get("dpi")) / 96); baseline = Std.parseInt(h.get("cb")) / scaleDpi | 0; height = Std.parseInt(h.get("ch")) / scaleDpi | 0; width = Std.parseInt(h.get("cw")) / scaleDpi | 0; text = h.get("text"); } img.src = con.responseText; if(height > 0) { if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber : 436, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"}); img.style.verticalAlign = "-" + this.calculateAlignment(height,baseline) + "px"; img.style.height = "" + height + "px"; img.style.width = "" + width + "px"; } img.setAttribute("data-mathml",mml); img.setAttribute("class","Wirisformula"); img.setAttribute("role","math"); var accessibility = this.callService(mml,"mathml2accessible"); if(accessibility != null) img.alt = accessibility; } ,calculateAlignment: function(height,baseline) { var result; result = 0; var ALIGN_CONSTANT = 0.5; if(this._wrs_conf_imageFormat == null) this._wrs_conf_imageFormat = haxe.Json.parse(this.callGetVariableKeys("wirisimageformat")).result.wirisimageformat; if(this._wrs_conf_imageFormat == "svg") result = height - baseline - ALIGN_CONSTANT; else result = height - baseline; return result; } ,getTechnology: function() { if(HxOverrides.substr(com.wiris.js.JsPluginViewer.TECH,1,null) == "param.js.tech.discover@") { var con; con = new js.XMLHttpRequest(); con.open("GET",this.baseURL + "/../tech.txt",false); con.send(null); var s = con.responseText; return StringTools.trim(s.split("#")[0]); } else return com.wiris.js.JsPluginViewer.TECH; } ,processMathML: function(mml,container) { if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(mml,{ fileName : "JsPluginViewer.hx", lineNumber : 336, className : "com.wiris.js.JsPluginViewer", methodName : "processMathML"}); var img = js.Lib.document.createElement("img"); if(this.performanceenabled == null) this.performanceenabled = this.isPerformanceEnabled(); if(this.mode == com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE && this.performanceenabled) this.callShowimage(mml,img); else if(this.mode == com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE && !this.performanceenabled) this.callCreateImage(mml,img); else img.src = this.baseURL + this.localpath + "/showimage" + this.extension + "?mml=" + StringTools.urlEncode(mml); container.appendChild(img); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(img.src,{ fileName : "JsPluginViewer.hx", lineNumber : 350, className : "com.wiris.js.JsPluginViewer", methodName : "processMathML"}); } ,getMathML_IE7: function(mathNode0) { var mathml = ""; var mathNode = mathNode0; while(mathNode != null && mathNode.nodeName != "/MATH") { if(mathNode.nodeType == 3) mathml += mathNode.nodeValue; else { var nodeName = mathNode.nodeName.toLowerCase(); if(nodeName.charAt(0) == "/") mathml += ""; else { mathml += "<" + nodeName; var attributes = mathNode.attributes; var i = 0; while(i < attributes.length) { var attribute = attributes[i]; if(attribute.nodeValue != "" && attribute.nodeValue != null && attribute.nodeValue != "inherit") mathml += " " + attribute.nodeName + "=\"" + attribute.nodeValue + "\""; ++i; } var counter = 1; var nextMathNode = mathNode.nextSibling; while(nextMathNode != null && counter > 0) { var nextNodeName = nextMathNode.nodeName.toLowerCase(); if(nextNodeName == nodeName) ++counter; else if(nextNodeName == "/" + nodeName) --counter; nextMathNode = nextMathNode.nextSibling; } if(counter > 0) mathml += "/"; mathml += ">"; } } var nextMathNode = mathNode.nextSibling; if(mathNode != mathNode0) mathNode.parentNode.removeChild(mathNode); mathNode = nextMathNode; } if(mathNode.nodeName == "/MATH") mathNode.parentNode.removeChild(mathNode); mathml += ""; return mathml; } ,replaceNodes: function(mathNodes,n) { if(n >= mathNodes.length) return; var mathNode = mathNodes[n]; var mathml = null; var browser = new com.wiris.js.JsBrowser(); if(browser.getBrowser() == "Explorer" && (browser.getVersion() == "6" || browser.getVersion() == "7") && navigator.appVersion.indexOf("Trident") == -1) { if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Is ie7",{ fileName : "JsPluginViewer.hx", lineNumber : 235, className : "com.wiris.js.JsPluginViewer", methodName : "replaceNodes"}); mathml = this.getMathML_IE7(mathNode); } var container = js.Lib.document.createElement("span"); mathNode.parentNode.replaceChild(container,mathNode); if(mathml == null) { container.appendChild(mathNode); mathml = container.innerHTML; container.removeChild(mathNode); } var index = mathml.indexOf("= 0) { this.baseURL = HxOverrides.substr(src,0,j - 1); var k = src.indexOf("?",j); if(k >= 0) { var query = HxOverrides.substr(src,k + 1,null); this.params = this.queryToParams(query); } if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.baseURL,{ fileName : "JsPluginViewer.hx", lineNumber : 123, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"}); } } this.tech = this.getTechnology(); if(this.tech == "php") { this.extension = ".php"; this.localpath = ""; this.absoluteURL = ""; } else if(this.tech == "aspx") { this.extension = ".aspx"; this.localpath = ""; this.absoluteURL = ""; } else if(this.tech == "local-java") { this.extension = ""; this.localpath = "/../app"; this.absoluteURL = ""; } else if(this.tech == "nodejs") { this.extension = ""; this.localpath = "/../integration"; this.absoluteURL = ""; } else if(this.tech == "java") { this.extension = ""; this.localpath = ""; this.absoluteURL = ""; } else if(this.tech == "ruby") { this.extension = ""; this.absoluteURL = "/wirispluginengine/integration"; } this.ready = true; if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Tech:" + this.tech,{ fileName : "JsPluginViewer.hx", lineNumber : 154, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"}); if(this.params.exists("viewer")) this.viewer = this.params.get("viewer"); if(this.params.exists("zoom")) this.zoom = Std.parseFloat(this.params.get("zoom")); if(this.params.exists("dpi")) this.zoom *= Std.parseFloat(this.params.get("dpi")) / 96; if(this.params.exists("lang")) this.lang = this.params.get("lang"); else this.lang = "en"; if(this.lang == "inherit") this.lang = js.Lib.document.getElementsByTagName("html")[0].lang; if(this.viewer == "image") this.parseDocument(); if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Language:" + this.lang,{ fileName : "JsPluginViewer.hx", lineNumber : 185, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"}); com.wiris.js.JsPluginViewer.instance = this; com.wiris.js.JsPluginViewer.bypassEncapsulation(); } ,tryReady: function() { this.ready = false; if(js.Lib.document.readyState) { this.doLoad(); this.ready = true; } if(!this.ready) haxe.Timer.delay($bind(this,this.tryReady),100); } ,_wrs_conf_imageFormat: null ,ready: null ,javaServicePath: null ,tech: null ,lang: null ,performanceenabled: null ,viewer: null ,zoom: null ,absoluteURL: null ,localpath: null ,extension: null ,mode: null ,params: null ,scriptName: null ,baseURL: null ,__class__: com.wiris.js.JsPluginViewer } var haxe = haxe || {} haxe.Http = $hxClasses["haxe.Http"] = function(url) { this.url = url; this.headers = new Hash(); this.params = new Hash(); this.async = true; }; haxe.Http.__name__ = ["haxe","Http"]; haxe.Http.requestUrl = function(url) { var h = new haxe.Http(url); h.async = false; var r = null; h.onData = function(d) { r = d; }; h.onError = function(e) { throw e; }; h.request(false); return r; } haxe.Http.prototype = { onStatus: function(status) { } ,onError: function(msg) { } ,onData: function(data) { } ,request: function(post) { var me = this; var r = new js.XMLHttpRequest(); var onreadystatechange = function() { if(r.readyState != 4) return; var s = (function($this) { var $r; try { $r = r.status; } catch( e ) { $r = null; } return $r; }(this)); if(s == undefined) s = null; if(s != null) me.onStatus(s); if(s != null && s >= 200 && s < 400) me.onData(r.responseText); else switch(s) { case null: case undefined: me.onError("Failed to connect or resolve host"); break; case 12029: me.onError("Failed to connect to host"); break; case 12007: me.onError("Unknown host"); break; default: me.onError("Http Error #" + r.status); } }; if(this.async) r.onreadystatechange = onreadystatechange; var uri = this.postData; if(uri != null) post = true; else { var $it0 = this.params.keys(); while( $it0.hasNext() ) { var p = $it0.next(); if(uri == null) uri = ""; else uri += "&"; uri += StringTools.urlEncode(p) + "=" + StringTools.urlEncode(this.params.get(p)); } } try { if(post) r.open("POST",this.url,this.async); else if(uri != null) { var question = this.url.split("?").length <= 1; r.open("GET",this.url + (question?"?":"&") + uri,this.async); uri = null; } else r.open("GET",this.url,this.async); } catch( e ) { this.onError(e.toString()); return; } if(this.headers.get("Content-Type") == null && post && this.postData == null) r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var $it1 = this.headers.keys(); while( $it1.hasNext() ) { var h = $it1.next(); r.setRequestHeader(h,this.headers.get(h)); } r.send(uri); if(!this.async) onreadystatechange(); } ,setPostData: function(data) { this.postData = data; } ,setParameter: function(param,value) { this.params.set(param,value); } ,setHeader: function(header,value) { this.headers.set(header,value); } ,params: null ,headers: null ,postData: null ,async: null ,url: null ,__class__: haxe.Http } haxe.Json = $hxClasses["haxe.Json"] = function() { }; haxe.Json.__name__ = ["haxe","Json"]; haxe.Json.parse = function(text) { return new haxe.Json().doParse(text); } haxe.Json.stringify = function(value) { return new haxe.Json().toString(value); } haxe.Json.prototype = { parseString: function() { var start = this.pos; var buf = new StringBuf(); while(true) { var c = this.str.charCodeAt(this.pos++); if(c == 34) break; if(c == 92) { buf.b += HxOverrides.substr(this.str,start,this.pos - start - 1); c = this.str.charCodeAt(this.pos++); switch(c) { case 114: buf.b += String.fromCharCode(13); break; case 110: buf.b += String.fromCharCode(10); break; case 116: buf.b += String.fromCharCode(9); break; case 98: buf.b += String.fromCharCode(8); break; case 102: buf.b += String.fromCharCode(12); break; case 47:case 92:case 34: buf.b += String.fromCharCode(c); break; case 117: var uc = Std.parseInt("0x" + HxOverrides.substr(this.str,this.pos,4)); this.pos += 4; buf.b += String.fromCharCode(uc); break; default: throw "Invalid escape sequence \\" + String.fromCharCode(c) + " at position " + (this.pos - 1); } start = this.pos; } else if(c != c) throw "Unclosed string"; } buf.b += HxOverrides.substr(this.str,start,this.pos - start - 1); return buf.b; } ,parseRec: function() { while(true) { var c = this.str.charCodeAt(this.pos++); switch(c) { case 32:case 13:case 10:case 9: break; case 123: var obj = { }, field = null, comma = null; while(true) { var c1 = this.str.charCodeAt(this.pos++); switch(c1) { case 32:case 13:case 10:case 9: break; case 125: if(field != null || comma == false) this.invalidChar(); return obj; case 58: if(field == null) this.invalidChar(); obj[field] = this.parseRec(); field = null; comma = true; break; case 44: if(comma) comma = false; else this.invalidChar(); break; case 34: if(comma) this.invalidChar(); field = this.parseString(); break; default: this.invalidChar(); } } break; case 91: var arr = [], comma = null; while(true) { var c1 = this.str.charCodeAt(this.pos++); switch(c1) { case 32:case 13:case 10:case 9: break; case 93: if(comma == false) this.invalidChar(); return arr; case 44: if(comma) comma = false; else this.invalidChar(); break; default: if(comma) this.invalidChar(); this.pos--; arr.push(this.parseRec()); comma = true; } } break; case 116: var save = this.pos; if(this.str.charCodeAt(this.pos++) != 114 || this.str.charCodeAt(this.pos++) != 117 || this.str.charCodeAt(this.pos++) != 101) { this.pos = save; this.invalidChar(); } return true; case 102: var save = this.pos; if(this.str.charCodeAt(this.pos++) != 97 || this.str.charCodeAt(this.pos++) != 108 || this.str.charCodeAt(this.pos++) != 115 || this.str.charCodeAt(this.pos++) != 101) { this.pos = save; this.invalidChar(); } return false; case 110: var save = this.pos; if(this.str.charCodeAt(this.pos++) != 117 || this.str.charCodeAt(this.pos++) != 108 || this.str.charCodeAt(this.pos++) != 108) { this.pos = save; this.invalidChar(); } return null; case 34: return this.parseString(); case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 45: this.pos--; if(!this.reg_float.match(HxOverrides.substr(this.str,this.pos,null))) throw "Invalid float at position " + this.pos; var v = this.reg_float.matched(0); this.pos += v.length; var f = Std.parseFloat(v); var i = f | 0; return i == f?i:f; default: this.invalidChar(); } } } ,nextChar: function() { return this.str.charCodeAt(this.pos++); } ,invalidChar: function() { this.pos--; throw "Invalid char " + this.str.charCodeAt(this.pos) + " at position " + this.pos; } ,doParse: function(str) { this.reg_float = new EReg("^-?(0|[1-9][0-9]*)(\\.[0-9]+)?([eE][+-]?[0-9]+)?",""); this.str = str; this.pos = 0; return this.parseRec(); } ,quote: function(s) { this.buf.b += Std.string("\""); var i = 0; while(true) { var c = s.charCodeAt(i++); if(c != c) break; switch(c) { case 34: this.buf.b += Std.string("\\\""); break; case 92: this.buf.b += Std.string("\\\\"); break; case 10: this.buf.b += Std.string("\\n"); break; case 13: this.buf.b += Std.string("\\r"); break; case 9: this.buf.b += Std.string("\\t"); break; case 8: this.buf.b += Std.string("\\b"); break; case 12: this.buf.b += Std.string("\\f"); break; default: this.buf.b += String.fromCharCode(c); } } this.buf.b += Std.string("\""); } ,toStringRec: function(v) { var $e = (Type["typeof"](v)); switch( $e[1] ) { case 8: this.buf.b += Std.string("\"???\""); break; case 4: this.objString(v); break; case 1: case 2: this.buf.b += Std.string(v); break; case 5: this.buf.b += Std.string("\"\""); break; case 6: var c = $e[2]; if(c == String) this.quote(v); else if(c == Array) { var v1 = v; this.buf.b += Std.string("["); var len = v1.length; if(len > 0) { this.toStringRec(v1[0]); var i = 1; while(i < len) { this.buf.b += Std.string(","); this.toStringRec(v1[i++]); } } this.buf.b += Std.string("]"); } else if(c == Hash) { var v1 = v; var o = { }; var $it0 = v1.keys(); while( $it0.hasNext() ) { var k = $it0.next(); o[k] = v1.get(k); } this.objString(o); } else this.objString(v); break; case 7: var e = $e[2]; this.buf.b += Std.string(v[1]); break; case 3: this.buf.b += Std.string(v?"true":"false"); break; case 0: this.buf.b += Std.string("null"); break; } } ,objString: function(v) { this.fieldsString(v,Reflect.fields(v)); } ,fieldsString: function(v,fields) { var first = true; this.buf.b += Std.string("{"); var _g = 0; while(_g < fields.length) { var f = fields[_g]; ++_g; var value = Reflect.field(v,f); if(Reflect.isFunction(value)) continue; if(first) first = false; else this.buf.b += Std.string(","); this.quote(f); this.buf.b += Std.string(":"); this.toStringRec(value); } this.buf.b += Std.string("}"); } ,toString: function(v) { this.buf = new StringBuf(); this.toStringRec(v); return this.buf.b; } ,reg_float: null ,pos: null ,str: null ,buf: null ,__class__: haxe.Json } haxe.Log = $hxClasses["haxe.Log"] = function() { } haxe.Log.__name__ = ["haxe","Log"]; haxe.Log.trace = function(v,infos) { js.Boot.__trace(v,infos); } haxe.Log.clear = function() { js.Boot.__clear_trace(); } haxe.Md5 = $hxClasses["haxe.Md5"] = function() { }; haxe.Md5.__name__ = ["haxe","Md5"]; haxe.Md5.encode = function(s) { return new haxe.Md5().doEncode(s); } haxe.Md5.prototype = { doEncode: function(str) { var x = this.str2blks(str); var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; var step; var i = 0; while(i < x.length) { var olda = a; var oldb = b; var oldc = c; var oldd = d; step = 0; a = this.ff(a,b,c,d,x[i],7,-680876936); d = this.ff(d,a,b,c,x[i + 1],12,-389564586); c = this.ff(c,d,a,b,x[i + 2],17,606105819); b = this.ff(b,c,d,a,x[i + 3],22,-1044525330); a = this.ff(a,b,c,d,x[i + 4],7,-176418897); d = this.ff(d,a,b,c,x[i + 5],12,1200080426); c = this.ff(c,d,a,b,x[i + 6],17,-1473231341); b = this.ff(b,c,d,a,x[i + 7],22,-45705983); a = this.ff(a,b,c,d,x[i + 8],7,1770035416); d = this.ff(d,a,b,c,x[i + 9],12,-1958414417); c = this.ff(c,d,a,b,x[i + 10],17,-42063); b = this.ff(b,c,d,a,x[i + 11],22,-1990404162); a = this.ff(a,b,c,d,x[i + 12],7,1804603682); d = this.ff(d,a,b,c,x[i + 13],12,-40341101); c = this.ff(c,d,a,b,x[i + 14],17,-1502002290); b = this.ff(b,c,d,a,x[i + 15],22,1236535329); a = this.gg(a,b,c,d,x[i + 1],5,-165796510); d = this.gg(d,a,b,c,x[i + 6],9,-1069501632); c = this.gg(c,d,a,b,x[i + 11],14,643717713); b = this.gg(b,c,d,a,x[i],20,-373897302); a = this.gg(a,b,c,d,x[i + 5],5,-701558691); d = this.gg(d,a,b,c,x[i + 10],9,38016083); c = this.gg(c,d,a,b,x[i + 15],14,-660478335); b = this.gg(b,c,d,a,x[i + 4],20,-405537848); a = this.gg(a,b,c,d,x[i + 9],5,568446438); d = this.gg(d,a,b,c,x[i + 14],9,-1019803690); c = this.gg(c,d,a,b,x[i + 3],14,-187363961); b = this.gg(b,c,d,a,x[i + 8],20,1163531501); a = this.gg(a,b,c,d,x[i + 13],5,-1444681467); d = this.gg(d,a,b,c,x[i + 2],9,-51403784); c = this.gg(c,d,a,b,x[i + 7],14,1735328473); b = this.gg(b,c,d,a,x[i + 12],20,-1926607734); a = this.hh(a,b,c,d,x[i + 5],4,-378558); d = this.hh(d,a,b,c,x[i + 8],11,-2022574463); c = this.hh(c,d,a,b,x[i + 11],16,1839030562); b = this.hh(b,c,d,a,x[i + 14],23,-35309556); a = this.hh(a,b,c,d,x[i + 1],4,-1530992060); d = this.hh(d,a,b,c,x[i + 4],11,1272893353); c = this.hh(c,d,a,b,x[i + 7],16,-155497632); b = this.hh(b,c,d,a,x[i + 10],23,-1094730640); a = this.hh(a,b,c,d,x[i + 13],4,681279174); d = this.hh(d,a,b,c,x[i],11,-358537222); c = this.hh(c,d,a,b,x[i + 3],16,-722521979); b = this.hh(b,c,d,a,x[i + 6],23,76029189); a = this.hh(a,b,c,d,x[i + 9],4,-640364487); d = this.hh(d,a,b,c,x[i + 12],11,-421815835); c = this.hh(c,d,a,b,x[i + 15],16,530742520); b = this.hh(b,c,d,a,x[i + 2],23,-995338651); a = this.ii(a,b,c,d,x[i],6,-198630844); d = this.ii(d,a,b,c,x[i + 7],10,1126891415); c = this.ii(c,d,a,b,x[i + 14],15,-1416354905); b = this.ii(b,c,d,a,x[i + 5],21,-57434055); a = this.ii(a,b,c,d,x[i + 12],6,1700485571); d = this.ii(d,a,b,c,x[i + 3],10,-1894986606); c = this.ii(c,d,a,b,x[i + 10],15,-1051523); b = this.ii(b,c,d,a,x[i + 1],21,-2054922799); a = this.ii(a,b,c,d,x[i + 8],6,1873313359); d = this.ii(d,a,b,c,x[i + 15],10,-30611744); c = this.ii(c,d,a,b,x[i + 6],15,-1560198380); b = this.ii(b,c,d,a,x[i + 13],21,1309151649); a = this.ii(a,b,c,d,x[i + 4],6,-145523070); d = this.ii(d,a,b,c,x[i + 11],10,-1120210379); c = this.ii(c,d,a,b,x[i + 2],15,718787259); b = this.ii(b,c,d,a,x[i + 9],21,-343485551); a = this.addme(a,olda); b = this.addme(b,oldb); c = this.addme(c,oldc); d = this.addme(d,oldd); i += 16; } return this.rhex(a) + this.rhex(b) + this.rhex(c) + this.rhex(d); } ,ii: function(a,b,c,d,x,s,t) { return this.cmn(this.bitXOR(c,this.bitOR(b,~d)),a,b,x,s,t); } ,hh: function(a,b,c,d,x,s,t) { return this.cmn(this.bitXOR(this.bitXOR(b,c),d),a,b,x,s,t); } ,gg: function(a,b,c,d,x,s,t) { return this.cmn(this.bitOR(this.bitAND(b,d),this.bitAND(c,~d)),a,b,x,s,t); } ,ff: function(a,b,c,d,x,s,t) { return this.cmn(this.bitOR(this.bitAND(b,c),this.bitAND(~b,d)),a,b,x,s,t); } ,cmn: function(q,a,b,x,s,t) { return this.addme(this.rol(this.addme(this.addme(a,q),this.addme(x,t)),s),b); } ,rol: function(num,cnt) { return num << cnt | num >>> 32 - cnt; } ,str2blks: function(str) { var nblk = (str.length + 8 >> 6) + 1; var blks = new Array(); var _g1 = 0, _g = nblk * 16; while(_g1 < _g) { var i = _g1++; blks[i] = 0; } var i = 0; while(i < str.length) { blks[i >> 2] |= HxOverrides.cca(str,i) << (str.length * 8 + i) % 4 * 8; i++; } blks[i >> 2] |= 128 << (str.length * 8 + i) % 4 * 8; var l = str.length * 8; var k = nblk * 16 - 2; blks[k] = l & 255; blks[k] |= (l >>> 8 & 255) << 8; blks[k] |= (l >>> 16 & 255) << 16; blks[k] |= (l >>> 24 & 255) << 24; return blks; } ,rhex: function(num) { var str = ""; var hex_chr = "0123456789abcdef"; var _g = 0; while(_g < 4) { var j = _g++; str += hex_chr.charAt(num >> j * 8 + 4 & 15) + hex_chr.charAt(num >> j * 8 & 15); } return str; } ,addme: function(x,y) { var lsw = (x & 65535) + (y & 65535); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return msw << 16 | lsw & 65535; } ,bitAND: function(a,b) { var lsb = a & 1 & (b & 1); var msb31 = a >>> 1 & b >>> 1; return msb31 << 1 | lsb; } ,bitXOR: function(a,b) { var lsb = a & 1 ^ b & 1; var msb31 = a >>> 1 ^ b >>> 1; return msb31 << 1 | lsb; } ,bitOR: function(a,b) { var lsb = a & 1 | b & 1; var msb31 = a >>> 1 | b >>> 1; return msb31 << 1 | lsb; } ,__class__: haxe.Md5 } haxe.Serializer = $hxClasses["haxe.Serializer"] = function() { this.buf = new StringBuf(); this.cache = new Array(); this.useCache = haxe.Serializer.USE_CACHE; this.useEnumIndex = haxe.Serializer.USE_ENUM_INDEX; this.shash = new Hash(); this.scount = 0; }; haxe.Serializer.__name__ = ["haxe","Serializer"]; haxe.Serializer.run = function(v) { var s = new haxe.Serializer(); s.serialize(v); return s.toString(); } haxe.Serializer.prototype = { serializeException: function(e) { this.buf.b += Std.string("x"); this.serialize(e); } ,serialize: function(v) { var $e = (Type["typeof"](v)); switch( $e[1] ) { case 0: this.buf.b += Std.string("n"); break; case 1: if(v == 0) { this.buf.b += Std.string("z"); return; } this.buf.b += Std.string("i"); this.buf.b += Std.string(v); break; case 2: if(Math.isNaN(v)) this.buf.b += Std.string("k"); else if(!Math.isFinite(v)) this.buf.b += Std.string(v < 0?"m":"p"); else { this.buf.b += Std.string("d"); this.buf.b += Std.string(v); } break; case 3: this.buf.b += Std.string(v?"t":"f"); break; case 6: var c = $e[2]; if(c == String) { this.serializeString(v); return; } if(this.useCache && this.serializeRef(v)) return; switch(c) { case Array: var ucount = 0; this.buf.b += Std.string("a"); var l = v.length; var _g = 0; while(_g < l) { var i = _g++; if(v[i] == null) ucount++; else { if(ucount > 0) { if(ucount == 1) this.buf.b += Std.string("n"); else { this.buf.b += Std.string("u"); this.buf.b += Std.string(ucount); } ucount = 0; } this.serialize(v[i]); } } if(ucount > 0) { if(ucount == 1) this.buf.b += Std.string("n"); else { this.buf.b += Std.string("u"); this.buf.b += Std.string(ucount); } } this.buf.b += Std.string("h"); break; case List: this.buf.b += Std.string("l"); var v1 = v; var $it0 = v1.iterator(); while( $it0.hasNext() ) { var i = $it0.next(); this.serialize(i); } this.buf.b += Std.string("h"); break; case Date: var d = v; this.buf.b += Std.string("v"); this.buf.b += Std.string(HxOverrides.dateStr(d)); break; case Hash: this.buf.b += Std.string("b"); var v1 = v; var $it1 = v1.keys(); while( $it1.hasNext() ) { var k = $it1.next(); this.serializeString(k); this.serialize(v1.get(k)); } this.buf.b += Std.string("h"); break; case IntHash: this.buf.b += Std.string("q"); var v1 = v; var $it2 = v1.keys(); while( $it2.hasNext() ) { var k = $it2.next(); this.buf.b += Std.string(":"); this.buf.b += Std.string(k); this.serialize(v1.get(k)); } this.buf.b += Std.string("h"); break; case haxe.io.Bytes: var v1 = v; var i = 0; var max = v1.length - 2; var charsBuf = new StringBuf(); var b64 = haxe.Serializer.BASE64; while(i < max) { var b1 = v1.b[i++]; var b2 = v1.b[i++]; var b3 = v1.b[i++]; charsBuf.b += Std.string(b64.charAt(b1 >> 2)); charsBuf.b += Std.string(b64.charAt((b1 << 4 | b2 >> 4) & 63)); charsBuf.b += Std.string(b64.charAt((b2 << 2 | b3 >> 6) & 63)); charsBuf.b += Std.string(b64.charAt(b3 & 63)); } if(i == max) { var b1 = v1.b[i++]; var b2 = v1.b[i++]; charsBuf.b += Std.string(b64.charAt(b1 >> 2)); charsBuf.b += Std.string(b64.charAt((b1 << 4 | b2 >> 4) & 63)); charsBuf.b += Std.string(b64.charAt(b2 << 2 & 63)); } else if(i == max + 1) { var b1 = v1.b[i++]; charsBuf.b += Std.string(b64.charAt(b1 >> 2)); charsBuf.b += Std.string(b64.charAt(b1 << 4 & 63)); } var chars = charsBuf.b; this.buf.b += Std.string("s"); this.buf.b += Std.string(chars.length); this.buf.b += Std.string(":"); this.buf.b += Std.string(chars); break; default: this.cache.pop(); if(v.hxSerialize != null) { this.buf.b += Std.string("C"); this.serializeString(Type.getClassName(c)); this.cache.push(v); v.hxSerialize(this); this.buf.b += Std.string("g"); } else { this.buf.b += Std.string("c"); this.serializeString(Type.getClassName(c)); this.cache.push(v); this.serializeFields(v); } } break; case 4: if(this.useCache && this.serializeRef(v)) return; this.buf.b += Std.string("o"); this.serializeFields(v); break; case 7: var e = $e[2]; if(this.useCache && this.serializeRef(v)) return; this.cache.pop(); this.buf.b += Std.string(this.useEnumIndex?"j":"w"); this.serializeString(Type.getEnumName(e)); if(this.useEnumIndex) { this.buf.b += Std.string(":"); this.buf.b += Std.string(v[1]); } else this.serializeString(v[0]); this.buf.b += Std.string(":"); var l = v.length; this.buf.b += Std.string(l - 2); var _g = 2; while(_g < l) { var i = _g++; this.serialize(v[i]); } this.cache.push(v); break; case 5: throw "Cannot serialize function"; break; default: throw "Cannot serialize " + Std.string(v); } } ,serializeFields: function(v) { var _g = 0, _g1 = Reflect.fields(v); while(_g < _g1.length) { var f = _g1[_g]; ++_g; this.serializeString(f); this.serialize(Reflect.field(v,f)); } this.buf.b += Std.string("g"); } ,serializeRef: function(v) { var vt = typeof(v); var _g1 = 0, _g = this.cache.length; while(_g1 < _g) { var i = _g1++; var ci = this.cache[i]; if(typeof(ci) == vt && ci == v) { this.buf.b += Std.string("r"); this.buf.b += Std.string(i); return true; } } this.cache.push(v); return false; } ,serializeString: function(s) { var x = this.shash.get(s); if(x != null) { this.buf.b += Std.string("R"); this.buf.b += Std.string(x); return; } this.shash.set(s,this.scount++); this.buf.b += Std.string("y"); s = StringTools.urlEncode(s); this.buf.b += Std.string(s.length); this.buf.b += Std.string(":"); this.buf.b += Std.string(s); } ,toString: function() { return this.buf.b; } ,useEnumIndex: null ,useCache: null ,scount: null ,shash: null ,cache: null ,buf: null ,__class__: haxe.Serializer } haxe.Timer = $hxClasses["haxe.Timer"] = function(time_ms) { var me = this; this.id = window.setInterval(function() { me.run(); },time_ms); }; haxe.Timer.__name__ = ["haxe","Timer"]; haxe.Timer.delay = function(f,time_ms) { var t = new haxe.Timer(time_ms); t.run = function() { t.stop(); f(); }; return t; } haxe.Timer.measure = function(f,pos) { var t0 = haxe.Timer.stamp(); var r = f(); haxe.Log.trace(haxe.Timer.stamp() - t0 + "s",pos); return r; } haxe.Timer.stamp = function() { return new Date().getTime() / 1000; } haxe.Timer.prototype = { run: function() { } ,stop: function() { if(this.id == null) return; window.clearInterval(this.id); this.id = null; } ,id: null ,__class__: haxe.Timer } haxe.Unserializer = $hxClasses["haxe.Unserializer"] = function(buf) { this.buf = buf; this.length = buf.length; this.pos = 0; this.scache = new Array(); this.cache = new Array(); var r = haxe.Unserializer.DEFAULT_RESOLVER; if(r == null) { r = Type; haxe.Unserializer.DEFAULT_RESOLVER = r; } this.setResolver(r); }; haxe.Unserializer.__name__ = ["haxe","Unserializer"]; haxe.Unserializer.initCodes = function() { var codes = new Array(); var _g1 = 0, _g = haxe.Unserializer.BASE64.length; while(_g1 < _g) { var i = _g1++; codes[haxe.Unserializer.BASE64.charCodeAt(i)] = i; } return codes; } haxe.Unserializer.run = function(v) { return new haxe.Unserializer(v).unserialize(); } haxe.Unserializer.prototype = { unserialize: function() { switch(this.buf.charCodeAt(this.pos++)) { case 110: return null; case 116: return true; case 102: return false; case 122: return 0; case 105: return this.readDigits(); case 100: var p1 = this.pos; while(true) { var c = this.buf.charCodeAt(this.pos); if(c >= 43 && c < 58 || c == 101 || c == 69) this.pos++; else break; } return Std.parseFloat(HxOverrides.substr(this.buf,p1,this.pos - p1)); case 121: var len = this.readDigits(); if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid string length"; var s = HxOverrides.substr(this.buf,this.pos,len); this.pos += len; s = StringTools.urlDecode(s); this.scache.push(s); return s; case 107: return Math.NaN; case 109: return Math.NEGATIVE_INFINITY; case 112: return Math.POSITIVE_INFINITY; case 97: var buf = this.buf; var a = new Array(); this.cache.push(a); while(true) { var c = this.buf.charCodeAt(this.pos); if(c == 104) { this.pos++; break; } if(c == 117) { this.pos++; var n = this.readDigits(); a[a.length + n - 1] = null; } else a.push(this.unserialize()); } return a; case 111: var o = { }; this.cache.push(o); this.unserializeObject(o); return o; case 114: var n = this.readDigits(); if(n < 0 || n >= this.cache.length) throw "Invalid reference"; return this.cache[n]; case 82: var n = this.readDigits(); if(n < 0 || n >= this.scache.length) throw "Invalid string reference"; return this.scache[n]; case 120: throw this.unserialize(); break; case 99: var name = this.unserialize(); var cl = this.resolver.resolveClass(name); if(cl == null) throw "Class not found " + name; var o = Type.createEmptyInstance(cl); this.cache.push(o); this.unserializeObject(o); return o; case 119: var name = this.unserialize(); var edecl = this.resolver.resolveEnum(name); if(edecl == null) throw "Enum not found " + name; var e = this.unserializeEnum(edecl,this.unserialize()); this.cache.push(e); return e; case 106: var name = this.unserialize(); var edecl = this.resolver.resolveEnum(name); if(edecl == null) throw "Enum not found " + name; this.pos++; var index = this.readDigits(); var tag = Type.getEnumConstructs(edecl)[index]; if(tag == null) throw "Unknown enum index " + name + "@" + index; var e = this.unserializeEnum(edecl,tag); this.cache.push(e); return e; case 108: var l = new List(); this.cache.push(l); var buf = this.buf; while(this.buf.charCodeAt(this.pos) != 104) l.add(this.unserialize()); this.pos++; return l; case 98: var h = new Hash(); this.cache.push(h); var buf = this.buf; while(this.buf.charCodeAt(this.pos) != 104) { var s = this.unserialize(); h.set(s,this.unserialize()); } this.pos++; return h; case 113: var h = new IntHash(); this.cache.push(h); var buf = this.buf; var c = this.buf.charCodeAt(this.pos++); while(c == 58) { var i = this.readDigits(); h.set(i,this.unserialize()); c = this.buf.charCodeAt(this.pos++); } if(c != 104) throw "Invalid IntHash format"; return h; case 118: var d = HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19)); this.cache.push(d); this.pos += 19; return d; case 115: var len = this.readDigits(); var buf = this.buf; if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid bytes length"; var codes = haxe.Unserializer.CODES; if(codes == null) { codes = haxe.Unserializer.initCodes(); haxe.Unserializer.CODES = codes; } var i = this.pos; var rest = len & 3; var size = (len >> 2) * 3 + (rest >= 2?rest - 1:0); var max = i + (len - rest); var bytes = haxe.io.Bytes.alloc(size); var bpos = 0; while(i < max) { var c1 = codes[buf.charCodeAt(i++)]; var c2 = codes[buf.charCodeAt(i++)]; bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255; var c3 = codes[buf.charCodeAt(i++)]; bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255; var c4 = codes[buf.charCodeAt(i++)]; bytes.b[bpos++] = (c3 << 6 | c4) & 255; } if(rest >= 2) { var c1 = codes[buf.charCodeAt(i++)]; var c2 = codes[buf.charCodeAt(i++)]; bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255; if(rest == 3) { var c3 = codes[buf.charCodeAt(i++)]; bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255; } } this.pos += len; this.cache.push(bytes); return bytes; case 67: var name = this.unserialize(); var cl = this.resolver.resolveClass(name); if(cl == null) throw "Class not found " + name; var o = Type.createEmptyInstance(cl); this.cache.push(o); o.hxUnserialize(this); if(this.buf.charCodeAt(this.pos++) != 103) throw "Invalid custom data"; return o; default: } this.pos--; throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos; } ,unserializeEnum: function(edecl,tag) { if(this.buf.charCodeAt(this.pos++) != 58) throw "Invalid enum format"; var nargs = this.readDigits(); if(nargs == 0) return Type.createEnum(edecl,tag); var args = new Array(); while(nargs-- > 0) args.push(this.unserialize()); return Type.createEnum(edecl,tag,args); } ,unserializeObject: function(o) { while(true) { if(this.pos >= this.length) throw "Invalid object"; if(this.buf.charCodeAt(this.pos) == 103) break; var k = this.unserialize(); if(!js.Boot.__instanceof(k,String)) throw "Invalid object key"; var v = this.unserialize(); o[k] = v; } this.pos++; } ,readDigits: function() { var k = 0; var s = false; var fpos = this.pos; while(true) { var c = this.buf.charCodeAt(this.pos); if(c != c) break; if(c == 45) { if(this.pos != fpos) break; s = true; this.pos++; continue; } if(c < 48 || c > 57) break; k = k * 10 + (c - 48); this.pos++; } if(s) k *= -1; return k; } ,get: function(p) { return this.buf.charCodeAt(p); } ,getResolver: function() { return this.resolver; } ,setResolver: function(r) { if(r == null) this.resolver = { resolveClass : function(_) { return null; }, resolveEnum : function(_) { return null; }}; else this.resolver = r; } ,resolver: null ,scache: null ,cache: null ,length: null ,pos: null ,buf: null ,__class__: haxe.Unserializer } if(!haxe.io) haxe.io = {} haxe.io.Bytes = $hxClasses["haxe.io.Bytes"] = function(length,b) { this.length = length; this.b = b; }; haxe.io.Bytes.__name__ = ["haxe","io","Bytes"]; haxe.io.Bytes.alloc = function(length) { var a = new Array(); var _g = 0; while(_g < length) { var i = _g++; a.push(0); } return new haxe.io.Bytes(length,a); } haxe.io.Bytes.ofString = function(s) { var a = new Array(); var _g1 = 0, _g = s.length; while(_g1 < _g) { var i = _g1++; var c = s.charCodeAt(i); if(c <= 127) a.push(c); else if(c <= 2047) { a.push(192 | c >> 6); a.push(128 | c & 63); } else if(c <= 65535) { a.push(224 | c >> 12); a.push(128 | c >> 6 & 63); a.push(128 | c & 63); } else { a.push(240 | c >> 18); a.push(128 | c >> 12 & 63); a.push(128 | c >> 6 & 63); a.push(128 | c & 63); } } return new haxe.io.Bytes(a.length,a); } haxe.io.Bytes.ofData = function(b) { return new haxe.io.Bytes(b.length,b); } haxe.io.Bytes.prototype = { getData: function() { return this.b; } ,toHex: function() { var s = new StringBuf(); var chars = []; var str = "0123456789abcdef"; var _g1 = 0, _g = str.length; while(_g1 < _g) { var i = _g1++; chars.push(HxOverrides.cca(str,i)); } var _g1 = 0, _g = this.length; while(_g1 < _g) { var i = _g1++; var c = this.b[i]; s.b += String.fromCharCode(chars[c >> 4]); s.b += String.fromCharCode(chars[c & 15]); } return s.b; } ,toString: function() { return this.readString(0,this.length); } ,readString: function(pos,len) { if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds; var s = ""; var b = this.b; var fcc = String.fromCharCode; var i = pos; var max = pos + len; while(i < max) { var c = b[i++]; if(c < 128) { if(c == 0) break; s += fcc(c); } else if(c < 224) s += fcc((c & 63) << 6 | b[i++] & 127); else if(c < 240) { var c2 = b[i++]; s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127); } else { var c2 = b[i++]; var c3 = b[i++]; s += fcc((c & 15) << 18 | (c2 & 127) << 12 | c3 << 6 & 127 | b[i++] & 127); } } return s; } ,compare: function(other) { var b1 = this.b; var b2 = other.b; var len = this.length < other.length?this.length:other.length; var _g = 0; while(_g < len) { var i = _g++; if(b1[i] != b2[i]) return b1[i] - b2[i]; } return this.length - other.length; } ,sub: function(pos,len) { if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds; return new haxe.io.Bytes(len,this.b.slice(pos,pos + len)); } ,blit: function(pos,src,srcpos,len) { if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) throw haxe.io.Error.OutsideBounds; var b1 = this.b; var b2 = src.b; if(b1 == b2 && pos > srcpos) { var i = len; while(i > 0) { i--; b1[i + pos] = b2[i + srcpos]; } return; } var _g = 0; while(_g < len) { var i = _g++; b1[i + pos] = b2[i + srcpos]; } } ,set: function(pos,v) { this.b[pos] = v & 255; } ,get: function(pos) { return this.b[pos]; } ,b: null ,length: null ,__class__: haxe.io.Bytes } haxe.io.Error = $hxClasses["haxe.io.Error"] = { __ename__ : ["haxe","io","Error"], __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] } haxe.io.Error.Blocked = ["Blocked",0]; haxe.io.Error.Blocked.toString = $estr; haxe.io.Error.Blocked.__enum__ = haxe.io.Error; haxe.io.Error.Overflow = ["Overflow",1]; haxe.io.Error.Overflow.toString = $estr; haxe.io.Error.Overflow.__enum__ = haxe.io.Error; haxe.io.Error.OutsideBounds = ["OutsideBounds",2]; haxe.io.Error.OutsideBounds.toString = $estr; haxe.io.Error.OutsideBounds.__enum__ = haxe.io.Error; haxe.io.Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe.io.Error; $x.toString = $estr; return $x; } if(!haxe.remoting) haxe.remoting = {} haxe.remoting.Connection = $hxClasses["haxe.remoting.Connection"] = function() { } haxe.remoting.Connection.__name__ = ["haxe","remoting","Connection"]; haxe.remoting.Connection.prototype = { call: null ,resolve: null ,__class__: haxe.remoting.Connection } haxe.remoting.Context = $hxClasses["haxe.remoting.Context"] = function() { this.objects = new Hash(); }; haxe.remoting.Context.__name__ = ["haxe","remoting","Context"]; haxe.remoting.Context.share = function(name,obj) { var ctx = new haxe.remoting.Context(); ctx.addObject(name,obj); return ctx; } haxe.remoting.Context.prototype = { call: function(path,params) { if(path.length < 2) throw "Invalid path '" + path.join(".") + "'"; var inf = this.objects.get(path[0]); if(inf == null) throw "No such object " + path[0]; var o = inf.obj; var m = Reflect.field(o,path[1]); if(path.length > 2) { if(!inf.rec) throw "Can't access " + path.join("."); var _g1 = 2, _g = path.length; while(_g1 < _g) { var i = _g1++; o = m; m = Reflect.field(o,path[i]); } } if(!Reflect.isFunction(m)) throw "No such method " + path.join("."); return m.apply(o,params); } ,addObject: function(name,obj,recursive) { this.objects.set(name,{ obj : obj, rec : recursive}); } ,objects: null ,__class__: haxe.remoting.Context } haxe.remoting.HttpConnection = $hxClasses["haxe.remoting.HttpConnection"] = function(url,path) { this.__url = url; this.__path = path; }; haxe.remoting.HttpConnection.__name__ = ["haxe","remoting","HttpConnection"]; haxe.remoting.HttpConnection.__interfaces__ = [haxe.remoting.Connection]; haxe.remoting.HttpConnection.urlConnect = function(url) { return new haxe.remoting.HttpConnection(url,[]); } haxe.remoting.HttpConnection.processRequest = function(requestData,ctx) { try { var u = new haxe.Unserializer(requestData); var path = u.unserialize(); var args = u.unserialize(); var data = ctx.call(path,args); var s = new haxe.Serializer(); s.serialize(data); return "hxr" + s.toString(); } catch( e ) { var s = new haxe.Serializer(); s.serializeException(e); return "hxr" + s.toString(); } } haxe.remoting.HttpConnection.prototype = { call: function(params) { var data = null; var h = new haxe.Http(this.__url); h.async = false; var s = new haxe.Serializer(); s.serialize(this.__path); s.serialize(params); h.setHeader("X-Haxe-Remoting","1"); h.setParameter("__x",s.toString()); h.onData = function(d) { data = d; }; h.onError = function(e) { throw e; }; h.request(true); if(HxOverrides.substr(data,0,3) != "hxr") throw "Invalid response : '" + data + "'"; data = HxOverrides.substr(data,3,null); return new haxe.Unserializer(data).unserialize(); } ,resolve: function(name) { var c = new haxe.remoting.HttpConnection(this.__url,this.__path.slice()); c.__path.push(name); return c; } ,__path: null ,__url: null ,__class__: haxe.remoting.HttpConnection } var js = js || {} js.Boot = $hxClasses["js.Boot"] = function() { } js.Boot.__name__ = ["js","Boot"]; js.Boot.__unhtml = function(s) { return s.split("&").join("&").split("<").join("<").split(">").join(">"); } js.Boot.__trace = function(v,i) { var msg = i != null?i.fileName + ":" + i.lineNumber + ": ":""; msg += js.Boot.__string_rec(v,""); var d; if(typeof(document) != "undefined" && (d = document.getElementById("haxe:trace")) != null) d.innerHTML += js.Boot.__unhtml(msg) + "
"; else if(typeof(console) != "undefined" && console.log != null) console.log(msg); } js.Boot.__clear_trace = function() { var d = document.getElementById("haxe:trace"); if(d != null) d.innerHTML = ""; } js.Boot.isClass = function(o) { return o.__name__; } js.Boot.isEnum = function(e) { return e.__ename__; } js.Boot.getClass = function(o) { return o.__class__; } js.Boot.__string_rec = function(o,s) { if(o == null) return "null"; if(s.length >= 5) return "<...>"; var t = typeof(o); if(t == "function" && (o.__name__ || o.__ename__)) t = "object"; switch(t) { case "object": if(o instanceof Array) { if(o.__enum__) { if(o.length == 2) return o[0]; var str = o[0] + "("; s += "\t"; var _g1 = 2, _g = o.length; while(_g1 < _g) { var i = _g1++; if(i != 2) str += "," + js.Boot.__string_rec(o[i],s); else str += js.Boot.__string_rec(o[i],s); } return str + ")"; } var l = o.length; var i; var str = "["; s += "\t"; var _g = 0; while(_g < l) { var i1 = _g++; str += (i1 > 0?",":"") + js.Boot.__string_rec(o[i1],s); } str += "]"; return str; } var tostr; try { tostr = o.toString; } catch( e ) { return "???"; } if(tostr != null && tostr != Object.toString) { var s2 = o.toString(); if(s2 != "[object Object]") return s2; } var k = null; var str = "{\n"; s += "\t"; var hasp = o.hasOwnProperty != null; for( var k in o ) { ; if(hasp && !o.hasOwnProperty(k)) { continue; } if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { continue; } if(str.length != 2) str += ", \n"; str += s + k + " : " + js.Boot.__string_rec(o[k],s); } s = s.substring(1); str += "\n" + s + "}"; return str; case "function": return ""; case "string": return o; default: return String(o); } } js.Boot.__interfLoop = function(cc,cl) { if(cc == null) return false; if(cc == cl) return true; var intf = cc.__interfaces__; if(intf != null) { var _g1 = 0, _g = intf.length; while(_g1 < _g) { var i = _g1++; var i1 = intf[i]; if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true; } } return js.Boot.__interfLoop(cc.__super__,cl); } js.Boot.__instanceof = function(o,cl) { try { if(o instanceof cl) { if(cl == Array) return o.__enum__ == null; return true; } if(js.Boot.__interfLoop(o.__class__,cl)) return true; } catch( e ) { if(cl == null) return false; } switch(cl) { case Int: return Math.ceil(o%2147483648.0) === o; case Float: return typeof(o) == "number"; case Bool: return o === true || o === false; case String: return typeof(o) == "string"; case Dynamic: return true; default: if(o == null) return false; if(cl == Class && o.__name__ != null) return true; else null; if(cl == Enum && o.__ename__ != null) return true; else null; return o.__enum__ == cl; } } js.Boot.__cast = function(o,t) { if(js.Boot.__instanceof(o,t)) return o; else throw "Cannot cast " + Std.string(o) + " to " + Std.string(t); } js.Lib = $hxClasses["js.Lib"] = function() { } js.Lib.__name__ = ["js","Lib"]; js.Lib.document = null; js.Lib.window = null; js.Lib.debug = function() { debugger; } js.Lib.alert = function(v) { alert(js.Boot.__string_rec(v,"")); } js.Lib.eval = function(code) { return eval(code); } js.Lib.setErrorHandler = function(f) { js.Lib.onerror = f; } var $_; function $bind(o,m) { var f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; return f; }; if(Array.prototype.indexOf) HxOverrides.remove = function(a,o) { var i = a.indexOf(o); if(i == -1) return false; a.splice(i,1); return true; }; else null; Math.__name__ = ["Math"]; Math.NaN = Number.NaN; Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY; Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY; $hxClasses.Math = Math; Math.isFinite = function(i) { return isFinite(i); }; Math.isNaN = function(i) { return isNaN(i); }; String.prototype.__class__ = $hxClasses.String = String; String.__name__ = ["String"]; Array.prototype.__class__ = $hxClasses.Array = Array; Array.__name__ = ["Array"]; Date.prototype.__class__ = $hxClasses.Date = Date; Date.__name__ = ["Date"]; var Int = $hxClasses.Int = { __name__ : ["Int"]}; var Dynamic = $hxClasses.Dynamic = { __name__ : ["Dynamic"]}; var Float = $hxClasses.Float = Number; Float.__name__ = ["Float"]; var Bool = $hxClasses.Bool = Boolean; Bool.__ename__ = ["Bool"]; var Class = $hxClasses.Class = { __name__ : ["Class"]}; var Enum = { }; var Void = $hxClasses.Void = { __ename__ : ["Void"]}; if(typeof(JSON) != "undefined") haxe.Json = JSON; if(typeof document != "undefined") js.Lib.document = document; if(typeof window != "undefined") { js.Lib.window = window; js.Lib.window.onerror = function(msg,url,line) { var f = js.Lib.onerror; if(f == null) return false; return f(msg,[url + ":" + line]); }; } js.XMLHttpRequest = window.XMLHttpRequest?XMLHttpRequest:window.ActiveXObject?function() { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch( e ) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch( e1 ) { throw "Unable to create XMLHttpRequest object."; } } }:(function($this) { var $r; throw "Unable to create XMLHttpRequest object."; return $r; }(this)); com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE = 1; com.wiris.js.JsPluginViewer.DEBUG = false; com.wiris.js.JsPluginViewer.TECH = "ruby"; haxe.Serializer.USE_CACHE = false; haxe.Serializer.USE_ENUM_INDEX = false; haxe.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; haxe.Unserializer.DEFAULT_RESOLVER = Type; haxe.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; haxe.Unserializer.CODES = null; haxe.remoting.HttpConnection.TIMEOUT = 10; js.Lib.onerror = null; com.wiris.js.JsPluginViewer.main(); delete Array.prototype.__class__; }());