Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
/*
 * Jsonix is a JavaScript library which allows you to convert between XML
 * and JavaScript object structures.
 *
 * Copyright (c) 2010 - 2014, Alexey Valikov, Highsource.org
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the Alexey Valikov nor the
 *       names of contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL ALEXEY VALIKOV BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*!
 * EventEmitter v4.2.7 - git.io/ee
 * Oliver Caldwell
 * MIT license
 * @preserve
 */

(function(){var e,t,n,r,i={}.hasOwnProperty;e={LF:"\n",NULL:"\0"},n=function(){function t(e,t,n){this.command=e,this.headers=t!=null?t:{},this.body=n!=null?n:""}return t.prototype.toString=function(){var t,n,r,s;t=[this.command],s=this.headers;for(n in s){if(!i.call(s,n))continue;r=s[n],t.push(""+n+":"+r)}return this.body&&t.push("content-length:"+(""+this.body).length),t.push(e.LF+this.body),t.join(e.LF)},t._unmarshallSingle=function(n){var r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;o=n.search(RegExp(""+e.LF+e.LF)),u=n.substring(0,o).split(e.LF),s=u.shift(),a={},d=function(e){return e.replace(/^\s+|\s+$/g,"")},h=l=null;for(f=v=0,g=u.length;0<=g?v<g:v>g;f=0<=g?++v:--v)h=u[f],l=h.indexOf(":"),a[d(h.substring(0,l))]=d(h.substring(l+1));r="",p=o+2;if(a["content-length"])c=parseInt(a["content-length"]),r=(""+n).substring(p,p+c);else{i=null;for(f=m=p,y=n.length;p<=y?m<y:m>y;f=p<=y?++m:--m){i=n.charAt(f);if(i===e.NULL)break;r+=i}}return new t(s,a,r)},t.unmarshall=function(n){var r;return function(){var i,s,o,u;o=n.split(RegExp(""+e.NULL+e.LF+"*")),u=[];for(i=0,s=o.length;i<s;i++)r=o[i],(r!=null?r.length:void 0)>0&&u.push(t._unmarshallSingle(r));return u}()},t.marshall=function(n,r,i){var s;return s=new t(n,r,i),s.toString()+e.NULL},t}(),t=function(){function t(e){this.ws=e,this.ws.binaryType="arraybuffer",this.counter=0,this.connected=!1,this.heartbeat={outgoing:1e4,incoming:1e4},this.subscriptions={}}return t.prototype._transmit=function(e,t,r){var i;return i=n.marshall(e,t,r),typeof this.debug=="function"&&this.debug(">>> "+i),this.ws.send(i)},t.prototype._setupHeartbeat=function(t){var n,i,s,o,u,a,f=this;if((u=t.version)!==r.VERSIONS.V1_1&&u!==r.VERSIONS.V1_2)return;a=function(){var e,n,r,i;r=t["heart-beat"].split(","),i=[];for(e=0,n=r.length;e<n;e++)o=r[e],i.push(parseInt(o));return i}(),i=a[0],n=a[1],this.heartbeat.outgoing!==0&&n!==0&&(s=Math.max(this.heartbeat.outgoing,n),typeof this.debug=="function"&&this.debug("send PING every "+s+"ms"),this.pinger=typeof window!="undefined"&&window!==null?window.setInterval(function(){return f.ws.send(e.LF),typeof f.debug=="function"?f.debug(">>> PING"):void 0},s):void 0);if(this.heartbeat.incoming!==0&&i!==0)return s=Math.max(this.heartbeat.incoming,i),typeof this.debug=="function"&&this.debug("check PONG every "+s+"ms"),this.ponger=typeof window!="undefined"&&window!==null?window.setInterval(function(){var e;e=Date.now()-f.serverActivity;if(e>s*2)return typeof f.debug=="function"&&f.debug("did not receive server activity for the last "+e+"ms"),f._cleanUp()},s):void 0},t.prototype.connect=function(t,i,s,o,u){var a=this;return this.connectCallback=s,typeof this.debug=="function"&&this.debug("Opening Web Socket..."),this.ws.onmessage=function(t){var r,i,s,u,f,l,c,h,p;s=typeof ArrayBuffer!="undefined"&&t.data instanceof ArrayBuffer?(r=new Uint8Array(t.data),typeof a.debug=="function"?a.debug("--- got data length: "+r.length):void 0,function(){var e,t,n;n=[];for(e=0,t=r.length;e<t;e++)i=r[e],n.push(String.fromCharCode(i));return n}().join("")):t.data,a.serverActivity=Date.now();if(s===e.LF){typeof a.debug=="function"&&a.debug("<<< PONG");return}typeof a.debug=="function"&&a.debug("<<< "+s),h=n.unmarshall(s),p=[];for(l=0,c=h.length;l<c;l++){u=h[l];switch(u.command){case"CONNECTED":typeof a.debug=="function"&&a.debug("connected to server "+u.headers.server),a.connected=!0,a._setupHeartbeat(u.headers),p.push(typeof a.connectCallback=="function"?a.connectCallback(u):void 0);break;case"MESSAGE":f=a.subscriptions[u.headers.subscription],p.push(typeof f=="function"?f(u):void 0);break;case"RECEIPT":p.push(typeof a.onreceipt=="function"?a.onreceipt(u):void 0);break;case"ERROR":p.push(typeof o=="function"?o(u):void 0);break;default:p.push(typeof a.debug=="function"?a.debug("Unhandled frame: "+u):void 0)}}return p},this.ws.onclose=function(){var e;return e="Whoops! Lost connection to "+a.ws.url,typeof a.debug=="function"&&a.debug(e),typeof o=="function"?o(e):void 0},this.ws.onopen=function(){var e;return typeof a.debug=="function"&&a.debug("Web Socket Opened..."),e={"accept-version":r.VERSIONS.supportedVersions(),"heart-beat":[a.heartbeat.outgoing,a.heartbeat.incoming].join(",")},u&&(e.host=u),t&&(e.login=t),i&&(e.passcode=i),a._transmit("CONNECT",e)}},t.prototype.disconnect=function(e){return this._transmit("DISCONNECT"),this.ws.onclose=null,this._cleanUp(),typeof e=="function"?e():void 0},t.prototype._cleanUp=function(){this.ws.close(),this.connected=!1,this.pinger&&typeof window!="undefined"&&window!==null&&window.clearInterval(this.pinger);if(this.ponger)return typeof window!="undefined"&&window!==null?window.clearInterval(this.ponger):void 0},t.prototype.send=function(e,t,n){return t==null&&(t={}),n==null&&(n=""),t.destination=e,this._transmit("SEND",t,n)},t.prototype.subscribe=function(e,t,n){return n==null&&(n={}),n.id||(n.id="sub-"+this.counter++),n.destination=e,this.subscriptions[n.id]=t,this._transmit("SUBSCRIBE",n),n.id},t.prototype.unsubscribe=function(e){return delete this.subscriptions[e],this._transmit("UNSUBSCRIBE",{id:e})},t.prototype.begin=function(e){return this._transmit("BEGIN",{transaction:e})},t.prototype.commit=function(e){return this._transmit("COMMIT",{transaction:e})},t.prototype.abort=function(e){return this._transmit("ABORT",{transaction:e})},t.prototype.ack=function(e,t,n){return n==null&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("ACK",n)},t.prototype.nack=function(e,t,n){return n==null&&(n={}),n["message-id"]=e,n.subscription=t,this._transmit("NACK",n)},t}(),r={libVersion:"2.0.0-next",VERSIONS:{V1_0:"1.0",V1_1:"1.1",V1_2:"1.2",supportedVersions:function(){return"1.1,1.0"}},client:function(e,n){var i,s;return n==null&&(n=["v10.stomp","v11.stomp"]),i=r.WebSocketClass||WebSocket,s=new i(e,n),new t(s)},over:function(e){return new t(e)},Frame:n},typeof window!="undefined"&&window!==null?window.Stomp=r:(exports.Stomp=r,r.WebSocketClass=require("./test/server.mock.js").StompServerMock)}).call(this),define("stomp",function(){});var Jsonix={singleFile:!0};typeof window=="undefined"&&(module.exports.Jsonix=Jsonix),Jsonix.Util={},Jsonix.Util.extend=function(e,t){e=e||{};if(t){for(var n in t){var r=t[n];r!==undefined&&(e[n]=r)}var i=typeof window!="undefined"&&window!==null&&typeof window.Event=="function"&&t instanceof window.Event;!i&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},Jsonix.Class=function(){var e=function(){this.initialize.apply(this,arguments)},t={},n=function(){},r,i,s;for(var o=0,u=arguments.length;o<u;++o)s=arguments[o],typeof s=="function"?(o===0&&u>1&&(i=s.prototype.initialize,s.prototype.initialize=n,t=new s,i===undefined?delete s.prototype.initialize:s.prototype.initialize=i),r=s.prototype):r=s,Jsonix.Util.extend(t,r);return e.prototype=t,e},Jsonix.XML={},Jsonix.DOM={createDocument:function(){if(typeof window=="undefined")return(new(require("xmldom").DOMImplementation)).createDocument();if(typeof document!="undefined"&&Jsonix.Util.Type.exists(document.implementation)&&Jsonix.Util.Type.isFunction(document.implementation.createDocument))return document.implementation.createDocument("","",null);if(typeof ActiveXObject!="undefined")return new ActiveXObject("MSXML2.DOMDocument");throw new Error("Error created the DOM document.")},serialize:function(e){Jsonix.Util.Ensure.ensureExists(e);if(typeof window=="undefined")return(new(require("xmldom").XMLSerializer)).serializeToString(e);if(Jsonix.Util.Type.exists(XMLSerializer))return(new XMLSerializer).serializeToString(e);if(Jsonix.Util.Type.exists(e.xml))return e.xml;throw new Error("Could not serialize the node, neither XMLSerializer nor the [xml] property were found.")},parse:function(e){Jsonix.Util.Ensure.ensureExists(e);if(typeof window=="undefined")return(new(require("xmldom").DOMParser)).parseFromString(e,"application/xml");if(typeof DOMParser!="undefined")return(new DOMParser).parseFromString(e,"application/xml");if(typeof ActiveXObject!="undefined"){var t=Jsonix.DOM.createDocument("","");return t.loadXML(e),t}var n="data:text/xml;charset=utf-8,"+encodeURIComponent(e),r=new XMLHttpRequest;return r.open("GET",n,!1),r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send(null),r.responseXML},load:function(e,t,n){var r=Jsonix.Request.INSTANCE;r.issue(e,function(e){var n;if(Jsonix.Util.Type.exists(e.responseXML)&&Jsonix.Util.Type.exists(e.responseXML.documentElement))n=e.responseXML;else{if(!Jsonix.Util.Type.isString(e.responseText))throw new Error("Response does not have valid [responseXML] or [responseText].");n=Jsonix.DOM.parse(e.responseText)}t(n)},function(t){throw new Error("Could not retrieve XML from URL ["+e+"].")},n)}},Jsonix.Request=Jsonix.Class({factories:[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP.6.0")},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){if(typeof window=="undefined"){var e=require("xmlhttprequest").XMLHttpRequest;return new e}return null}],initialize:function(){},issue:function(e,t,n,r){Jsonix.Util.Ensure.ensureString(e),Jsonix.Util.Type.exists(t)?Jsonix.Util.Ensure.ensureFunction(t):t=function(){},Jsonix.Util.Type.exists(n)?Jsonix.Util.Ensure.ensureFunction(n):n=function(){},Jsonix.Util.Type.exists(r)?Jsonix.Util.Ensure.ensureObject(r):r={};var i=this.createTransport(),s=Jsonix.Util.Type.isString(r.method)?r.method:"GET",o=Jsonix.Util.Type.isBoolean(r.async)?r.async:!0,u=Jsonix.Util.Type.isString(r.proxy)?r.proxy:Jsonix.Request.PROXY,a=Jsonix.Util.Type.isString(r.user)?r.user:null,f=Jsonix.Util.Type.isString(r.password)?r.password:null;Jsonix.Util.Type.isString(u)&&e.indexOf("http")===0&&(e=u+encodeURIComponent(e)),Jsonix.Util.Type.isString(a)?i.open(s,e,o,a,f):i.open(s,e,o);if(Jsonix.Util.Type.isObject(r.headers))for(var l in r.headers)r.headers.hasOwnProperty(l)&&i.setRequestHeader(l,r.headers[l]);var c=Jsonix.Util.Type.exists(r.data)?r.data:null;if(!o)i.send(c),this.handleTransport(i,t,n);else{var h=this;typeof window!="undefined"?(i.onreadystatechange=function(){h.handleTransport(i,t,n)},window.setTimeout(function(){i.send(c)},0)):(i.onreadystatechange=function(){h.handleTransport(i,t,n)},console.log("Sending."),i.send(c))}return i},handleTransport:function(e,t,n){e.readyState==4&&((!e.status||e.status>=200&&e.status<300)&&t(e),e.status&&(e.status<200||e.status>=300)&&n(e))},createTransport:function(){for(var e=0,t=this.factories.length;e<t;e++)try{var n=this.factories[e]();if(n!==null)return n}catch(r){}throw new Error("Could not create XML HTTP transport.")},CLASS_NAME:"Jsonix.Request"}),Jsonix.Request.INSTANCE=new Jsonix.Request,Jsonix.Request.PROXY=null,Jsonix.Schema={},Jsonix.Model={},Jsonix.Util.Type={exists:function(e){return typeof e!="undefined"&&e!==null},isString:function(e){return typeof e=="string"},isBoolean:function(e){return typeof e=="boolean"},isObject:function(e){return typeof e=="object"},isFunction:function(e){return typeof e=="function"},isNumber:function(e){return typeof e=="number"&&!isNaN(e)},isNumberOrNaN:function(e){return e===+e||Object.prototype.toString.call(e)==="[object Number]"},isNaN:function(e){return Jsonix.Util.Type.isNumberOrNaN(e)&&isNaN(e)},isArray:function(e){return!!(e&&e.concat&&e.unshift&&!e.callee)},isDate:function(e){return!!(e&&e.getTimezoneOffset&&e.setUTCFullYear)},isRegExp:function(e){return!(!(e&&e.test&&e.exec)||!e.ignoreCase&&e.ignoreCase!==!1)},isEqual:function(e,t,n){var r=Jsonix.Util.Type.isFunction(n),i=function(e,t,n){var r=slice.call(arguments),i=r.length<=1,s=i?0:r[0],o=i?r[0]:r[1],u=r[2]||1,a=Math.max(Math.ceil((o-s)/u),0),f=0,l=new Array(a);while(f<a)l[f++]=s,s+=u;return l},s=Object.keys||function(e){if(Jsonix.Util.Type.isArray(e))return i(0,e.length);var t=[];for(var n in e)e.hasOwnProperty(n)&&(t[t.length]=n);return t};if(e===t)return!0;if(Jsonix.Util.Type.isNaN(e)&&Jsonix.Util.Type.isNaN(t))return!0;var o=typeof e,u=typeof t;if(o!=u)return r&&n("Types differ ["+o+"], ["+u+"]."),!1;if(e==t)return!0;if(!e&&t||e&&!t)return r&&n("One is falsy, the other is truthy."),!1;if(Jsonix.Util.Type.isDate(e)&&Jsonix.Util.Type.isDate(t))return e.getTime()===t.getTime();if(Jsonix.Util.Type.isNaN(e)&&Jsonix.Util.Type.isNaN(t))return!1;if(Jsonix.Util.Type.isRegExp(e)&&Jsonix.Util.Type.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline;if(o!=="object")return!1;if(e.length&&e.length!==t.length)return r&&(n("Lengths differ."),n("A.length="+e.length),n("B.length="+t.length)),!1;var a=s(e),f=s(t);if(a.length!=f.length){r&&n("Different number of properties ["+a.length+"], ["+f.length+"].");for(var l=0;l<a.length;l++)r&&n("A ["+a[l]+"]="+e[a[l]]);for(var c=0;c<f.length;c++)r&&n("B ["+f[c]+"]="+t[f[c]]);return!1}for(var h=0;h<a.length;h++){var p=a[h];if(!(p in t)||!Jsonix.Util.Type.isEqual(e[p],t[p],n))return r&&(n("One of the properties differ."),n("Key: ["+p+"]."),n("Left: ["+e[p]+"]."),n("Right: ["+t[p]+"].")),!1}return!0}},Jsonix.Util.NumberUtils={isInteger:function(e){return Jsonix.Util.Type.isNumber(e)&&e%1===0}},Jsonix.Util.StringUtils={trim:String.prototype.trim?function(e){return Jsonix.Util.Ensure.ensureString(e),e.trim()}:function(e){return Jsonix.Util.Ensure.ensureString(e),e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},isEmpty:function(e){var t=e.length;if(!t)return!0;for(var n=0;n<t;n++){var r=e[n];if(r!==" "){if(r>"\r"&&r<"…")return!1;if(r<" "){if(r<"	")return!1;if(r>"…")return!1}else if(r>" ")if(r<"\u2028"){if(r<"᠎"){if(r<" ")return!1;if(r>" ")return!1}else if(r>"᠎"){if(r<" ")return!1;if(r>" ")return!1}}else if(r>"\u2029")if(r<" "){if(r<" ")return!1;if(r>" ")return!1}else if(r>" "){if(r<" ")return!1;if(r>" ")return!1}}}return!0},isNotBlank:function(e){return Jsonix.Util.Type.isString(e)&&!Jsonix.Util.StringUtils.isEmpty(e)},whitespaceCharacters:"	\n\f\r …  ᠎           \u2028\u2029   ",whitespaceCharactersMap:{"	":!0,"\n":!0,"":!0,"\f":!0,"\r":!0," ":!0,"…":!0," ":!0," ":!0,"᠎":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0," ":!0,"\u2028":!0,"\u2029":!0," ":!0," ":!0," ":!0},splitBySeparatorChars:function(e,t){Jsonix.Util.Ensure.ensureString(e),Jsonix.Util.Ensure.ensureString(t);var n=e.length;if(n===0)return[];if(t.length===1)return e.split(t);var r=[],i=1,s=0,o=0,u=!1,a=!1,f=-1,l=!1;while(s<n){if(t.indexOf(e.charAt(s))>=0){if(u||l)a=!0,i++==f&&(s=n,a=!1),r.push(e.substring(o,s)),u=!1;o=++s;continue}a=!1,u=!0,s++}return(u||l&&a)&&r.push(e.substring(o,s)),r}},Jsonix.Util.Ensure={ensureBoolean:function(e){if(!Jsonix.Util.Type.isBoolean(e))throw new Error("Argument ["+e+"] must be a boolean.")},ensureString:function(e){if(!Jsonix.Util.Type.isString(e))throw new Error("Argument ["+e+"] must be a string.")},ensureNumber:function(e){if(!Jsonix.Util.Type.isNumber(e))throw new Error("Argument ["+e+"] must be a number.")},ensureNumberOrNaN:function(e){if(!Jsonix.Util.Type.isNumberOrNaN(e))throw new Error("Argument ["+e+"] must be a number or NaN.")},ensureInteger:function(e){if(!Jsonix.Util.Type.isNumber(e))throw new Error("Argument must be an integer, but it is not a number.");if(!Jsonix.Util.NumberUtils.isInteger(e))throw new Error("Argument ["+e+"] must be an integer.")},ensureDate:function(e){if(!(e instanceof Date))throw new Error("Argument ["+e+"] must be a date.")},ensureObject:function(e){if(!Jsonix.Util.Type.isObject(e))throw new Error("Argument ["+e+"] must be an object.")},ensureArray:function(e){if(!Jsonix.Util.Type.isArray(e))throw new Error("Argument ["+e+"] must be an array.")},ensureFunction:function(e){if(!Jsonix.Util.Type.isFunction(e))throw new Error("Argument ["+e+"] must be a function.")},ensureExists:function(e){if(!Jsonix.Util.Type.exists(e))throw new Error("Argument ["+e+"] does not exist.")}},Jsonix.XML.QName=Jsonix.Class({key:null,namespaceURI:null,localPart:null,prefix:null,string:null,initialize:function(e,t,n){var r,i,s,o,u;if(!Jsonix.Util.Type.exists(t))r="",i=e,s="";else if(!Jsonix.Util.Type.exists(n)){r=Jsonix.Util.Type.exists(e)?e:"",i=t;var a=t.indexOf(":");a>0&&a<t.length?(s=t.substring(0,a),i=t.substring(a+1)):(s="",i=t)}else r=Jsonix.Util.Type.exists(e)?e:"",i=t,s=Jsonix.Util.Type.exists(n)?n:"";this.namespaceURI=r,this.localPart=i,this.prefix=s,this.key=(r!==""?"{"+r+"}":"")+i,this.string=(r!==""?"{"+r+"}":"")+(s!==""?s+":":"")+i},toString:function(){return this.string},clone:function(){return new Jsonix.XML.QName(this.namespaceURI,this.localPart,this.prefix)},equals:function(e){return e?this.namespaceURI==e.namespaceURI&&this.localPart==e.localPart:!1},CLASS_NAME:"Jsonix.XML.QName"}),Jsonix.XML.QName.fromString=function(e){var t=e.indexOf("{"),n=e.lastIndexOf("}"),r,i;t===0&&n>0&&n<e.length?(r=e.substring(1,n),i=e.substring(n+1)):(r="",i=e);var s=i.indexOf(":"),o,u;return s>0&&s<i.length?(o=i.substring(0,s),u=i.substring(s+1)):(o="",u=i),new Jsonix.XML.QName(r,u,o)},Jsonix.XML.QName.fromObject=function(e){Jsonix.Util.Ensure.ensureObject(e);if(Jsonix.Util.Type.isString(e.CLASS_NAME)&&e.CLASS_NAME==="Jsonix.XML.QName")return e;Jsonix.Util.Ensure.ensureString(e.localPart);var t=Jsonix.Util.Type.isString(e.namespaceURI)?e.namespaceURI:"",n=e.localPart,r=Jsonix.Util.Type.isString(e.prefix)?e.prefix:"";return new Jsonix.XML.QName(t,n,r)},Jsonix.XML.QName.key=function(e,t){Jsonix.Util.Ensure.ensureString(t);if(e){var n=t.indexOf(":");return n>0&&n<t.length?localName=t.substring(n+1):localName=t,"{"+e+"}"+localName}return t},Jsonix.XML.Calendar=Jsonix.Class({year:NaN,month:NaN,day:NaN,hour:NaN,minute:NaN,second:NaN,fractionalSecond:NaN,timezone:NaN,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e);if(Jsonix.Util.Type.exists(e.year)){Jsonix.Util.Ensure.ensureInteger(e.year);if(!(e.year>=-9999&&e.year<=9999))throw new Error("Invalid year ["+e.year+"].");this.year=e.year}else this.year=NaN;if(Jsonix.Util.Type.exists(e.month)){Jsonix.Util.Ensure.ensureInteger(e.month);if(!(e.month>=1&&e.month<=12))throw new Error("Invalid month ["+e.month+"].");this.month=e.month}else this.month=NaN;if(Jsonix.Util.Type.exists(e.day)){Jsonix.Util.Ensure.ensureInteger(e.day);if(!(e.day>=1&&e.day<=31))throw new Error("Invalid day ["+e.day+"].");this.day=e.day}else this.day=NaN;if(Jsonix.Util.Type.exists(e.hour)){Jsonix.Util.Ensure.ensureInteger(e.hour);if(!(e.hour>=0&&e.hour<=23))throw new Error("Invalid hour ["+e.hour+"].");this.hour=e.hour}else this.hour=NaN;if(Jsonix.Util.Type.exists(e.minute)){Jsonix.Util.Ensure.ensureInteger(e.minute);if(!(e.minute>=0&&e.minute<=59))throw new Error("Invalid minute ["+e.minute+"].");this.minute=e.minute}else this.minute=NaN;if(Jsonix.Util.Type.exists(e.second)){Jsonix.Util.Ensure.ensureInteger(e.second);if(!(e.second>=0&&e.second<=59))throw new Error("Invalid second ["+e.second+"].");this.second=e.second}else this.second=NaN;if(Jsonix.Util.Type.exists(e.fractionalSecond)){Jsonix.Util.Ensure.ensureNumber(e.fractionalSecond);if(!(e.fractionalSecond>=0&&e.fractionalSecond<1))throw new Error("Invalid fractional second ["+e.fractionalSecond+"].");this.fractionalSecond=e.fractionalSecond}else this.fractionalSecond=NaN;if(Jsonix.Util.Type.exists(e.timezone))if(Jsonix.Util.Type.isNaN(e.timezone))this.timezone=NaN;else{Jsonix.Util.Ensure.ensureInteger(e.timezone);if(!(e.timezone>=-1440&&e.timezone<1440))throw new Error("Invalid timezone ["+e.timezone+"].");this.timezone=e.timezone}else this.timezone=NaN},CLASS_NAME:"Jsonix.XML.Calendar"}),Jsonix.XML.Calendar.fromObject=function(e){return Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Type.isString(e.CLASS_NAME)&&e.CLASS_NAME==="Jsonix.XML.Calendar"?e:new Jsonix.XML.Calendar(e)},Jsonix.XML.Input=Jsonix.Class({root:null,node:null,attributes:null,eventType:null,initialize:function(e){Jsonix.Util.Ensure.ensureExists(e),this.root=e},hasNext:function(){if(this.node===null)return!0;if(this.node===this.root){var e=this.node.nodeType;return e===9&&this.eventType===8?!1:e===1&&this.eventType===2?!1:!0}return!0},next:function(){if(this.eventType===null)return this.enter(this.root);if(this.eventType===7){var e=this.node.documentElement;return e?this.enter(e):this.leave(this.node)}if(this.eventType===1){var t=this.node.firstChild;return t?this.enter(t):this.leave(this.node)}if(this.eventType===2){var n=this.node.nextSibling;return n?this.enter(n):this.leave(this.node)}return this.leave(this.node)},enter:function(e){var t=e.nodeType;this.node=e,this.attributes=null;if(t===1)return this.eventType=1,this.eventType;if(t===2)return this.eventType=10,this.eventType;if(t===3){var n=e.nodeValue;return Jsonix.Util.StringUtils.isEmpty(n)?this.eventType=6:this.eventType=4,this.eventType}if(t===4)return this.eventType=12,this.eventType;if(t===5)return this.eventType=9,this.eventType;if(t===6)return this.eventType=15,this.eventType;if(t===7)return this.eventType=3,this.eventType;if(t===8)return this.eventType=5,this.eventType;if(t===9)return this.eventType=7,this.eventType;if(t===10)return this.eventType=12,this.eventType;if(t===12)return this.eventType=14,this.eventType;throw new Error("Node type ["+t+"] is not supported.")},leave:function(e){if(e.nodeType===9){if(this.eventType==8)throw new Error("Invalid state.");return this.node=e,this.attributes=null,this.eventType=8,this.eventType}if(e.nodeType===1){if(this.eventType!=2)return this.node=e,this.attributes=null,this.eventType=2,this.eventType;var t=e.nextSibling;if(t)return this.enter(t)}var n=e.nextSibling;if(n)return this.enter(n);var r=e.parentNode;return this.node=r,this.attributes=null,r.nodeType===9?this.eventType=8:this.eventType=2,this.eventType},getName:function(){var e=this.node;return Jsonix.Util.Type.isString(e.nodeName)?Jsonix.Util.Type.isString(e.namespaceURI)?new Jsonix.XML.QName(e.namespaceURI,e.nodeName):new Jsonix.XML.QName(e.nodeName):null},getNameKey:function(){var e=this.node;return Jsonix.Util.Type.isString(e.nodeName)?Jsonix.XML.QName.key(e.namespaceURI,e.nodeName):null},getText:function(){return this.node.nodeValue},nextTag:function(){var e=this.next();while(e===7||e===4||e===12||e===6||e===3||e===5)e=this.next();if(e!==1&&e!==2)throw new Error("Expected start or end tag.");return e},getElementText:function(){if(this.eventType!=1)throw new Error("Parser must be on START_ELEMENT to read next text.");var e=this.next(),t="";while(e!==2){if(e===4||e===12||e===6||e===9)t+=this.getText();else if(e!==3&&e!==5)throw e===8?new Error("Unexpected end of document when reading element text content."):e===1?new Error("Element text content may not contain START_ELEMENT."):new Error("Unexpected event type ["+e+"].");e=this.next()}return t},getAttributeCount:function(){var e;if(this.attributes)e=this.attributes;else if(this.eventType===1)e=this.node.attributes,this.attributes=e;else{if(this.eventType!==10)throw new Error("Number of attributes can only be retrieved for START_ELEMENT or ATTRIBUTE.");e=this.node.parentNode.attributes,this.attributes=e}return e.length},getAttributeName:function(e){var t;if(this.attributes)t=this.attributes;else if(this.eventType===1)t=this.node.attributes,this.attributes=t;else{if(this.eventType!==10)throw new Error("Attribute name can only be retrieved for START_ELEMENT or ATTRIBUTE.");t=this.node.parentNode.attributes,this.attributes=t}if(e<0||e>=t.length)throw new Error("Invalid attribute index ["+e+"].");var n=t[e];return Jsonix.Util.Type.isString(n.namespaceURI)?new Jsonix.XML.QName(n.namespaceURI,n.nodeName):new Jsonix.XML.QName(n.nodeName)},getAttributeNameKey:function(e){var t;if(this.attributes)t=this.attributes;else if(this.eventType===1)t=this.node.attributes,this.attributes=t;else{if(this.eventType!==10)throw new Error("Attribute name key can only be retrieved for START_ELEMENT or ATTRIBUTE.");t=this.node.parentNode.attributes,this.attributes=t}if(e<0||e>=t.length)throw new Error("Invalid attribute index ["+e+"].");var n=t[e];return Jsonix.XML.QName.key(n.namespaceURI,n.nodeName)},getAttributeValue:function(e){var t;if(this.attributes)t=this.attributes;else if(this.eventType===1)t=this.node.attributes,this.attributes=t;else{if(this.eventType!==10)throw new Error("Attribute value can only be retrieved for START_ELEMENT or ATTRIBUTE.");t=this.node.parentNode.attributes,this.attributes=t}if(e<0||e>=t.length)throw new Error("Invalid attribute index ["+e+"].");var n=t[e];return n.nodeValue},getElement:function(){if(this.eventType===1||this.eventType===2)return this.eventType=2,this.node;throw new Error("Parser must be on START_ELEMENT or END_ELEMENT to return current element.")},CLASS_NAME:"Jsonix.XML.Input"}),Jsonix.XML.Input.START_ELEMENT=1,Jsonix.XML.Input.END_ELEMENT=2,Jsonix.XML.Input.PROCESSING_INSTRUCTION=3,Jsonix.XML.Input.CHARACTERS=4,Jsonix.XML.Input.COMMENT=5,Jsonix.XML.Input.SPACE=6,Jsonix.XML.Input.START_DOCUMENT=7,Jsonix.XML.Input.END_DOCUMENT=8,Jsonix.XML.Input.ENTITY_REFERENCE=9,Jsonix.XML.Input.ATTRIBUTE=10,Jsonix.XML.Input.DTD=11,Jsonix.XML.Input.CDATA=12,Jsonix.XML.Input.NAMESPACE=13,Jsonix.XML.Input.NOTATION_DECLARATION=14,Jsonix.XML.Input.ENTITY_DECLARATION=15,Jsonix.XML.Output=Jsonix.Class({document:null,node:null,nodes:null,xmldom:null,namespacePrefixes:null,namespacePrefixIndex:0,initialize:function(e){typeof ActiveXObject!="undefined"?this.xmldom=new ActiveXObject("Microsoft.XMLDOM"):this.xmldom=null,this.nodes=[],this.namespacePrefixes={"":""};if(Jsonix.Util.Type.isObject(e)&&Jsonix.Util.Type.isObject(e.namespacePrefixes))for(var t in e.namespacePrefixes)e.namespacePrefixes.hasOwnProperty(t)&&(this.namespacePrefixes[t]=e.namespacePrefixes[t])},destroy:function(){this.xmldom=null},writeStartDocument:function(){var e=Jsonix.DOM.createDocument();return this.document=e,this.push(e)},writeEndDocument:function(){return this.pop()},writeStartElement:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.localPart);var t=Jsonix.Util.Type.isString(e.namespaceURI)?e.namespaceURI:"",n=e.localPart,r=e.prefix||this.getPrefix(t),i=r?r+":"+n:n,s;if(Jsonix.Util.Type.isFunction(this.document.createElementNS))s=this.document.createElementNS(t,i);else{if(!this.xmldom)throw new Error("Could not create an element node.");s=this.xmldom.createNode(1,i,t)}return this.peek().appendChild(s),this.push(s)},writeEndElement:function(){return this.pop()},writeCharacters:function(e){var t;if(Jsonix.Util.Type.isFunction(this.document.createTextNode))t=this.document.createTextNode(e);else{if(!this.xmldom)throw new Error("Could not create a text node.");t=this.xmldom.createTextNode(e)}return this.peek().appendChild(t),t},writeAttribute:function(e,t){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.localPart),Jsonix.Util.Ensure.ensureString(t);var n=Jsonix.Util.Type.isString(e.namespaceURI)?e.namespaceURI:"",r=e.localPart,i=e.prefix||this.getPrefix(n),s=i?i+":"+r:r,o=this.peek();if(n==="")o.setAttribute(s,t);else if(o.setAttributeNS)o.setAttributeNS(n,s,t);else{if(!this.xmldom)throw new Error("The [setAttributeNS] method is not implemented");var u=this.document.createNode(2,s,n);u.nodeValue=t,o.setAttributeNode(u)}},writeNode:function(e){var t;return Jsonix.Util.Type.exists(this.document.importNode)?t=this.document.importNode(e,!0):t=e,this.peek().appendChild(t),t},push:function(e){return this.nodes.push(e),e},peek:function(){return this.nodes[this.nodes.length-1]},pop:function(){var e=this.nodes.pop();return e},getPrefix:function(e){var t=this.namespacePrefixes[e];return Jsonix.Util.Type.exists(t)?t:(t="p"+this.namespacePrefixIndex++,this.namespacePrefixes[e]=t,t)},CLASS_NAME:"Jsonix.XML.Output"}),Jsonix.Model.TypeInfo=Jsonix.Class({name:null,initialize:function(){},CLASS_NAME:"Jsonix.Model.TypeInfo"}),Jsonix.Schema.XSD={},Jsonix.Schema.XSD.NAMESPACE_URI="http://www.w3.org/2001/XMLSchema",Jsonix.Schema.XSD.PREFIX="xsd",Jsonix.Schema.XSD.qname=function(e){return Jsonix.Util.Ensure.ensureString(e),new Jsonix.XML.QName(Jsonix.Schema.XSD.NAMESPACE_URI,e,Jsonix.Schema.XSD.PREFIX)},Jsonix.Schema.XSD.AnyType=Jsonix.Class(Jsonix.Model.TypeInfo,{name:"AnyType",typeName:Jsonix.Schema.XSD.qname("anyType"),initialize:function(){Jsonix.Model.TypeInfo.prototype.initialize.apply(this,[])},isInstance:function(e){throw new Error("Abstract method [isInstance].")},CLASS_NAME:"Jsonix.Schema.XSD.AnyType"}),Jsonix.Schema.XSD.AnyType.INSTANCE=new Jsonix.Schema.XSD.AnyType,Jsonix.Schema.XSD.AnySimpleType=Jsonix.Class(Jsonix.Schema.XSD.AnyType,{name:"AnySimpleType",typeName:Jsonix.Schema.XSD.qname("anySimpleType"),simpleType:!0,print:function(e){throw new Error("Abstract method [print].")},parse:function(e){throw new Error("Abstract method [parse].")},unmarshal:function(e,t){var n=t.getElementText();return Jsonix.Util.StringUtils.isNotBlank(n)?this.parse(n):null},marshal:function(e,t,n){Jsonix.Util.Type.exists(t)&&n.writeCharacters(this.print(t))},build:function(e,t){},CLASS_NAME:"Jsonix.Schema.XSD.AnySimpleType"}),Jsonix.Schema.XSD.List=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:null,typeName:null,typeInfo:null,separator:" ",trimmedSeparator:Jsonix.Util.StringUtils.whitespaceCharacters,simpleType:!0,built:!1,initialize:function(e,t,n){Jsonix.Util.Ensure.ensureExists(e),this.typeInfo=e,Jsonix.Util.Type.exists(this.name)||(this.name=e.name+"*"),Jsonix.Util.Type.exists(t)&&(this.typeName=t),Jsonix.Util.Type.isString(n)?this.separator=n:this.separator=" ";var r=Jsonix.Util.StringUtils.trim(this.separator);r.length===0?this.trimmedSeparator=Jsonix.Util.StringUtils.whitespaceCharacters:this.trimmedSeparator=r},build:function(e,t){this.built||(this.typeInfo=e.resolveTypeInfo(this.typeInfo,t),this.built=!0)},print:function(e){if(!Jsonix.Util.Type.exists(e))return null;Jsonix.Util.Ensure.ensureArray(e);var t="";for(var n=0;n<e.length;n++)n>0&&(t+=this.separator),t+=this.typeInfo.print(e[n]);return t},parse:function(e){Jsonix.Util.Ensure.ensureString(e);var t=Jsonix.Util.StringUtils.splitBySeparatorChars(e,this.trimmedSeparator),n=[];for(var r=0;r<t.length;r++)n.push(this.typeInfo.parse(Jsonix.Util.StringUtils.trim(t[r])));return n},CLASS_NAME:"Jsonix.Schema.XSD.List"}),Jsonix.Schema.XSD.String=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"String",typeName:Jsonix.Schema.XSD.qname("string"),print:function(e){return Jsonix.Util.Ensure.ensureString(e),e},parse:function(e){return Jsonix.Util.Ensure.ensureString(e),e},isInstance:function(e){return Jsonix.Util.Type.isString(e)},CLASS_NAME:"Jsonix.Schema.XSD.String"}),Jsonix.Schema.XSD.String.INSTANCE=new Jsonix.Schema.XSD.String,Jsonix.Schema.XSD.String.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.String.INSTANCE),Jsonix.Schema.XSD.Strings=Jsonix.Class(Jsonix.Schema.XSD.List,{name:"Strings",initialize:function(){Jsonix.Schema.XSD.List.prototype.initialize.apply(this,[Jsonix.Schema.XSD.String.INSTANCE,Jsonix.Schema.XSD.qname("strings")," "])},CLASS_NAME:"Jsonix.Schema.XSD.Strings"}),Jsonix.Schema.XSD.Strings.INSTANCE=new Jsonix.Schema.XSD.Strings,Jsonix.Schema.XSD.NormalizedString=Jsonix.Class(Jsonix.Schema.XSD.String,{name:"NormalizedString",typeName:Jsonix.Schema.XSD.qname("normalizedString"),CLASS_NAME:"Jsonix.Schema.XSD.NormalizedString"}),Jsonix.Schema.XSD.NormalizedString.INSTANCE=new Jsonix.Schema.XSD.NormalizedString,Jsonix.Schema.XSD.NormalizedString.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NormalizedString.INSTANCE),Jsonix.Schema.XSD.Token=Jsonix.Class(Jsonix.Schema.XSD.NormalizedString,{name:"Token",typeName:Jsonix.Schema.XSD.qname("token"),CLASS_NAME:"Jsonix.Schema.XSD.Token"}),Jsonix.Schema.XSD.Token.INSTANCE=new Jsonix.Schema.XSD.Token,Jsonix.Schema.XSD.Token.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Token.INSTANCE),Jsonix.Schema.XSD.Language=Jsonix.Class(Jsonix.Schema.XSD.Token,{name:"Language",typeName:Jsonix.Schema.XSD.qname("language"),CLASS_NAME:"Jsonix.Schema.XSD.Language"}),Jsonix.Schema.XSD.Language.INSTANCE=new Jsonix.Schema.XSD.Language,Jsonix.Schema.XSD.Language.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Language.INSTANCE),Jsonix.Schema.XSD.Name=Jsonix.Class(Jsonix.Schema.XSD.Token,{name:"Name",typeName:Jsonix.Schema.XSD.qname("Name"),CLASS_NAME:"Jsonix.Schema.XSD.Name"}),Jsonix.Schema.XSD.Name.INSTANCE=new Jsonix.Schema.XSD.Name,Jsonix.Schema.XSD.Name.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Name.INSTANCE),Jsonix.Schema.XSD.NCName=Jsonix.Class(Jsonix.Schema.XSD.Name,{name:"NCName",typeName:Jsonix.Schema.XSD.qname("NCName"),CLASS_NAME:"Jsonix.Schema.XSD.NCName"}),Jsonix.Schema.XSD.NCName.INSTANCE=new Jsonix.Schema.XSD.NCName,Jsonix.Schema.XSD.NCName.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NCName.INSTANCE),Jsonix.Schema.XSD.NMToken=Jsonix.Class(Jsonix.Schema.XSD.Token,{name:"NMToken",typeName:Jsonix.Schema.XSD.qname("NMTOKEN"),CLASS_NAME:"Jsonix.Schema.XSD.NMToken"}),Jsonix.Schema.XSD.NMToken.INSTANCE=new Jsonix.Schema.XSD.NMToken,Jsonix.Schema.XSD.NMTokens=Jsonix.Class(Jsonix.Schema.XSD.List,{name:"NMTokens",initialize:function(){Jsonix.Schema.XSD.List.prototype.initialize.apply(this,[Jsonix.Schema.XSD.NMToken.INSTANCE,Jsonix.Schema.XSD.qname("NMTOKEN")," "])},CLASS_NAME:"Jsonix.Schema.XSD.NMTokens"}),Jsonix.Schema.XSD.NMTokens.INSTANCE=new Jsonix.Schema.XSD.NMTokens,Jsonix.Schema.XSD.Boolean=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Boolean",typeName:Jsonix.Schema.XSD.qname("boolean"),print:function(e){return Jsonix.Util.Ensure.ensureBoolean(e),e?"true":"false"},parse:function(e){Jsonix.Util.Ensure.ensureString(e);if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;throw new Error("Either [true], [1], [0] or [false] expected as boolean value.")},isInstance:function(e){return Jsonix.Util.Type.isBoolean(e)},CLASS_NAME:"Jsonix.Schema.XSD.Boolean"}),Jsonix.Schema.XSD.Boolean.INSTANCE=new Jsonix.Schema.XSD.Boolean,Jsonix.Schema.XSD.Boolean.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Boolean.INSTANCE),Jsonix.Schema.XSD.Base64Binary=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Base64Binary",typeName:Jsonix.Schema.XSD.qname("base64Binary"),charToByte:{},byteToChar:[],initialize:function(){Jsonix.Schema.XSD.AnySimpleType.prototype.initialize.apply(this);var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(var t=0;t<e.length;t++){var n=e.charAt(t),r=e.charCodeAt(t);this.byteToChar[t]=n,this.charToByte[n]=t}},print:function(e){return Jsonix.Util.Ensure.ensureArray(e),this.encode(e)},parse:function(e){return Jsonix.Util.Ensure.ensureString(e),this.decode(e)},encode:function(e){var t="",n,r,i,s,o,u,a,f=0,l=0,c=e.length;for(f=0;f<c;f+=3)n=e[f]&255,s=this.byteToChar[n>>2],f+1<c?(r=e[f+1]&255,o=this.byteToChar[(n&3)<<4|r>>4],f+2<c?(i=e[f+2]&255,u=this.byteToChar[(r&15)<<2|i>>6],a=this.byteToChar[i&63]):(u=this.byteToChar[(r&15)<<2],a="=")):(o=this.byteToChar[(n&3)<<4],u="=",a="="),t=t+s+o+u+a;return t},decode:function(e){input=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");var t=input.length/4*3;input.charAt(input.length-1)==="="&&t--,input.charAt(input.length-2)==="="&&t--;var n=new Array(t),r,i,s,o,u,a,f,l=0,c=0;for(l=0;l<t;l+=3)o=this.charToByte[input.charAt(c++)],u=this.charToByte[input.charAt(c++)],a=this.charToByte[input.charAt(c++)],f=this.charToByte[input.charAt(c++)],r=o<<2|u>>4,i=(u&15)<<4|a>>2,s=(a&3)<<6|f,n[l]=r,a!=64&&(n[l+1]=i),f!=64&&(n[l+2]=s);return n},isInstance:function(e){return Jsonix.Util.Type.isArray(e)},CLASS_NAME:"Jsonix.Schema.XSD.Base64Binary"}),Jsonix.Schema.XSD.Base64Binary.INSTANCE=new Jsonix.Schema.XSD.Base64Binary,Jsonix.Schema.XSD.Base64Binary.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Base64Binary.INSTANCE),Jsonix.Schema.XSD.HexBinary=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"HexBinary",typeName:Jsonix.Schema.XSD.qname("hexBinary"),charToQuartet:{},byteToDuplet:[],initialize:function(){Jsonix.Schema.XSD.AnySimpleType.prototype.initialize.apply(this);var e="0123456789ABCDEF",t=e.toLowerCase(),n;for(n=0;n<16;n++)this.charToQuartet[e.charAt(n)]=n,n>=10&&(this.charToQuartet[t.charAt(n)]=n);for(n=0;n<256;n++)this.byteToDuplet[n]=e[n>>4]+e[n&15]},print:function(e){return Jsonix.Util.Ensure.ensureArray(e),this.encode(e)},parse:function(e){return Jsonix.Util.Ensure.ensureString(e),this.decode(e)},encode:function(e){var t="";for(var n=0;n<e.length;n++)t+=this.byteToDuplet[e[n]&255];return t},decode:function(e){var t=e.replace(/[^A-Fa-f0-9]/g,""),n=t.length>>1,r=new Array(n);for(var i=0;i<n;i++){var s=t.charAt(2*i),o=t.charAt(2*i+1);r[i]=this.charToQuartet[s]<<4|this.charToQuartet[o]}return r},isInstance:function(e){return Jsonix.Util.Type.isArray(e)},CLASS_NAME:"Jsonix.Schema.XSD.HexBinary"}),Jsonix.Schema.XSD.HexBinary.INSTANCE=new Jsonix.Schema.XSD.HexBinary,Jsonix.Schema.XSD.HexBinary.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.HexBinary.INSTANCE),Jsonix.Schema.XSD.Number=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Number",typeName:Jsonix.Schema.XSD.qname("number"),print:function(e){Jsonix.Util.Ensure.ensureNumberOrNaN(e);if(Jsonix.Util.Type.isNaN(e))return"NaN";if(e===Infinity)return"INF";if(e===-Infinity)return"-INF";var t=String(e);return t},parse:function(e){Jsonix.Util.Ensure.ensureString(e);if(e==="-INF")return-Infinity;if(e==="INF")return Infinity;if(e==="NaN")return NaN;var t=Number(e);return Jsonix.Util.Ensure.ensureNumber(t),t},isInstance:function(e){return Jsonix.Util.Type.isNumberOrNaN(e)},CLASS_NAME:"Jsonix.Schema.XSD.Number"}),Jsonix.Schema.XSD.Number.INSTANCE=new Jsonix.Schema.XSD.Number,Jsonix.Schema.XSD.Number.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Number.INSTANCE),Jsonix.Schema.XSD.Float=Jsonix.Class(Jsonix.Schema.XSD.Number,{name:"Float",typeName:Jsonix.Schema.XSD.qname("float"),isInstance:function(e){return Jsonix.Util.Type.isNaN(e)||e===-Infinity||e===Infinity||Jsonix.Util.Type.isNumber(e)&&e>=this.MIN_VALUE&&e<=this.MAX_VALUE},MIN_VALUE:-3.4028235e38,MAX_VALUE:3.4028235e38,CLASS_NAME:"Jsonix.Schema.XSD.Float"}),Jsonix.Schema.XSD.Float.INSTANCE=new Jsonix.Schema.XSD.Float,Jsonix.Schema.XSD.Float.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Float.INSTANCE),Jsonix.Schema.XSD.Decimal=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Decimal",typeName:Jsonix.Schema.XSD.qname("decimal"),print:function(e){Jsonix.Util.Ensure.ensureNumber(e);var t=String(e);return t},parse:function(e){Jsonix.Util.Ensure.ensureString(e);var t=Number(e);return Jsonix.Util.Ensure.ensureNumber(t),t},isInstance:function(e){return Jsonix.Util.Type.isNumber(e)},CLASS_NAME:"Jsonix.Schema.XSD.Decimal"}),Jsonix.Schema.XSD.Decimal.INSTANCE=new Jsonix.Schema.XSD.Decimal,Jsonix.Schema.XSD.Decimal.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Decimal.INSTANCE),Jsonix.Schema.XSD.Integer=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Integer",typeName:Jsonix.Schema.XSD.qname("integer"),print:function(e){Jsonix.Util.Ensure.ensureInteger(e);var t=String(e);return t},parse:function(e){Jsonix.Util.Ensure.ensureString(e);var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},isInstance:function(e){return Jsonix.Util.NumberUtils.isInteger(e)&&e>=this.MIN_VALUE&&e<=this.MAX_VALUE},MIN_VALUE:-0x8000000000000000,MAX_VALUE:0x8000000000000000,CLASS_NAME:"Jsonix.Schema.XSD.Integer"}),Jsonix.Schema.XSD.Integer.INSTANCE=new Jsonix.Schema.XSD.Integer,Jsonix.Schema.XSD.Integer.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Integer.INSTANCE),Jsonix.Schema.XSD.NonPositiveInteger=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"NonPositiveInteger",typeName:Jsonix.Schema.XSD.qname("nonPositiveInteger"),MIN_VALUE:-0x8000000000000000,MAX_VALUE:0,CLASS_NAME:"Jsonix.Schema.XSD.NonPositiveInteger"}),Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE=new Jsonix.Schema.XSD.NonPositiveInteger,Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE),Jsonix.Schema.XSD.NegativeInteger=Jsonix.Class(Jsonix.Schema.XSD.NonPositiveInteger,{name:"NegativeInteger",typeName:Jsonix.Schema.XSD.qname("negativeInteger"),MIN_VALUE:-0x8000000000000000,MAX_VALUE:-1,CLASS_NAME:"Jsonix.Schema.XSD.NegativeInteger"}),Jsonix.Schema.XSD.NegativeInteger.INSTANCE=new Jsonix.Schema.XSD.NegativeInteger,Jsonix.Schema.XSD.NegativeInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NegativeInteger.INSTANCE),Jsonix.Schema.XSD.Long=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"Long",typeName:Jsonix.Schema.XSD.qname("long"),MIN_VALUE:-0x8000000000000000,MAX_VALUE:0x8000000000000000,CLASS_NAME:"Jsonix.Schema.XSD.Long"}),Jsonix.Schema.XSD.Long.INSTANCE=new Jsonix.Schema.XSD.Long,Jsonix.Schema.XSD.Long.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Long.INSTANCE),Jsonix.Schema.XSD.Int=Jsonix.Class(Jsonix.Schema.XSD.Long,{name:"Int",typeName:Jsonix.Schema.XSD.qname("int"),MIN_VALUE:-2147483648,MAX_VALUE:2147483647,CLASS_NAME:"Jsonix.Schema.XSD.Int"}),Jsonix.Schema.XSD.Int.INSTANCE=new Jsonix.Schema.XSD.Int,Jsonix.Schema.XSD.Int.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Int.INSTANCE),Jsonix.Schema.XSD.Short=Jsonix.Class(Jsonix.Schema.XSD.Int,{name:"Short",typeName:Jsonix.Schema.XSD.qname("short"),MIN_VALUE:-32768,MAX_VALUE:32767,CLASS_NAME:"Jsonix.Schema.XSD.Short"}),Jsonix.Schema.XSD.Short.INSTANCE=new Jsonix.Schema.XSD.Short,Jsonix.Schema.XSD.Short.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Short.INSTANCE),Jsonix.Schema.XSD.Byte=Jsonix.Class(Jsonix.Schema.XSD.Short,{name:"Byte",typeName:Jsonix.Schema.XSD.qname("byte"),MIN_VALUE:-128,MAX_VALUE:127,CLASS_NAME:"Jsonix.Schema.XSD.Byte"}),Jsonix.Schema.XSD.Byte.INSTANCE=new Jsonix.Schema.XSD.Byte,Jsonix.Schema.XSD.Byte.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Byte.INSTANCE),Jsonix.Schema.XSD.NonNegativeInteger=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"NonNegativeInteger",typeName:Jsonix.Schema.XSD.qname("nonNegativeInteger"),MIN_VALUE:0,MAX_VALUE:0x8000000000000000,CLASS_NAME:"Jsonix.Schema.XSD.NonNegativeInteger"}),Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE=new Jsonix.Schema.XSD.NonNegativeInteger,Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE),Jsonix.Schema.XSD.UnsignedLong=Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger,{name:"UnsignedLong",typeName:Jsonix.Schema.XSD.qname("unsignedLong"),MIN_VALUE:0,MAX_VALUE:0x10000000000000000,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedLong"}),Jsonix.Schema.XSD.UnsignedLong.INSTANCE=new Jsonix.Schema.XSD.UnsignedLong,Jsonix.Schema.XSD.UnsignedLong.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedLong.INSTANCE),Jsonix.Schema.XSD.UnsignedInt=Jsonix.Class(Jsonix.Schema.XSD.UnsignedLong,{name:"UnsignedInt",typeName:Jsonix.Schema.XSD.qname("unsignedInt"),MIN_VALUE:0,MAX_VALUE:4294967295,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedInt"}),Jsonix.Schema.XSD.UnsignedInt.INSTANCE=new Jsonix.Schema.XSD.UnsignedInt,Jsonix.Schema.XSD.UnsignedInt.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedInt.INSTANCE),Jsonix.Schema.XSD.UnsignedShort=Jsonix.Class(Jsonix.Schema.XSD.UnsignedInt,{name:"UnsignedShort",typeName:Jsonix.Schema.XSD.qname("unsignedShort"),MIN_VALUE:0,MAX_VALUE:65535,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedShort"}),Jsonix.Schema.XSD.UnsignedShort.INSTANCE=new Jsonix.Schema.XSD.UnsignedShort,Jsonix.Schema.XSD.UnsignedShort.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedShort.INSTANCE),Jsonix.Schema.XSD.UnsignedByte=Jsonix.Class(Jsonix.Schema.XSD.UnsignedShort,{name:"UnsignedByte",typeName:Jsonix.Schema.XSD.qname("unsignedByte"),MIN_VALUE:0,MAX_VALUE:255,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedByte"}),Jsonix.Schema.XSD.UnsignedByte.INSTANCE=new Jsonix.Schema.XSD.UnsignedByte,Jsonix.Schema.XSD.UnsignedByte.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedByte.INSTANCE),Jsonix.Schema.XSD.PositiveInteger=Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger,{name:"PositiveInteger",typeName:Jsonix.Schema.XSD.qname("positiveInteger"),MIN_VALUE:1,MAX_VALUE:0x8000000000000000,CLASS_NAME:"Jsonix.Schema.XSD.PositiveInteger"}),Jsonix.Schema.XSD.PositiveInteger.INSTANCE=new Jsonix.Schema.XSD.PositiveInteger,Jsonix.Schema.XSD.PositiveInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.PositiveInteger.INSTANCE),Jsonix.Schema.XSD.Double=Jsonix.Class(Jsonix.Schema.XSD.Number,{name:"Double",typeName:Jsonix.Schema.XSD.qname("double"),isInstance:function(e){return Jsonix.Util.Type.isNaN(e)||e===-Infinity||e===Infinity||Jsonix.Util.Type.isNumber(e)&&e>=this.MIN_VALUE&&e<=this.MAX_VALUE},MIN_VALUE:-1.7976931348623157e308,MAX_VALUE:1.7976931348623157e308,CLASS_NAME:"Jsonix.Schema.XSD.Double"}),Jsonix.Schema.XSD.Double.INSTANCE=new Jsonix.Schema.XSD.Double,Jsonix.Schema.XSD.Double.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Double.INSTANCE),Jsonix.Schema.XSD.AnyURI=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"AnyURI",typeName:Jsonix.Schema.XSD.qname("anyURI"),print:function(e){return Jsonix.Util.Ensure.ensureString(e),e},parse:function(e){return Jsonix.Util.Ensure.ensureString(e),e},isInstance:function(e){return Jsonix.Util.Type.isString(e)},CLASS_NAME:"Jsonix.Schema.XSD.AnyURI"}),Jsonix.Schema.XSD.AnyURI.INSTANCE=new Jsonix.Schema.XSD.AnyURI,Jsonix.Schema.XSD.AnyURI.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.AnyURI.INSTANCE),Jsonix.Schema.XSD.QName=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"QName",typeName:Jsonix.Schema.XSD.qname("QName"),CLASS_NAME:"Jsonix.Schema.XSD.QName"}),Jsonix.Schema.XSD.QName.INSTANCE=new Jsonix.Schema.XSD.QName,Jsonix.Schema.XSD.QName.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.QName.INSTANCE),Jsonix.Schema.XSD.Calendar=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Calendar",typeName:Jsonix.Schema.XSD.qname("calendar"),parse:function(e){Jsonix.Util.Ensure.ensureString(e);var t=e.charAt(0)==="-",n=t?-1:1,r=t?e.substring(1):e,i;if(r.length>=19&&r.charAt(4)==="-"&&r.charAt(7)==="-"&&r.charAt(10)==="T"&&r.charAt(13)===":"&&r.charAt(16)===":")return this.parseDateTime(e);if(r.length>=10&&r.charAt(4)==="-"&&r.charAt(7)==="-")return this.parseDate(e);if(r.length>=8&&r.charAt(2)===":"&&r.charAt(5)===":")return this.parseTime(e);throw new Error("Value ["+e+"] does not match dateTime, date or time patterns.")},parseDateTime:function(e){Jsonix.Util.Ensure.ensureString(e);var t=e.charAt(0)==="-",n=t?-1:1,r=t?e.substring(1):e;if(r.length<19||r.charAt(4)!=="-"||r.charAt(7)!=="-"||r.charAt(10)!=="T"||r.charAt(13)!==":"||r.charAt(16)!==":")throw new Error("Date time string ["+r+"] must be a string in format ['-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?].");var i,s=r.indexOf("+",19);if(s>=0)i=s;else{var o=r.indexOf("-",19);if(o>=0)i=o;else{var u=r.indexOf("Z",19);u>=0?i=u:i=r.length}}var a=i>0&&i<r.length,f=r.substring(0,10),l=a?r.substring(11,i):r.substring(11),c=a?r.substring(i):"",h=this.parseDateString(f),p=this.parseTimeString(l),d=this.parseTimeZoneString(c);return Jsonix.XML.Calendar.fromObject({year:n*h.year,month:h.month,day:h.day,hour:p.hour,minute:p.minute,second:p.second,fractionalSecond:p.fractionalSecond,timezone:d})},parseDate:function(e){Jsonix.Util.Ensure.ensureString(e);var t=e.charAt(0)==="-",n=t?-1:1,r=t?e.substring(1):e,i,s=r.indexOf("+",10);if(s>=0)i=s;else{var o=r.indexOf("-",10);if(o>=0)i=o;else{var u=r.indexOf("Z",10);u>=0?i=u:i=r.length}}var a=i>0&&i<r.length,f=a?r.substring(0,i):r,l=this.parseDateString(f),c=a?e.substring(i):"",h=this.parseTimeZoneString(c);return Jsonix.XML.Calendar.fromObject({year:n*l.year,month:l.month,day:l.day,timezone:h})},parseTime:function(e){Jsonix.Util.Ensure.ensureString(e);var t,n=e.indexOf("+",7);if(n>=0)t=n;else{var r=e.indexOf("-",7);if(r>=0)t=r;else{var i=e.indexOf("Z",7);i>=0?t=i:t=e.length}}var s=t>0&&t<e.length,o=s?e.substring(0,t):e,u=this.parseTimeString(o),a=s?e.substring(t):"",f=this.parseTimeZoneString(a);return Jsonix.XML.Calendar.fromObject({hour:u.hour,minute:u.minute,second:u.second,fractionalSecond:u.fractionalSecond,timezone:f})},parseDateString:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==10)throw new Error("Date string ["+e+"] must be 10 characters long.");if(e.charAt(4)!=="-"||e.charAt(7)!=="-")throw new Error("Date string ["+e+"] must be a string in format [yyyy '-' mm '-' ss ].");var t=this.parseYear(e.substring(0,4)),n=this.parseMonth(e.substring(5,7)),r=this.parseDay(e.substring(8,10));return{year:t,month:n,day:r}},parseTimeString:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length<8||e.charAt(2)!==":"||e.charAt(5)!==":")throw new Error("Time string ["+e+"] must be a string in format [hh ':' mm ':' ss ('.' s+)?].");var t=e.substring(0,2),n=e.substring(3,5),r=e.substring(6,8),i=e.length>=9?e.substring(8):"",s=this.parseHour(t),o=this.parseHour(n),u=this.parseSecond(r),a=this.parseFractionalSecond(i);return{hour:s,minute:o,second:u,fractionalSecond:a}},parseTimeZoneString:function(e){Jsonix.Util.Ensure.ensureString(e);if(e==="")return NaN;if(e==="Z")return 0;if(e.length!==6)throw new Error("Time zone must be an empty string, 'Z' or a string in format [('+' | '-') hh ':' mm].");var t=e.charAt(0),n;if(t==="+")n=1;else{if(t!=="-")throw new Error("First character of the time zone ["+e+"] must be '+' or '-'.");n=-1}var r=this.parseHour(e.substring(1,3)),i=this.parseMinute(e.substring(4,6));return n*(r*60+i)},parseYear:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==4)throw new Error("Year ["+e+"] must be a four-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},parseMonth:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==2)throw new Error("Month ["+e+"] must be a two-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},parseDay:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==2)throw new Error("Day ["+e+"] must be a two-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},parseHour:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==2)throw new Error("Hour ["+e+"] must be a two-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},parseMinute:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==2)throw new Error("Minute ["+e+"] must be a two-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureInteger(t),t},parseSecond:function(e){Jsonix.Util.Ensure.ensureString(e);if(e.length!==2)throw new Error("Second ["+e+"] must be a two-digit number.");var t=Number(e);return Jsonix.Util.Ensure.ensureNumber(t),t},parseFractionalSecond:function(e){Jsonix.Util.Ensure.ensureString(e);if(e==="")return 0;var t=Number(e);return Jsonix.Util.Ensure.ensureNumber(t),t},print:function(e){if(Jsonix.Util.Type.isString(e))return e;Jsonix.Util.Ensure.ensureObject(e);if(Jsonix.Util.NumberUtils.isInteger(e.year)&&Jsonix.Util.NumberUtils.isInteger(e.month)&&Jsonix.Util.NumberUtils.isInteger(e.day)&&Jsonix.Util.NumberUtils.isInteger(e.hour)&&Jsonix.Util.NumberUtils.isInteger(e.minute)&&Jsonix.Util.NumberUtils.isInteger(e.second))return this.printDateTime(e);if(Jsonix.Util.NumberUtils.isInteger(e.year)&&Jsonix.Util.NumberUtils.isInteger(e.month)&&Jsonix.Util.NumberUtils.isInteger(e.day))return this.printDate(e);if(Jsonix.Util.NumberUtils.isInteger(e.hour)&&Jsonix.Util.NumberUtils.isInteger(e.minute)&&Jsonix.Util.NumberUtils.isInteger(e.second))return this.printTime(e);throw new Error("Value ["+e+"] is not recognized as dateTime, date or time.")},printDateTime:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureInteger(e.year),Jsonix.Util.Ensure.ensureInteger(e.month),Jsonix.Util.Ensure.ensureInteger(e.day),Jsonix.Util.Ensure.ensureInteger(e.hour),Jsonix.Util.Ensure.ensureInteger(e.minute),Jsonix.Util.Ensure.ensureNumber(e.second),Jsonix.Util.Type.exists(e.fractionalString)&&Jsonix.Util.Ensure.ensureNumber(e.fractionalString),Jsonix.Util.Type.exists(e.timezone)&&!Jsonix.Util.Type.isNaN(e.timezone)&&Jsonix.Util.Ensure.ensureInteger(e.timezone);var t=this.printDateString(e);return t+="T",t+=this.printTimeString(e),Jsonix.Util.Type.exists(e.timezone)&&(t+=this.printTimeZoneString(e.timezone)),t},printDate:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureNumber(e.year),Jsonix.Util.Ensure.ensureNumber(e.month),Jsonix.Util.Ensure.ensureNumber(e.day),Jsonix.Util.Type.exists(e.timezone)&&!Jsonix.Util.Type.isNaN(e.timezone)&&Jsonix.Util.Ensure.ensureInteger(e.timezone);var t=this.printDateString(e);return Jsonix.Util.Type.exists(e.timezone)&&(t+=this.printTimeZoneString(e.timezone)),t},printTime:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureNumber(e.hour),Jsonix.Util.Ensure.ensureNumber(e.minute),Jsonix.Util.Ensure.ensureNumber(e.second),Jsonix.Util.Type.exists(e.fractionalString)&&Jsonix.Util.Ensure.ensureNumber(e.fractionalString),Jsonix.Util.Type.exists(e.timezone)&&!Jsonix.Util.Type.isNaN(e.timezone)&&Jsonix.Util.Ensure.ensureInteger(e.timezone);var t=this.printTimeString(e);return Jsonix.Util.Type.exists(e.timezone)&&(t+=this.printTimeZoneString(e.timezone)),t},printDateString:function(e){return Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureInteger(e.year),Jsonix.Util.Ensure.ensureInteger(e.month),Jsonix.Util.Ensure.ensureInteger(e.day),(e.year<0?"-"+this.printYear(-e.year):this.printYear(e.year))+"-"+this.printMonth(e.month)+"-"+this.printDay(e.day)},printTimeString:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureInteger(e.hour),Jsonix.Util.Ensure.ensureInteger(e.minute),Jsonix.Util.Ensure.ensureInteger(e.second),Jsonix.Util.Type.exists(e.fractionalSecond)&&Jsonix.Util.Ensure.ensureNumber(e.fractionalSecond);var t=this.printHour(e.hour);return t+=":",t+=this.printMinute(e.minute),t+=":",t+=this.printSecond(e.second),Jsonix.Util.Type.exists(e.fractionalSecond)&&(t+=this.printFractionalSecond(e.fractionalSecond)),t},printTimeZoneString:function(e){if(!Jsonix.Util.Type.exists(e)||Jsonix.Util.Type.isNaN(e))return"";Jsonix.Util.Ensure.ensureInteger(e);var t=e<0?-1:e>0?1:0,n=e*t,r=n%60,i=Math.floor(n/60),s;return t===0?"Z":(t>0?s="+":t<0&&(s="-"),s+=this.printHour(i),s+=":",s+=this.printMinute(r),s)},printYear:function(e){return this.printInteger(e,4)},printMonth:function(e){return this.printInteger(e,2)},printDay:function(e){return this.printInteger(e,2)},printHour:function(e){return this.printInteger(e,2)},printMinute:function(e){return this.printInteger(e,2)},printSecond:function(e){return this.printInteger(e,2)},printFractionalSecond:function(e){Jsonix.Util.Ensure.ensureNumber(e);if(e<0||e>=1)throw new Error("Fractional second ["+e+"] must be between 0 and 1.");if(e===0)return"";var t=String(e),n=t.indexOf(".");return n<0?"":t.substring(n)},printInteger:function(e,t){Jsonix.Util.Ensure.ensureInteger(e),Jsonix.Util.Ensure.ensureInteger(t);if(t<=0)throw new Error("Length ["+e+"] must be positive.");if(e<0)throw new Error("Value ["+e+"] must not be negative.");if(e>=Math.pow(10,t))throw new Error("Value ["+e+"] must be less than ["+Math.pow(10,t)+"].");var n=String(e);for(var r=n.length;r<t;r++)n="0"+n;return n},isInstance:function(e){return Jsonix.Util.Type.isObject(e)&&(Jsonix.Util.NumberUtils.isInteger(e.year)&&Jsonix.Util.NumberUtils.isInteger(e.month)&&Jsonix.Util.NumberUtils.isInteger(e.day)||Jsonix.Util.NumberUtils.isInteger(e.hour)&&Jsonix.Util.NumberUtils.isInteger(e.minute)&&Jsonix.Util.NumberUtils.isInteger(e.second))},CLASS_NAME:"Jsonix.Schema.XSD.Calendar"}),Jsonix.Schema.XSD.Calendar.INSTANCE=new Jsonix.Schema.XSD.Calendar,Jsonix.Schema.XSD.Calendar.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Calendar.INSTANCE),Jsonix.Schema.XSD.Duration=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Duration",typeName:Jsonix.Schema.XSD.qname("duration"),CLASS_NAME:"Jsonix.Schema.XSD.Duration"}),Jsonix.Schema.XSD.Duration.INSTANCE=new Jsonix.Schema.XSD.Duration,Jsonix.Schema.XSD.Duration.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Duration.INSTANCE),Jsonix.Schema.XSD.DateTime=Jsonix.Class(Jsonix.Schema.XSD.Calendar,{name:"DateTime",typeName:Jsonix.Schema.XSD.qname("dateTime"),parse:function(e){var t=this.parseDateTime(e),n=new Date;return n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(t.hour),n.setMinutes(t.minute),n.setSeconds(t.second),Jsonix.Util.Type.isNumber(t.fractionalSecond)&&n.setMilliseconds(Math.floor(1e3*t.fractionalSecond)),Jsonix.Util.NumberUtils.isInteger(t.timezone)?new Date(n.getTime()-6e4*n.getTimezoneOffset()+t.timezone*6e4):n},print:function(e){return Jsonix.Util.Ensure.ensureDate(e),this.printDateTime(new Jsonix.XML.Calendar({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),fractionalSecond:e.getMilliseconds()/1e3}))},isInstance:function(e){return Jsonix.Util.Type.isDate(e)},CLASS_NAME:"Jsonix.Schema.XSD.DateTime"}),Jsonix.Schema.XSD.DateTime.INSTANCE=new Jsonix.Schema.XSD.DateTime,Jsonix.Schema.XSD.DateTime.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.DateTime.INSTANCE),Jsonix.Schema.XSD.Time=Jsonix.Class(Jsonix.Schema.XSD.Calendar,{name:"Time",typeName:Jsonix.Schema.XSD.qname("time"),parse:function(e){var t=this.parseTime(e);if(Jsonix.Util.NumberUtils.isInteger(t.timezone)){var n=new Date(70,0,1,t.hour,t.minute,t.second);Jsonix.Util.Type.isNumber(t.fractionalSecond)&&n.setMilliseconds(Math.floor(1e3*t.fractionalSecond));var r=n.getTime()-t.timezone*6e4;return new Date(r-6e4*n.getTimezoneOffset())}var i=new Date(70,0,1,t.hour,t.minute,t.second);return Jsonix.Util.Type.isNumber(t.fractionalSecond)&&i.setMilliseconds(Math.floor(1e3*t.fractionalSecond)),i},print:function(e){Jsonix.Util.Ensure.ensureDate(e);var t=e.getTime();if(t<=-864e5&&t>=864e5)throw new Error("Invalid time ["+e+"].");if(t>=0)return this.printTime(new Jsonix.XML.Calendar({hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),fractionalSecond:e.getMilliseconds()/1e3}));var n=Math.ceil(-t/36e5);return this.printTime(new Jsonix.XML.Calendar({hour:(e.getUTCHours()+n)%24,minute:e.getUTCMinutes(),second:e.getUTCSeconds(),fractionalSecond:e.getUTCMilliseconds()/1e3,timezone:n*60}))},isInstance:function(e){return Jsonix.Util.Type.isDate(e)&&e.getTime()>-864e5&&e.getTime()<864e5},CLASS_NAME:"Jsonix.Schema.XSD.Time"}),Jsonix.Schema.XSD.Time.INSTANCE=new Jsonix.Schema.XSD.Time,Jsonix.Schema.XSD.Time.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Time.INSTANCE),Jsonix.Schema.XSD.Date=Jsonix.Class(Jsonix.Schema.XSD.Calendar,{name:"Date",typeName:Jsonix.Schema.XSD.qname("date"),parse:function(e){var t=this.parseDate(e);if(Jsonix.Util.NumberUtils.isInteger(t.timezone)){var n=new Date;return n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),new Date(n.getTime()-6e4*n.getTimezoneOffset()+t.timezone*6e4)}var r=new Date;return r.setFullYear(t.year),r.setMonth(t.month-1),r.setDate(t.day),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r},print:function(e){Jsonix.Util.Ensure.ensureDate(e);var t=new Date(e.getTime());t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);var n=e.getTime()-t.getTime();if(n===0)return this.printDate(new Jsonix.XML.Calendar({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}));var r=n+6e4*e.getTimezoneOffset();if(r<=432e5)return this.printDate(new Jsonix.XML.Calendar({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),timezone:Math.floor(r/6e4)}));var i=new Date(e.getTime()+864e5);return this.printDate(new Jsonix.XML.Calendar({year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate(),timezone:Math.floor(r/6e4)-1440}))},isInstance:function(e){return Jsonix.Util.Type.isDate(e)},CLASS_NAME:"Jsonix.Schema.XSD.Date"}),Jsonix.Schema.XSD.Date.INSTANCE=new Jsonix.Schema.XSD.Date,Jsonix.Schema.XSD.Date.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Date.INSTANCE),Jsonix.Schema.XSD.GYearMonth=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GYearMonth",typeName:Jsonix.Schema.XSD.qname("gYearMonth"),CLASS_NAME:"Jsonix.Schema.XSD.GYearMonth"}),Jsonix.Schema.XSD.GYearMonth.INSTANCE=new Jsonix.Schema.XSD.GYearMonth,Jsonix.Schema.XSD.GYearMonth.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYearMonth.INSTANCE),Jsonix.Schema.XSD.GYear=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GYear",typeName:Jsonix.Schema.XSD.qname("gYear"),CLASS_NAME:"Jsonix.Schema.XSD.GYear"}),Jsonix.Schema.XSD.GYear.INSTANCE=new Jsonix.Schema.XSD.GYear,Jsonix.Schema.XSD.GYear.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYear.INSTANCE),Jsonix.Schema.XSD.GMonthDay=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GMonthDay",typeName:Jsonix.Schema.XSD.qname("gMonthDay"),CLASS_NAME:"Jsonix.Schema.XSD.GMonthDay"}),Jsonix.Schema.XSD.GMonthDay.INSTANCE=new Jsonix.Schema.XSD.GMonthDay,Jsonix.Schema.XSD.GMonthDay.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonthDay.INSTANCE),Jsonix.Schema.XSD.GDay=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GDay",typeName:Jsonix.Schema.XSD.qname("gDay"),CLASS_NAME:"Jsonix.Schema.XSD.GDay"}),Jsonix.Schema.XSD.GDay.INSTANCE=new Jsonix.Schema.XSD.GDay,Jsonix.Schema.XSD.GDay.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GDay.INSTANCE),Jsonix.Schema.XSD.GMonth=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GMonth",typeName:Jsonix.Schema.XSD.qname("gMonth"),CLASS_NAME:"Jsonix.Schema.XSD.GMonth"}),Jsonix.Schema.XSD.GMonth.INSTANCE=new Jsonix.Schema.XSD.GMonth,Jsonix.Schema.XSD.GMonth.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonth.INSTANCE),Jsonix.Schema.XSD.ID=Jsonix.Class(Jsonix.Schema.XSD.String,{name:"ID",typeName:Jsonix.Schema.XSD.qname("ID"),CLASS_NAME:"Jsonix.Schema.XSD.ID"}),Jsonix.Schema.XSD.ID.INSTANCE=new Jsonix.Schema.XSD.ID,Jsonix.Schema.XSD.ID.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.ID.INSTANCE),Jsonix.Schema.XSD.IDREF=Jsonix.Class(Jsonix.Schema.XSD.String,{name:"IDREF",typeName:Jsonix.Schema.XSD.qname("IDREF"),CLASS_NAME:"Jsonix.Schema.XSD.IDREF"}),Jsonix.Schema.XSD.IDREF.INSTANCE=new Jsonix.Schema.XSD.IDREF,Jsonix.Schema.XSD.IDREF.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.IDREF.INSTANCE),Jsonix.Schema.XSD.IDREFS=Jsonix.Class(Jsonix.Schema.XSD.List,{name:"IDREFS",initialize:function(){Jsonix.Schema.XSD.List.prototype.initialize.apply(this,[Jsonix.Schema.XSD.IDREF.INSTANCE,Jsonix.Schema.XSD.qname("IDREFS")," "])},CLASS_NAME:"Jsonix.Schema.XSD.IDREFS"}),Jsonix.Schema.XSD.IDREFS.INSTANCE=new Jsonix.Schema.XSD.IDREFS,Jsonix.Model.Adapter=Jsonix.Class({initialize:function(){},unmarshal:function(e,t,n){return n.unmarshal(e,t)},marshal:function(e,t,n,r){r.marshal(e,t,n)},CLASS_NAME:"Jsonix.Model.Adapter"}),Jsonix.Model.Adapter.INSTANCE=new Jsonix.Model.Adapter,Jsonix.Model.Adapter.getAdapter=function(e){return Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureObject(e.typeInfo),Jsonix.Util.Type.exists(e.adapter)?e.adapter:Jsonix.Model.Adapter.INSTANCE},Jsonix.Model.ClassInfo=Jsonix.Class(Jsonix.Model.TypeInfo,{name:null,baseTypeInfo:null,properties:null,structure:null,defaultElementNamespaceURI:"",defaultAttributeNamespaceURI:"",built:!1,initialize:function(e){Jsonix.Model.TypeInfo.prototype.initialize.apply(this,[]),Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.name),this.name=e.name,Jsonix.Util.Type.isString(e.defaultElementNamespaceURI)&&(this.defaultElementNamespaceURI=e.defaultElementNamespaceURI),Jsonix.Util.Type.isString(e.defaultAttributeNamespaceURI)&&(this.defaultAttributeNamespaceURI=e.defaultAttributeNamespaceURI),Jsonix.Util.Type.exists(e.baseTypeInfo)&&(this.baseTypeInfo=e.baseTypeInfo),this.properties=[];if(Jsonix.Util.Type.exists(e.propertyInfos)){Jsonix.Util.Ensure.ensureArray(e.propertyInfos);for(var t=0;t<e.propertyInfos.length;t++)this.p(e.propertyInfos[t])}},destroy:function(){},build:function(e,t){if(!this.built){this.baseTypeInfo=e.resolveTypeInfo(this.baseTypeInfo,t);for(var n=0;n<this.properties.length;n++){var r=this.properties[n];r.build(e,t)}var i={elements:null,attributes:{},anyAttribute:null,value:null,any:null};Jsonix.Util.Type.exists(this.baseTypeInfo)&&this.baseTypeInfo.buildStructure(e,i),this.buildStructure(e,i),this.structure=i}},buildStructure:function(e,t){for(var n=0;n<this.properties.length;n++){var r=this.properties[n];r.buildStructure(e,t)}},unmarshal:function(e,t){this.build(e);var n={TYPE_NAME:this.name};if(t.eventType!==1)throw new Error("Parser must be on START_ELEMENT to read a class info.");if(Jsonix.Util.Type.exists(this.structure.attributes)){var r=t.getAttributeCount();if(r!==0)for(var i=0;i<r;i++){var s=t.getAttributeNameKey(i);if(Jsonix.Util.Type.exists(this.structure.attributes[s])){var o=t.getAttributeValue(i);if(Jsonix.Util.Type.isString(o)){var u=this.structure.attributes[s];this.unmarshalPropertyValue(e,t,u,n,o)}}}}if(Jsonix.Util.Type.exists(this.structure.anyAttribute)){var a=this.structure.anyAttribute;this.unmarshalProperty(e,t,a,n)}if(Jsonix.Util.Type.exists(this.structure.elements)){var f=t.next();while(f!==Jsonix.XML.Input.END_ELEMENT){if(f===Jsonix.XML.Input.START_ELEMENT){var l=t.getNameKey();if(Jsonix.Util.Type.exists(this.structure.elements[l])){var c=this.structure.elements[l];this.unmarshalProperty(e,t,c,n)}else{if(!Jsonix.Util.Type.exists(this.structure.any))throw new Error("Unexpected element ["+l+"].");var h=this.structure.any;this.unmarshalProperty(e,t,h,n)}}else if(f!==Jsonix.XML.Input.CHARACTERS&&f!==Jsonix.XML.Input.CDATA&&f!==Jsonix.XML.Input.ENTITY_REFERENCE||!Jsonix.Util.Type.exists(this.structure.mixed)){if(f!==Jsonix.XML.Input.SPACE&&f!==Jsonix.XML.Input.COMMENT&&f!==Jsonix.XML.Input.PROCESSING_INSTRUCTION)throw new Error("Illegal state: unexpected event type ["+f+"].")}else{var p=this.structure.mixed;this.unmarshalProperty(e,t,p,n)}f=t.next()}}else if(Jsonix.Util.Type.exists(this.structure.value)){var d=this.structure.value;this.unmarshalProperty(e,t,d,n)}else t.nextTag();if(t.eventType!==2)throw new Error("Illegal state: must be END_ELEMENT.");return n},unmarshalProperty:function(e,t,n,r){var i=n.unmarshal(e,this,t);n.setProperty(r,i)},unmarshalPropertyValue:function(e,t,n,r,i){var s=n.unmarshalValue(e,this,t,i);n.setProperty(r,s)},marshal:function(e,t,n){Jsonix.Util.Type.exists(this.baseTypeInfo)&&this.baseTypeInfo.marshal(e,t,n);for(var r=0;r<this.properties.length;r++){var i=this.properties[r],s=t[i.name];Jsonix.Util.Type.exists(s)&&i.marshal(e,this,s,n)}},isInstance:function(e){return Jsonix.Util.Type.isObject(e)&&Jsonix.Util.Type.isString(e.TYPE_NAME)&&e.TYPE_NAME===this.name},b:function(e){return Jsonix.Util.Ensure.ensureObject(e),this.baseTypeInfo=e,this},ps:function(){return this},p:function(e){Jsonix.Util.Ensure.ensureObject(e);if(e instanceof Jsonix.Model.PropertyInfo)this.addProperty(e);else{Jsonix.Util.Ensure.ensureString(e.type);var t=e.type;if(!Jsonix.Util.Type.isFunction(this.propertyInfoCreators[t]))throw new Error("Unknown property info type ["+t+"].");var n=this.propertyInfoCreators[t];n.call(this,e)}},aa:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.AnyAttributePropertyInfo(e))},ae:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.AnyElementPropertyInfo(e))},a:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.AttributePropertyInfo(e))},em:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ElementMapPropertyInfo(e))},e:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ElementPropertyInfo(e))},es:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ElementsPropertyInfo(e))},er:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ElementRefPropertyInfo(e))},ers:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ElementRefsPropertyInfo(e))},v:function(e){return this.addDefaultNamespaces(e),this.addProperty(new Jsonix.Model.ValuePropertyInfo(e))},addDefaultNamespaces:function(e){Jsonix.Util.Type.isObject(e)&&(Jsonix.Util.Type.isString(e.defaultElementNamespaceURI)||(e.defaultElementNamespaceURI=this.defaultElementNamespaceURI),Jsonix.Util.Type.isString(e.defaultAttributeNamespaceURI)||(e.defaultAttributeNamespaceURI=this.defaultAttributeNamespaceURI))},addProperty:function(e){return this.properties.push(e),this},CLASS_NAME:"Jsonix.Model.ClassInfo"}),Jsonix.Model.ClassInfo.prototype.propertyInfoCreators={anyAttribute:Jsonix.Model.ClassInfo.prototype.aa,anyElement:Jsonix.Model.ClassInfo.prototype.ae,attribute:Jsonix.Model.ClassInfo.prototype.a,elementMap:Jsonix.Model.ClassInfo.prototype.em,element:Jsonix.Model.ClassInfo.prototype.e,elements:Jsonix.Model.ClassInfo.prototype.es,elementRef:Jsonix.Model.ClassInfo.prototype.er,elementRefs:Jsonix.Model.ClassInfo.prototype.ers,value:Jsonix.Model.ClassInfo.prototype.v},Jsonix.Model.ElementInfo=Jsonix.Class({elementName:null,typeInfo:null,substitutionHead:null,scope:null,built:!1,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureObject(e.elementName),this.elementName=e.elementName,Jsonix.Util.Ensure.ensureExists(e.typeInfo),this.typeInfo=e.typeInfo,Jsonix.Util.Type.exists(e.substitutionHead)&&(this.substitutionHead=e.substitutionHead),Jsonix.Util.Type.exists(e.scope)&&(this.scope=e.scope)},build:function(e,t){this.built||(this.typeInfo=e.resolveTypeInfo(this.typeInfo,t),this.scope=e.resolveTypeInfo(this.scope,t),this.built=!0)},CLASS_NAME:"Jsonix.Model.ElementInfo"}),Jsonix.Model.PropertyInfo=Jsonix.Class({name:null,collection:!1,defaultElementNamespaceURI:"",defaultAttributeNamespaceURI:"",built:!1,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.name),this.name=e.name,Jsonix.Util.Type.isString(e.defaultElementNamespaceURI)&&(this.defaultElementNamespaceURI=e.defaultElementNamespaceURI),Jsonix.Util.Type.isString(e.defaultAttributeNamespaceURI)&&(this.defaultAttributeNamespaceURI=e.defaultAttributeNamespaceURI),Jsonix.Util.Type.isBoolean(e.collection)?this.collection=e.collection:this.collection=!1},build:function(e,t){this.built||(this.doBuild(e,t),this.built=!0)},doBuild:function(e,t){throw new Error("Abstract method [doBuild].")},buildStructure:function(e,t){throw new Error("Abstract method [buildStructure].")},setProperty:function(e,t){if(Jsonix.Util.Type.exists(t))if(this.collection){Jsonix.Util.Ensure.ensureArray(t,"Collection property requires an array value."),Jsonix.Util.Type.exists(e[this.name])||(e[this.name]=[]);for(var n=0;n<t.length;n++)e[this.name].push(t[n])}else e[this.name]=t},CLASS_NAME:"Jsonix.Model.PropertyInfo"}),Jsonix.Model.AnyAttributePropertyInfo=Jsonix.Class(Jsonix.Model.PropertyInfo,{initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.PropertyInfo.prototype.initialize.apply(this,[e])},unmarshal:function(e,t,n){var r=n.getAttributeCount();if(r===0)return null;var i={};for(var s=0;s<r;s++){var o=n.getAttributeNameKey(s),u=n.getAttributeValue(s);Jsonix.Util.Type.isString(u)&&(i[o]=u)}return i},marshal:function(e,t,n,r){if(!Jsonix.Util.Type.isObject(n))return;for(var i in n)if(n.hasOwnProperty(i)){var s=n[i];Jsonix.Util.Type.isString(s)&&r.writeAttribute(Jsonix.XML.QName.fromString(i),s)}},doBuild:function(e,t){},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t),t.anyAttribute=this},CLASS_NAME:"Jsonix.Model.AnyAttributePropertyInfo"}),Jsonix.Model.SingleTypePropertyInfo=Jsonix.Class(Jsonix.Model.PropertyInfo,{typeInfo:"String",initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.PropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.exists(e.typeInfo)&&(this.typeInfo=e.typeInfo)},doBuild:function(e,t){this.typeInfo=e.resolveTypeInfo(this.typeInfo,t)},unmarshalValue:function(e,t,n,r){return this.parse(e,t,r)},parse:function(e,t,n){return this.typeInfo.parse(n)},print:function(e,t,n){return this.typeInfo.print(n)},CLASS_NAME:"Jsonix.Model.SingleTypePropertyInfo"}),Jsonix.Model.AttributePropertyInfo=Jsonix.Class(Jsonix.Model.SingleTypePropertyInfo,{attributeName:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.SingleTypePropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.isObject(e.attributeName)?(Jsonix.Util.Ensure.ensureString(e.attributeName.localPart,"Attribute name must contain a string property [localPart]."),this.attributeName=Jsonix.XML.QName.fromObject(e.attributeName)):Jsonix.Util.Type.isString(e.attributeName)?this.attributeName=new Jsonix.XML.QName(this.defaultAttributeNamespaceURI,e.attributeName):this.attributeName=new Jsonix.XML.QName(this.defaultAttributeNamespaceURI,this.name)},unmarshal:function(e,t,n){var r=n.getAttributeCount(),i=null;for(var s=0;s<r;s++){var o=n.getAttributeNameKey(s);if(this.attributeName.key===o){var u=n.getAttributeValue(s);Jsonix.Util.Type.isString(u)&&(i=this.unmarshalValue(e,t,n,u))}}return i},marshal:function(e,t,n,r){Jsonix.Util.Type.exists(n)&&r.writeAttribute(this.attributeName,this.print(e,t,n))},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t),Jsonix.Util.Ensure.ensureObject(t.attributes);var n=this.attributeName.key;t.attributes[n]=this},CLASS_NAME:"Jsonix.Model.AttributePropertyInfo"}),Jsonix.Model.ValuePropertyInfo=Jsonix.Class(Jsonix.Model.SingleTypePropertyInfo,{initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.SingleTypePropertyInfo.prototype.initialize.apply(this,[e])},unmarshal:function(e,t,n){var r=n.getElementText();return Jsonix.Util.StringUtils.isNotBlank(r)?this.unmarshalValue(e,t,n,r):null},marshal:function(e,t,n,r){if(!Jsonix.Util.Type.exists(n))return;r.writeCharacters(this.print(e,t,n))},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t);if(Jsonix.Util.Type.exists(t.elements))throw new Error("The structure already defines element mappings, it cannot define a value property.");t.value=this},CLASS_NAME:"Jsonix.Model.ValuePropertyInfo"}),Jsonix.Model.AbstractElementsPropertyInfo=Jsonix.Class(Jsonix.Model.PropertyInfo,{wrapperElementName:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.PropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.isObject(e.wrapperElementName)?(Jsonix.Util.Ensure.ensureString(e.wrapperElementName.localPart,"Wrapper element name must contain a string property [localPart]."),this.wrapperElementName=Jsonix.XML.QName.fromObject(e.wrapperElementName)):Jsonix.Util.Type.isString(e.wrapperElementName)?this.wrapperElementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.wrapperElementName):this.wrapperElementName=null},unmarshal:function(e,t,n){var r=null,i=this,s=function(e){if(i.collection)r===null&&(r=[]),r.push(e);else{if(r!==null)throw new Error("Value already set.");r=e}};return Jsonix.Util.Type.exists(this.wrapperElementName)?this.unmarshalWrapperElement(e,n,s):this.unmarshalElement(e,n,s),r},unmarshalWrapperElement:function(e,t,n){var r=t.next();while(r!==Jsonix.XML.Input.END_ELEMENT){if(r===Jsonix.XML.Input.START_ELEMENT)this.unmarshalElement(e,t,n);else if(r!==Jsonix.XML.Input.SPACE&&r!==Jsonix.XML.Input.COMMENT&&r!==Jsonix.XML.Input.PROCESSING_INSTRUCTION)throw new Error("Illegal state: unexpected event type ["+r+"].");r=t.next()}},unmarshalElement:function(e,t,n){throw new Error("Abstract method [unmarshalElement].")},marshal:function(e,t,n,r){if(!Jsonix.Util.Type.exists(n))return;Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeStartElement(this.wrapperElementName);if(!this.collection)this.marshalElement(e,n,r);else{Jsonix.Util.Ensure.ensureArray(n);for(var i=0;i<n.length;i++){var s=n[i];this.marshalElement(e,s,r)}}Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeEndElement()},marshalElement:function(e,t,n){throw new Error("Abstract method [marshalElement].")},marshalElementTypeInfo:function(e,t,n,r,i){i.writeStartElement(n),r.marshal(e,t,i),i.writeEndElement()},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t);if(Jsonix.Util.Type.exists(t.value))throw new Error("The structure already defines a value property.");Jsonix.Util.Type.exists(t.elements)||(t.elements={}),Jsonix.Util.Type.exists(this.wrapperElementName)?t.elements[this.wrapperElementName.key]=this:this.buildStructureElements(e,t)},buildStructureElements:function(e,t){throw new Error("Abstract method [buildStructureElements].")},CLASS_NAME:"Jsonix.Model.AbstractElementsPropertyInfo"}),Jsonix.Model.ElementPropertyInfo=Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo,{typeInfo:"String",elementName:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.exists(e.typeInfo)&&(Jsonix.Util.Type.isObject(e.typeInfo)?(Jsonix.Util.Ensure.ensureObject(e.typeInfo),this.typeInfo=e.typeInfo):(Jsonix.Util.Ensure.ensureString(e.typeInfo),this.typeInfo=e.typeInfo)),Jsonix.Util.Type.isObject(e.elementName)?this.elementName=Jsonix.XML.QName.fromObject(e.elementName):Jsonix.Util.Type.isString(e.elementName)?this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.elementName):this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,this.name)},unmarshalElement:function(e,t,n){return n(this.typeInfo.unmarshal(e,t))},marshalElement:function(e,t,n){this.marshalElementTypeInfo(e,t,this.elementName,this.typeInfo,n)},doBuild:function(e,t){this.typeInfo=e.resolveTypeInfo(this.typeInfo,t)},buildStructureElements:function(e,t){t.elements[this.elementName.key]=this},CLASS_NAME:"Jsonix.Model.ElementPropertyInfo"}),Jsonix.Model.ElementsPropertyInfo=Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo,{elementTypeInfos:null,elementTypeInfosMap:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Ensure.ensureArray(e.elementTypeInfos),this.elementTypeInfos=e.elementTypeInfos},unmarshalElement:function(e,t,n){var r=t.getNameKey(),i=this.elementTypeInfosMap[r];if(Jsonix.Util.Type.exists(i))return n(i.unmarshal(e,t));throw new Error("Element ["+r+"] is not known in this context")},marshalElement:function(e,t,n){for(var r=0;r<this.elementTypeInfos.length;r++){var i=this.elementTypeInfos[r],s=i.typeInfo;if(s.isInstance(t)){var o=i.elementName;this.marshalElementTypeInfo(e,t,o,s,n);return}}throw new Error("Could not find an element with type info supporting the value ["+t+"].")},doBuild:function(e,t){this.elementTypeInfosMap={};for(var n=0;n<this.elementTypeInfos.length;n++){var r=this.elementTypeInfos[n];r.typeInfo=e.resolveTypeInfo(r.typeInfo,t),Jsonix.Util.Ensure.ensureObject(r),Jsonix.Util.Type.isObject(r.elementName)?(Jsonix.Util.Ensure.ensureString(r.elementName.localPart,"Element name must contain a string property [localPart]."),r.elementName=Jsonix.XML.QName.fromObject(r.elementName)):(Jsonix.Util.Ensure.ensureString(r.elementName),r.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,r.elementName)),this.elementTypeInfosMap[r.elementName.key]=r.typeInfo}},buildStructureElements:function(e,t){for(var n=0;n<this.elementTypeInfos.length;n++){var r=this.elementTypeInfos[n];t.elements[r.elementName.key]=this}},CLASS_NAME:"Jsonix.Model.ElementsPropertyInfo"}),Jsonix.Model.ElementMapPropertyInfo=Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo,{elementName:null,key:null,value:null,entryTypeInfo:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Ensure.ensureObject(e.key),Jsonix.Util.Ensure.ensureObject(e.value),Jsonix.Util.Type.isObject(e.elementName)?(Jsonix.Util.Ensure.ensureString(e.elementName.localPart,"Element name must contain a string property [localPart]."),this.elementName=Jsonix.XML.QName.fromObject(e.elementName)):Jsonix.Util.Type.isString(e.elementName)?this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.elementName):this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,this.name),this.entryTypeInfo=new Jsonix.Model.ClassInfo({name:"",localName:"",propertyInfos:[e.key,e.value]})},unmarshalWrapperElement:function(e,t){var n=Jsonix.Model.AbstractElementsPropertyInfo.prototype.unmarshalWrapperElement.apply(this,arguments)},unmarshal:function(e,t,n){var r=null,i=this,s=function(e){if(Jsonix.Util.Type.exists(e)){Jsonix.Util.Ensure.ensureObject(e,"Map property requires an object."),Jsonix.Util.Type.exists(r)||(r={});for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];if(i.collection)Jsonix.Util.Type.exists(r[t])||(r[t]=[]),r[t].push(n);else{if(!!Jsonix.Util.Type.exists(r[t]))throw new Error("Value was already set.");r[t]=n}}}};return Jsonix.Util.Type.exists(this.wrapperElementName)?this.unmarshalWrapperElement(e,n,s):this.unmarshalElement(e,n,s),r},unmarshalElement:function(e,t,n){var r=this.entryTypeInfo.unmarshal(e,t),i={};return!r[this.key.name]||(i[r[this.key.name]]=r[this.value.name]),n(i)},marshal:function(e,t,n,r){if(!Jsonix.Util.Type.exists(n))return;Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeStartElement(this.wrapperElementName),this.marshalElement(e,n,r),Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeEndElement()},marshalElement:function(e,t,n){if(!!t)for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(!this.collection){var s={};s[this.key.name]=r,s[this.value.name]=i,n.writeStartElement(this.elementName),this.entryTypeInfo.marshal(e,s,n),n.writeEndElement()}else for(var o=0;o<i.length;o++){var u={};u[this.key.name]=r,u[this.value.name]=i[o],n.writeStartElement(this.elementName),this.entryTypeInfo.marshal(e,u,n),n.writeEndElement()}}},doBuild:function(e,t){this.entryTypeInfo.build(e,t),this.key=this.entryTypeInfo.properties[0],this.value=this.entryTypeInfo.properties[1]},buildStructureElements:function(e,t){t.elements[this.elementName.key]=this},setProperty:function(e,t){if(Jsonix.Util.Type.exists(t)){Jsonix.Util.Ensure.ensureObject(t,"Map property requires an object."),Jsonix.Util.Type.exists(e[this.name])||(e[this.name]={});var n=e[this.name];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(this.collection){Jsonix.Util.Type.exists(n[r])||(n[r]=[]);for(var s=0;s<i.length;s++)n[r].push(i[s])}else n[r]=i}}},CLASS_NAME:"Jsonix.Model.ElementMapPropertyInfo"}),Jsonix.Model.AbstractElementRefsPropertyInfo=Jsonix.Class(Jsonix.Model.PropertyInfo,{wrapperElementName:null,mixed:!1,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e,"Options argument must be an object."),Jsonix.Model.PropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.isObject(e.wrapperElementName)?(Jsonix.Util.Ensure.ensureString(e.wrapperElementName.localPart,"Wrapper element name must contain a string property [localPart]."),this.wrapperElementName=Jsonix.XML.QName.fromObject(e.wrapperElementName)):Jsonix.Util.Type.isString(e.wrapperElementName)?this.wrapperElementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.wrapperElementName):this.wrapperElementName=null,Jsonix.Util.Type.isBoolean(e.mixed)?this.mixed=e.mixed:this.mixed=!1},unmarshal:function(e,t,n){var r=n.eventType;if(r===Jsonix.XML.Input.START_ELEMENT)return Jsonix.Util.Type.exists(this.wrapperElementName)?this.unmarshalWrapperElement(e,t,n):this.unmarshalElement(e,t,n);if(!(!this.mixed||r!==Jsonix.XML.Input.CHARACTERS&&r!==Jsonix.XML.Input.CDATA&&r!==Jsonix.XML.Input.ENTITY_REFERENCE)){var i=n.getText();return this.collection?[i]:i}if(r!==Jsonix.XML.Input.SPACE&&r!==Jsonix.XML.Input.COMMENT&&r!==Jsonix.XML.Input.PROCESSING_INSTRUCTION)throw new Error("Illegal state: unexpected event type ["+r+"].")},unmarshalWrapperElement:function(e,t,n){var r=null,i=n.next();while(i!==Jsonix.XML.Input.END_ELEMENT){if(i===Jsonix.XML.Input.START_ELEMENT){var s=this.unmarshalElement(e,t,n);if(this.collection){r===null&&(r=[]);for(var o=0;o<s.length;o++)r.push(s[o])}else{if(r!==null)throw new Error("Value already set.");r=s}}else if(!this.mixed||i!==Jsonix.XML.Input.CHARACTERS&&i!==Jsonix.XML.Input.CDATA&&i!==Jsonix.XML.Input.ENTITY_REFERENCE){if(i!==Jsonix.XML.Input.SPACE&&i!==Jsonix.XML.Input.COMMENT&&i!==Jsonix.XML.Input.PROCESSING_INSTRUCTION)throw new Error("Illegal state: unexpected event type ["+i+"].")}else{var u=n.getText();if(this.collection)r===null&&(r=[]),r.push(u);else{if(r!==null)throw new Error("Value already set.");r=u}}i=n.next()}return r},unmarshalElement:function(e,t,n){var r=n.getName(),i=this.getElementTypeInfo(e,t,r),s={name:r,value:i.unmarshal(e,n)};return this.collection?[s]:s},marshal:function(e,t,n,r){if(Jsonix.Util.Type.exists(n)){Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeStartElement(this.wrapperElementName);if(!this.collection)this.marshalItem(e,t,n,r);else{Jsonix.Util.Ensure.ensureArray(n,"Collection property requires an array value.");for(var i=0;i<n.length;i++){var s=n[i];this.marshalItem(e,t,s,r)}}Jsonix.Util.Type.exists(this.wrapperElementName)&&r.writeEndElement()}},marshalItem:function(e,t,n,r){if(Jsonix.Util.Type.isString(n)){if(!this.mixed)throw new Error("Property is not mixed, can't handle string values.");r.writeCharacters(n)}else{if(!Jsonix.Util.Type.isObject(n))throw this.mixed?new Error("Unsupported content type, either objects or strings are supported."):new Error("Unsupported content type, only objects are supported.");this.marshalElement(e,t,n,r)}},marshalElement:function(e,t,n,r){var i=Jsonix.XML.QName.fromObject(n.name),s=this.getElementTypeInfo(e,t,i);return this.marshalElementTypeInfo(e,n,i,s,r)},marshalElementTypeInfo:function(e,t,n,r,i){i.writeStartElement(n),Jsonix.Util.Type.exists(t.value)&&r.marshal(e,t.value,i),i.writeEndElement()},getElementTypeInfo:function(e,t,n){var r=this.getPropertyElementTypeInfo(n);if(Jsonix.Util.Type.exists(r))return r.typeInfo;var i=e.getElementInfo(n,t);if(Jsonix.Util.Type.exists(i))return i.typeInfo;throw new Error("Element ["+n.key+"] is not known in this context.")},getPropertyElementTypeInfo:function(e){throw new Error("Abstract method [getPropertyElementTypeInfo].")},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t);if(Jsonix.Util.Type.exists(t.value))throw new Error("The structure already defines a value property.");Jsonix.Util.Type.exists(t.elements)||(t.elements={}),Jsonix.Util.Type.exists(this.wrapperElementName)?t.elements[this.wrapperElementName.key]=this:this.buildStructureElements(e,t),this.mixed&&!Jsonix.Util.Type.exists(this.wrapperElementName)&&(t.mixed=this)},buildStructureElements:function(e,t){throw new Error("Abstract method [buildStructureElements].")},buildStructureElementTypeInfos:function(e,t,n){t.elements[n.elementName.key]=this;var r=e.getSubstitutionMembers(n.elementName);if(Jsonix.Util.Type.isArray(r))for(var i=0;i<r.length;i++){var s=r[i];this.buildStructureElementTypeInfos(e,t,s)}},CLASS_NAME:"Jsonix.Model.ElementRefPropertyInfo"}),Jsonix.Model.ElementRefPropertyInfo=Jsonix.Class(Jsonix.Model.AbstractElementRefsPropertyInfo,{typeInfo:"String",elementName:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.AbstractElementRefsPropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.exists(e.typeInfo)&&(Jsonix.Util.Type.isObject(e.typeInfo)?(Jsonix.Util.Ensure.ensureObject(e.typeInfo),this.typeInfo=e.typeInfo):(Jsonix.Util.Ensure.ensureString(e.typeInfo),this.typeInfo=e.typeInfo)),Jsonix.Util.Type.isObject(e.elementName)?this.elementName=Jsonix.XML.QName.fromObject(e.elementName):Jsonix.Util.Type.isString(e.elementName)?this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.elementName):this.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,this.name)},getPropertyElementTypeInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.localPart);var t=Jsonix.XML.QName.fromObject(e);return t.key===this.elementName.key?this:null},doBuild:function(e,t){this.typeInfo=e.resolveTypeInfo(this.typeInfo,t)},buildStructureElements:function(e,t){this.buildStructureElementTypeInfos(e,t,this)},CLASS_NAME:"Jsonix.Model.ElementRefPropertyInfo"}),Jsonix.Model.ElementRefsPropertyInfo=Jsonix.Class(Jsonix.Model.AbstractElementRefsPropertyInfo,{elementTypeInfos:null,elementTypeInfosMap:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.AbstractElementRefsPropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Ensure.ensureArray(e.elementTypeInfos),this.elementTypeInfos=e.elementTypeInfos},getPropertyElementTypeInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.localPart);var t=Jsonix.XML.QName.fromObject(e),n=this.elementTypeInfosMap[t.key];return Jsonix.Util.Type.exists(n)?{elementName:t,typeInfo:n}:null},doBuild:function(e,t){this.elementTypeInfosMap={};for(var n=0;n<this.elementTypeInfos.length;n++){var r=this.elementTypeInfos[n];r.typeInfo=e.resolveTypeInfo(r.typeInfo,t),Jsonix.Util.Ensure.ensureObject(r),Jsonix.Util.Type.isObject(r.elementName)?(Jsonix.Util.Ensure.ensureString(r.elementName.localPart,"Element name must contain a string property [localPart]."),r.elementName=Jsonix.XML.QName.fromObject(r.elementName)):(Jsonix.Util.Ensure.ensureString(r.elementName),r.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,r.elementName)),this.elementTypeInfosMap[r.elementName.key]=r.typeInfo}},buildStructureElements:function(e,t){for(var n=0;n<this.elementTypeInfos.length;n++){var r=this.elementTypeInfos[n];this.buildStructureElementTypeInfos(e,t,r)}},CLASS_NAME:"Jsonix.Model.ElementRefsPropertyInfo"}),Jsonix.Model.AnyElementPropertyInfo=Jsonix.Class(Jsonix.Model.PropertyInfo,{allowDom:!0,allowTypedObject:!0,mixed:!0,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Model.PropertyInfo.prototype.initialize.apply(this,[e]),Jsonix.Util.Type.isBoolean(e.allowDom)?this.allowDom=e.allowDom:this.allowDom=!0,Jsonix.Util.Type.isBoolean(e.allowTypedObject)?this.allowTypedObject=e.allowTypedObject:this.allowTypedObject=!0,Jsonix.Util.Type.isBoolean(e.mixed)?this.mixed=e.mixed:this.mixed=!0},unmarshal:function(e,t,n){var r=n.eventType;if(r===Jsonix.XML.Input.START_ELEMENT)return this.unmarshalElement(e,t,n);if(!this.mixed||r!==4&&r!==12&&r!==9){if(this.mixed&&r===Jsonix.XML.Input.SPACE)return null;if(r===Jsonix.XML.Input.COMMENT||r===Jsonix.XML.Input.PROCESSING_INSTRUCTION)return null;throw new Error("Illegal state: unexpected event type ["+r+"].")}var i=n.getText();return this.collection?[i]:i},unmarshalElement:function(e,t,n){var r=n.getName(),i;if(this.allowTypedObject&&Jsonix.Util.Type.exists(e.getElementInfo(r,t))){var s=e.getElementInfo(r,t),o=s.typeInfo,u=Jsonix.Model.Adapter.getAdapter(s);i={name:r,value:u.unmarshal(e,n,o)}}else{if(!this.allowDom)throw new Error("Element ["+r.toString()+"] is not known in this context and property does not allow DOM.");i=n.getElement()}return this.collection?[i]:i},marshal:function(e,t,n,r){if(!Jsonix.Util.Type.exists(n))return;if(!this.collection)this.marshalItem(e,n,r);else{Jsonix.Util.Ensure.ensureArray(n);for(var i=0;i<n.length;i++)this.marshalItem(e,n[i],r)}},marshalItem:function(e,t,n){if(this.mixed&&Jsonix.Util.Type.isString(t))n.writeCharacters(t);else if(this.allowDom&&Jsonix.Util.Type.exists(t.nodeType))n.writeNode(t);else{var r=Jsonix.XML.QName.fromObject(t.name);if(!this.allowTypedObject||!Jsonix.Util.Type.exists(e.getElementInfo(r)))throw new Error("Element ["+r.toString()+"] is not known in this context");var i=e.getElementInfo(r),s=i.typeInfo,o=Jsonix.Model.Adapter.getAdapter(i);n.writeStartElement(r),o.marshal(e,t.value,n,s),n.writeEndElement()}},doBuild:function(e,t){},buildStructure:function(e,t){Jsonix.Util.Ensure.ensureObject(t);if(Jsonix.Util.Type.exists(t.value))throw new Error("The structure already defines a value property.");Jsonix.Util.Type.exists(t.elements)||(t.elements={});if(this.allowDom||this.allowTypedObject)t.any=this;this.mixed&&(t.mixed=this)},CLASS_NAME:"Jsonix.Model.AnyElementPropertyInfo"}),Jsonix.Model.Module=Jsonix.Class({name:null,typeInfos:null,elementInfos:null,defaultElementNamespaceURI:"",defaultAttributeNamespaceURI:"",initialize:function(e){this.typeInfos=[],this.elementInfos=[];if(typeof e!="undefined"){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Type.isString(e.name)&&(this.name=e.name),Jsonix.Util.Type.isString(e.defaultElementNamespaceURI)&&(this.defaultElementNamespaceURI=e.defaultElementNamespaceURI),Jsonix.Util.Type.isString(e.defaultAttributeNamespaceURI)&&(this.defaultAttributeNamespaceURI=e.defaultAttributeNamespaceURI),Jsonix.Util.Type.isArray(e.typeInfos)&&this.initializeTypeInfos(e.typeInfos);for(var t in e)e.hasOwnProperty(t)&&e[t]instanceof Jsonix.Model.ClassInfo&&this.typeInfos.push(e[t]);Jsonix.Util.Type.isArray(e.elementInfos)&&this.initializeElementInfos(e.elementInfos)}},initializeTypeInfos:function(e){Jsonix.Util.Ensure.ensureArray(e);var t,n,r;for(t=0;t<e.length;t++)n=e[t],r=this.createTypeInfo(n),this.typeInfos.push(r)},initializeElementInfos:function(e){Jsonix.Util.Ensure.ensureArray(e);var t,n,r;for(t=0;t<e.length;t++)n=e[t],r=this.createElementInfo(n),this.elementInfos.push(r)},createTypeInfo:function(e){Jsonix.Util.Ensure.ensureObject(e);var t;if(e instanceof Jsonix.Model.TypeInfo)t=e;else{Jsonix.Util.Ensure.ensureString(e.type);var n=e.type;if(!Jsonix.Util.Type.isFunction(this.typeInfoCreators[n]))throw new Error("Unknown type info type ["+n+"].");var r=this.typeInfoCreators[n];t=r.call(this,e)}return t},createClassInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Type.isString(e.defaultElementNamespaceURI)||(e.defaultElementNamespaceURI=this.defaultElementNamespaceURI),Jsonix.Util.Type.isString(e.defaultAttributeNamespaceURI)||(e.defaultAttributeNamespaceURI=this.defaultAttributeNamespaceURI);if(Jsonix.Util.Type.isString(e.name))Jsonix.Util.Type.isString(e.localName)||(Jsonix.Util.Type.isString(this.name)?e.name.indexOf(this.name+".")===0?e.localName=e.name.substring(this.name.length+1):e.localName=e.name:e.localName=e.name);else{if(!Jsonix.Util.Type.isString(e.localName))throw new Error("Neither [name] nor [localName] was provided for the class info.");Jsonix.Util.Type.isString(this.name)?e.name=this.name+"."+e.localName:e.name=e.localName}var t=new Jsonix.Model.ClassInfo(e);return t},createList:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureExists(e.typeInfo);var t=e.typeInfo,n=e.typeName||null,r=e.separator||" ";return new Jsonix.Schema.XSD.List(t,n,r)},createElementInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureExists(e.elementName),Jsonix.Util.Ensure.ensureExists(e.typeInfo);if(Jsonix.Util.Type.isObject(e.elementName))e.elementName=Jsonix.XML.QName.fromObject(e.elementName);else{if(!Jsonix.Util.Type.isString(e.elementName))throw new Error("Element info ["+e+"] must provide an element name.");e.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.elementName)}Jsonix.Util.Type.exists(e.substitutionHead)&&(Jsonix.Util.Type.isObject(e.substitutionHead)?e.substitutionHead=Jsonix.XML.QName.fromObject(e.substitutionHead):(Jsonix.Util.Ensure.ensureString(e.substitutionHead),e.substitutionHead=new Jsonix.XML.QName(this.defaultElementNamespaceURI,e.substitutionHead)));var t=new Jsonix.Model.ElementInfo(e);return t},registerTypeInfos:function(e){for(var t=0;t<this.typeInfos.length;t++){var n=this.typeInfos[t];e.registerTypeInfo(n)}},buildTypeInfos:function(e){for(var t=0;t<this.typeInfos.length;t++){var n=this.typeInfos[t];n.build(e,this)}},registerElementInfos:function(e){for(var t=0;t<this.elementInfos.length;t++){var n=this.elementInfos[t];e.registerElementInfo(n)}},buildElementInfos:function(e){for(var t=0;t<this.elementInfos.length;t++){var n=this.elementInfos[t];n.build(e,this)}},cs:function(){return this},es:function(){return this},CLASS_NAME:"Jsonix.Model.Module"}),Jsonix.Model.Module.prototype.typeInfoCreators={classInfo:Jsonix.Model.Module.prototype.createClassInfo,list:Jsonix.Model.Module.prototype.createList},Jsonix.Context=Jsonix.Class({modules:[],typeInfos:null,elementInfos:null,properties:null,substitutionMembersMap:null,scopedElementInfosMap:null,initialize:function(e,t){this.modules=[],this.elementInfos=[],this.typeInfos={},this.registerBuiltinTypeInfos(),this.properties={namespacePrefixes:{}},this.substitutionMembersMap={},this.scopedElementInfosMap={},Jsonix.Util.Type.exists(t)&&Jsonix.Util.Ensure.ensureObject(t)&&Jsonix.Util.Type.isObject(t.namespacePrefixes)&&(this.properties.namespacePrefixes=t.namespacePrefixes);if(Jsonix.Util.Type.exists(e)){Jsonix.Util.Ensure.ensureArray(e);var n,r,i;for(n=0;n<e.length;n++)r=e[n],i=this.createModule(r),this.modules[n]=i}this.processModules()},createModule:function(e){var t;return e instanceof Jsonix.Model.Module?t=e:t=new Jsonix.Model.Module(e),t},registerBuiltinTypeInfos:function(){for(var e=0;e<this.builtinTypeInfos.length;e++)this.registerTypeInfo(this.builtinTypeInfos[e])},processModules:function(){var e,t;for(e=0;e<this.modules.length;e++)t=this.modules[e],t.registerTypeInfos(this);for(e=0;e<this.modules.length;e++)t=this.modules[e],t.buildTypeInfos(this);for(e=0;e<this.modules.length;e++)t=this.modules[e],t.registerElementInfos(this);for(e=0;e<this.modules.length;e++)t=this.modules[e],t.buildElementInfos(this)},registerTypeInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureString(e.name),this.typeInfos[e.name]=e},resolveTypeInfo:function(e,t){if(!Jsonix.Util.Type.exists(e))return null;if(e instanceof Jsonix.Model.TypeInfo)return e;if(Jsonix.Util.Type.isString(e)){if(!this.typeInfos[e])throw new Error("Type info ["+e+"] is not known in this context.");return this.typeInfos[e]}Jsonix.Util.Ensure.ensureObject(t,"Type info mapping can only be resolved if module is provided.");var n=t.createTypeInfo(e);return n.build(this,t),n},registerElementInfo:function(e){Jsonix.Util.Ensure.ensureObject(e),this.elementInfos.push(e);if(Jsonix.Util.Type.exists(e.substitutionHead)){var t=e.substitutionHead,n=t.key,r=this.substitutionMembersMap[n];Jsonix.Util.Type.isArray(r)||(r=[],this.substitutionMembersMap[n]=r),r.push(e)}var i;Jsonix.Util.Type.exists(e.scope)?i=this.resolveTypeInfo(e.scope).name:i="##global";var s=this.scopedElementInfosMap[i];Jsonix.Util.Type.isObject(s)||(s={},this.scopedElementInfosMap[i]=s),s[e.elementName.key]=e},getElementInfo:function(e,t){if(Jsonix.Util.Type.exists(t)){var n=t.name,r=this.scopedElementInfosMap[n];if(Jsonix.Util.Type.exists(r)){var i=r[e.key];if(Jsonix.Util.Type.exists(i))return i}}var s="##global",o=this.scopedElementInfosMap[s];if(Jsonix.Util.Type.exists(o)){var u=o[e.key];if(Jsonix.Util.Type.exists(u))return u}return null},getSubstitutionMembers:function(e){return this.substitutionMembersMap[Jsonix.XML.QName.fromObject(e).key]},createMarshaller:function(){return new Jsonix.Context.Marshaller(this)},createUnmarshaller:function(){return new Jsonix.Context.Unmarshaller(this)},builtinTypeInfos:[Jsonix.Schema.XSD.AnyType.INSTANCE,Jsonix.Schema.XSD.AnyURI.INSTANCE,Jsonix.Schema.XSD.Base64Binary.INSTANCE,Jsonix.Schema.XSD.Boolean.INSTANCE,Jsonix.Schema.XSD.Byte.INSTANCE,Jsonix.Schema.XSD.Calendar.INSTANCE,Jsonix.Schema.XSD.Date.INSTANCE,Jsonix.Schema.XSD.DateTime.INSTANCE,Jsonix.Schema.XSD.Decimal.INSTANCE,Jsonix.Schema.XSD.Double.INSTANCE,Jsonix.Schema.XSD.Duration.INSTANCE,Jsonix.Schema.XSD.Float.INSTANCE,Jsonix.Schema.XSD.GDay.INSTANCE,Jsonix.Schema.XSD.GMonth.INSTANCE,Jsonix.Schema.XSD.GMonthDay.INSTANCE,Jsonix.Schema.XSD.GYear.INSTANCE,Jsonix.Schema.XSD.GYearMonth.INSTANCE,Jsonix.Schema.XSD.HexBinary.INSTANCE,Jsonix.Schema.XSD.ID.INSTANCE,Jsonix.Schema.XSD.IDREF.INSTANCE,Jsonix.Schema.XSD.IDREFS.INSTANCE,Jsonix.Schema.XSD.Int.INSTANCE,Jsonix.Schema.XSD.Integer.INSTANCE,Jsonix.Schema.XSD.Language.INSTANCE,Jsonix.Schema.XSD.Long.INSTANCE,Jsonix.Schema.XSD.Name.INSTANCE,Jsonix.Schema.XSD.NCName.INSTANCE,Jsonix.Schema.XSD.NegativeInteger.INSTANCE,Jsonix.Schema.XSD.NMToken.INSTANCE,Jsonix.Schema.XSD.NMTokens.INSTANCE,Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE,Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE,Jsonix.Schema.XSD.NormalizedString.INSTANCE,Jsonix.Schema.XSD.Number.INSTANCE,Jsonix.Schema.XSD.PositiveInteger.INSTANCE,Jsonix.Schema.XSD.QName.INSTANCE,Jsonix.Schema.XSD.Short.INSTANCE,Jsonix.Schema.XSD.String.INSTANCE,Jsonix.Schema.XSD.Strings.INSTANCE,Jsonix.Schema.XSD.Time.INSTANCE,Jsonix.Schema.XSD.Token.INSTANCE,Jsonix.Schema.XSD.UnsignedByte.INSTANCE,Jsonix.Schema.XSD.UnsignedInt.INSTANCE,Jsonix.Schema.XSD.UnsignedLong.INSTANCE,Jsonix.Schema.XSD.UnsignedShort.INSTANCE],CLASS_NAME:"Jsonix.Context"}),Jsonix.Context.Marshaller=Jsonix.Class({context:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),this.context=e},marshalString:function(e){var t=this.marshalDocument(e),n=Jsonix.DOM.serialize(t);return n},marshalDocument:function(e){var t=new Jsonix.XML.Output({namespacePrefixes:this.context.properties.namespacePrefixes}),n=t.writeStartDocument();return this.marshalElementNode(e,t),t.writeEndDocument(),n},marshalElementNode:function(e,t){Jsonix.Util.Ensure.ensureObject(e),Jsonix.Util.Ensure.ensureObject(e.name),Jsonix.Util.Ensure.ensureString(e.name.localPart),Jsonix.Util.Ensure.ensureExists(e.value);var n=Jsonix.XML.QName.fromObject(e.name),r=this.context.getElementInfo(n);if(!Jsonix.Util.Type.exists(r))throw new Error("Could not find element declaration for the element ["+n.key+"].");Jsonix.Util.Ensure.ensureObject(r.typeInfo);var i=r.typeInfo,s=t.writeStartElement(e.name),o=Jsonix.Model.Adapter.getAdapter(r);return o.marshal(this.context,e.value,t,i),t.writeEndElement(),s},CLASS_NAME:"Jsonix.Context.Marshaller"}),Jsonix.Context.Unmarshaller=Jsonix.Class({context:null,initialize:function(e){Jsonix.Util.Ensure.ensureObject(e),this.context=e},unmarshalString:function(e){Jsonix.Util.Ensure.ensureString(e);var t=Jsonix.DOM.parse(e);return this.unmarshalDocument(t)},unmarshalURL:function(e,t,n){Jsonix.Util.Ensure.ensureString(e),Jsonix.Util.Ensure.ensureFunction(t),Jsonix.Util.Type.exists(n)&&Jsonix.Util.Ensure.ensureObject(n),that=this,Jsonix.DOM.load(e,function(e){t(that.unmarshalDocument(e))},n)},unmarshalFile:function(e,t,n){Jsonix.Util.Ensure.ensureString(e),Jsonix.Util.Ensure.ensureFunction(t),Jsonix.Util.Type.exists(n)&&Jsonix.Util.Ensure.ensureObject(n),that=this;var r=require("fs");r.readFile(e,n,function(e,n){if(e)throw e;var r=n.toString(),i=Jsonix.DOM.parse(r);t(that.unmarshalDocument(i))})},unmarshalDocument:function(e){var t=new Jsonix.XML.Input(e),n=null;return t.nextTag(),this.unmarshalElementNode(t)},unmarshalElementNode:function(e){if(e.eventType!=1)throw new Error("Parser must be on START_ELEMENT to read next text.");var t=null,n=Jsonix.XML.QName.fromObject(e.getName()),r=this.context.getElementInfo(n);if(!Jsonix.Util.Type.exists(r))throw new Error("Could not find element declaration for the element ["+n.key+"].");Jsonix.Util.Ensure.ensureObject(r.typeInfo);var i=r.typeInfo,s=Jsonix.Model.Adapter.getAdapter(r),o=s.unmarshal(this.context,e,i);return t={name:n,value:o},t},CLASS_NAME:"Jsonix.Context.Unmarshaller"}),define("jsonix",function(){}),function(){function e(){}function i(e,t){var n=e.length;while(n--)if(e[n].listener===t)return n;return-1}function s(e){return function(){return this[e].apply(this,arguments)}}var t=e.prototype,n=this,r=n.EventEmitter;t.getListeners=function(t){var n=this._getEvents(),r,i;if(t instanceof RegExp){r={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(r[i]=n[i])}else r=n[t]||(n[t]=[]);return r},t.flattenListeners=function(t){var n=[],r;for(r=0;r<t.length;r+=1)n.push(t[r].listener);return n},t.getListenersAsObject=function(t){var n=this.getListeners(t),r;return n instanceof Array&&(r={},r[t]=n),r||n},t.addListener=function(t,n){var r=this.getListenersAsObject(t),s=typeof n=="object",o;for(o in r)r.hasOwnProperty(o)&&i(r[o],n)===-1&&r[o].push(s?n:{listener:n,once:!1});return this},t.on=s("addListener"),t.addOnceListener=function(t,n){return this.addListener(t,{listener:n,once:!0})},t.once=s("addOnceListener"),t.defineEvent=function(t){return this.getListeners(t),this},t.defineEvents=function(t){for(var n=0;n<t.length;n+=1)this.defineEvent(t[n]);return this},t.removeListener=function(t,n){var r=this.getListenersAsObject(t),s,o;for(o in r)r.hasOwnProperty(o)&&(s=i(r[o],n),s!==-1&&r[o].splice(s,1));return this},t.off=s("removeListener"),t.addListeners=function(t,n){return this.manipulateListeners(!1,t,n)},t.removeListeners=function(t,n){return this.manipulateListeners(!0,t,n)},t.manipulateListeners=function(t,n,r){var i,s,o=t?this.removeListener:this.addListener,u=t?this.removeListeners:this.addListeners;if(typeof n!="object"||n instanceof RegExp){i=r.length;while(i--)o.call(this,n,r[i])}else for(i in n)n.hasOwnProperty(i)&&(s=n[i])&&(typeof s=="function"?o.call(this,i,s):u.call(this,i,s));return this},t.removeEvent=function(t){var n=typeof t,r=this._getEvents(),i;if(n==="string")delete r[t];else if(t instanceof RegExp)for(i in r)r.hasOwnProperty(i)&&t.test(i)&&delete r[i];else delete this._events;return this},t.removeAllListeners=s("removeEvent"),t.emitEvent=function(t,n){var r=this.getListenersAsObject(t),i,s,o,u;for(o in r)if(r.hasOwnProperty(o)){s=r[o].length;while(s--)i=r[o][s],i.once===!0&&this.removeListener(t,i.listener),u=i.listener.apply(this,n||[]),u===this._getOnceReturnValue()&&this.removeListener(t,i.listener)}return this},t.trigger=s("emitEvent"),t.emit=function(t){var n=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,n)},t.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},t._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},t._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return n.EventEmitter=r,e},typeof define=="function"&&define.amd?define("EventEmitter",[],function(){return e}):typeof module=="object"&&module.exports?module.exports=e:this.EventEmitter=e}.call(this);var info_kwarc_sally_comm_core={name:"info_kwarc_sally_comm_core",defaultElementNamespaceURI:"http://kwarc.info/sally/comm/core",typeInfos:[{type:"classInfo",localName:"HeartbeatResponse",propertyInfos:[]},{type:"classInfo",localName:"HeartbeatRequest",propertyInfos:[]},{type:"classInfo",localName:"RegisterClientResponse",propertyInfos:[{type:"element",name:"sendQueue",elementName:"SendQueue",typeInfo:"String"}]},{type:"classInfo",localName:"RegisterClientRequest",propertyInfos:[{type:"element",name:"listenQueue",elementName:"ListenQueue",typeInfo:"String"},{type:"element",name:"schemas",collection:!0,elementName:"Schemas",typeInfo:"String"},{type:"element",name:"environmentID",elementName:"EnvironmentID",typeInfo:"String"}]}],elementInfos:[{elementName:"HeartbeatResponse",typeInfo:"info_kwarc_sally_comm_core.HeartbeatResponse"},{elementName:"HeartbeatRequest",typeInfo:"info_kwarc_sally_comm_core.HeartbeatRequest"},{elementName:"RegisterClientResponse",typeInfo:"info_kwarc_sally_comm_core.RegisterClientResponse"},{elementName:"RegisterClientRequest",typeInfo:"info_kwarc_sally_comm_core.RegisterClientRequest"}]};typeof window=="undefined"&&(module.exports.info_kwarc_sally_comm_core=info_kwarc_sally_comm_core),define("info_kwarc_sally_comm_core",function(){}),define("sally_client",["require","stomp","jsonix","EventEmitter","info_kwarc_sally_comm_core"],function(e){var t,n,r,i,s,o,u,a,f;return e("stomp"),e("jsonix"),f=new RegExp('xmlns(:(\\w+))?="http://kwarc.info/sally/comm/([\\w/:.]+)"'),t=e("EventEmitter"),e("info_kwarc_sally_comm_core"),i=new Jsonix.Context([info_kwarc_sally_comm_core]),a=i.createUnmarshaller(),u=i.createMarshaller(),s=function(e,t,n){return{name:{localPart:"RegisterClientRequest",namespaceURI:"http://kwarc.info/sally/comm/core"},value:{listenQueue:e,environmentID:t,schemas:_.map(n,function(e){return e.getName()})}}},o={name:{localPart:"HeartbeatResponse",namespaceURI:"http://kwarc.info/sally/comm/core"},value:{}},r={},n=function(){function e(e,t){this.config=e,this.msgHandler=t,r[e.stompUrl]!=null?this.stompClient=r[e.stompUrl]:(this.stompClient=Stomp.client(e.stompUrl),r[e.stompUrl]=this.stompClient,this.stompClient.connect(e.stompUser,e.stompPassword,function(e){return this.stompClient.connection_div.emit("onConnected")}.bind(this)))}return e.prototype.register=function(e,n,r){var i,l,c;return this.schemas=e,l=this,i=this.stompClient,i.connected?r():(i.connection_div==null&&(i.connection_div=new t),c={},_.each(this.schemas,function(e){return c[e.getName()]=e}),i.connection_div.on("onConnected",function(t){return function(i){return t.privateQueue="editor_tools_"+Math.floor(Math.random()*1e5),t.stompClient.subscribe("/queue/"+t.privateQueue,function(e){var n,r,i;i=f.exec(e.body)[3],console.log(i);if(i!=="core")return r=c[i],n=r.unmarshal(e.body),r.handleMessage(n,function(n){return t.send(e.headers["reply-to"],r.marshal(n),null,{"correlation-id":e.headers["correlation-id"]})});n=a.unmarshalString(e.body),n.name.localPart==="HeartbeatRequest"&&t.send(e.headers["reply-to"],u.marshalString(o),null,{"correlation-id":e.headers["correlation-id"]})}),t.send("/queue/sally_register",u.marshalString(s(t.privateQueue,n,e)),function(t){var n;return n=t.value.sendQueue,_.each(e,function(e){return e.send=function(t,r,i){return l.send(n,e.marshal(t),r,i)}}),r()})}}(this)))},e.prototype.send=function(e,t,n,r){var i,s,o;return n!=null&&(i=Math.random(),s="/temp-queue/editor_exchange"+i,o=this.stompClient.subscribe(s,function(e){return function(t){var r;r=a.unmarshalString(t.body);if(n(r,t)===!0)return;return e.stompClient.unsubscribe(i)}}(this),{id:i}),r==null&&(r={}),r["reply-to"]=s,r["correlation-id"]=i),console.log("sending to ",e," msg ",t),this.stompClient.send(e,r,t.toString())},e}()});
New to GrepCode? Check out our FAQ X