var gdjs;(function(u){let d;(function(g){let p;(function(r){r.sendAsyncRequest=function(e,s,i,c,a,o){const n=t=>{t instanceof ProgressEvent&&t.currentTarget&&t.currentTarget instanceof XMLHttpRequest&&t.currentTarget.status===0?o.setString("REQUEST_NOT_SENT"):o.setString(""+t)};try{const t=new XMLHttpRequest;t.onerror=n,t.ontimeout=n,t.onabort=n,t.onreadystatechange=()=>{t.readyState===XMLHttpRequest.DONE&&(t.status>=400&&n(""+t.status),a.setString(t.responseText))},t.open(i,e),t.setRequestHeader("Content-Type",c===""?"application/x-www-form-urlencoded":c),t.send(s)}catch(t){n(t)}},r.sendAwaitableAsyncRequest=(e,s,i,c,a,o)=>new u.PromiseTask(fetch(e,{body:i!=="GET"?s:void 0,method:i,headers:{"Content-Type":c||"application/x-www-form-urlencoded"}}).then(async n=>{const t=await n.text();n.status>=400&&o.setString(""+n.status),a.setString(t)},n=>{o.setString(""+n)}));const b=e=>new Promise(s=>setTimeout(s,e));r.retryIfFailed=async({times:e,delayInMs:s},i)=>{let c=0,a=null;for(;c<e;){c++,a=null;try{return await i()}catch(o){s&&await b(s),a=o}}throw a},r.sendDeprecatedSynchronousRequest=function(e,s,i,c,a,o){try{let n;if(typeof XMLHttpRequest!="undefined")n=new XMLHttpRequest;else{const t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let l=0,f=t.length;l<f;l++)try{n=new ActiveXObject(t[l]);break}catch{}}if(n===void 0)return;n.open(c,e+s,!1),n.setRequestHeader("Content-Type",a===""?"application/x-www-form-urlencoded":a),n.send(i),o.setString(n.responseText)}catch{}},r.enableMetrics=function(e,s){e.getGame().enableMetrics(s)},r.variableStructureToJSON=function(e){return JSON.stringify(e.toJSObject())},r.objectVariableStructureToJSON=function(e,s){return JSON.stringify(s.toJSObject())},r._objectToVariable=function(e,s){s.fromJSObject(e)},r.jsonToVariableStructure=function(e,s){s.fromJSON(e)},r.jsonToObjectVariableStructure=function(e,s,i){i.fromJSON(e)}})(p=g.network||(g.network={}))})(d=u.evtTools||(u.evtTools={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=networktools.js.map
