/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/
(function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[16],{444:function(Ba,ua,r){function pa(){return!1}function ka(ba,w,ea){if(!(w in n))return!0;w=n[w];for(var ja=0;ja<w.length;ja++){var aa=ba;var ca=w[ja];var ia=ea;if(ca.name in aa){var ha="",la=!1;aa=aa[ca.name];switch(ca.type){case "s":ha="String";la=Object(fa.isString)(aa);break;case "a":ha="Array";la=Object(fa.isArray)(aa);break;case "n":ha="Number";la=Object(fa.isNumber)(aa)&&Object(fa.isFinite)(aa);break;case "o":ha="Object",
la=Object(fa.isObject)(aa)&&!Object(fa.isArray)(aa)}la||ia.reject('Expected response field "'+ca.name+'" to have type '+ha);ca=la}else ia.reject('Response missing field "'+ca.name+'"'),ca=!1;if(!ca)return!1}return!0}r.r(ua);var ma=r(1),fa=r(0);r.n(fa);var da=r(2);Ba=r(51);var z=r(34),x=r(462),y=r(94),f=r(375),e=r(40),a=r(163),b=function(){function ba(){this.request=this.result=null;this.state=0;var w=this;w.promise=new Promise(function(ea,ja){w.resolve=function(){if(0===w.state||4===w.state)w.state=
1,w.result=arguments[0],ea.apply(null,arguments)};w.reject=function(){if(0===w.state||4===w.state)w.state=2,ja.apply(null,arguments)}})}ba.prototype.Vs=function(){return 1===(this.state&1)};ba.prototype.tda=function(){return 2===(this.state&2)};ba.prototype.Li=function(){return!this.tda()&&!this.Vs()};ba.prototype.Vca=function(){return 4===(this.state&4)};ba.prototype.ZL=function(){this.state|=4};return ba}(),h=function(){function ba(){this.Gs={};this.Bb=[]}ba.prototype.pop=function(){var w=this.Bb.pop();
this.Gs[w.key]=void 0;return w};ba.prototype.push=function(w,ea){ea={key:w,data:ea};this.Bb.push(ea);this.Gs[w]=ea.data};ba.prototype.contains=function(w){return!!this.Gs[w]};ba.prototype.get=function(w){return this.Gs[w]};ba.prototype.set=function(w,ea){var ja=this;this.Gs[w]=ea;this.Bb.forEach(function(aa,ca){aa.key===w&&(ja.Bb[ca]=aa)})};ba.prototype.remove=function(w){var ea=this;this.Gs[w]=void 0;this.Bb.forEach(function(ja,aa){ja.key===w&&ea.Bb.splice(aa,1)})};ba.prototype.length=function(){return this.Bb.length};
return ba}(),n={pages:[{name:"pages",type:"a"}],pdf:[{name:"url",type:"s"}],docmod:[{name:"url",type:"s"},{name:"rID",type:"s"}],health:[],tiles:[{name:"z",type:"n"},{name:"rID",type:"n"},{name:"tiles",type:"a"},{name:"size",type:"n"}],cAnnots:[{name:"annots",type:"a"}],annots:[{name:"url",type:"s"},{name:"name",type:"s"}],image:[{name:"url",type:"s"},{name:"name",type:"s"},{name:"p",type:"n"}],text:[{name:"url",type:"s"},{name:"name",type:"s"},{name:"p",type:"n"}],ApString2Xod:[{name:"url",type:"s"},
{name:"rID",type:"s"}]};r=function(){function ba(w,ea,ja){var aa=this;this.xM=this.PR=!1;this.$g=this.eF=this.hu=this.AK=this.jH=this.zm=null;this.Zl=new b;this.sp=new b;this.iB=!1;this.sf=this.we=this.xe=this.jf=null;this.Jf=[];this.UB=[];this.cache={};this.timeStamp=0;this.Vg=[];this.Wi=[];this.mI=null;this.DR=!1;this.cY=this.id=null;this.nK=this.bU=pa;this.Vh=0;this.vJ=!1;this.FV=1;this.Ri={};this.Er=0;this.zt=new h;ea.endsWith("/")||(ea+="/");ja=ja||{};this.PR=ja.disableWebsockets||!1;this.xM=
ja.singleServerMode||!1;null!=ja.customQueryParameters&&Object(e.b)("wvsQueryParameters",ja.customQueryParameters);ea.endsWith("blackbox/")||(ea+="blackbox/");this.zm=ja.uploadData||null;this.hu=ja.uriData||null;this.jH=ja.cacheKey||null;this.AK=ja.officeOptions||null;this.Ne=ea;this.PH=w;this.qo(!0);this.Tr=(new x.a(ea,null,this.Gh())).q$(!this.PR,function(ca){aa.Nea(ca)},function(){return null},function(){aa.iB=!1},function(){aa.Pha()})}ba.prototype.Y6=function(){var w=this;return new Promise(function(ea,
ja){var aa=new XMLHttpRequest;aa.open("GET",w.Ne+"ck");aa.withCredentials=w.Gh();aa.onreadystatechange=function(){aa.readyState===XMLHttpRequest.DONE&&(200===aa.status?ea():ja())};aa.send()})};ba.prototype.pja=function(w){this.bU=w||pa;this.nK=pa};ba.prototype.R5=function(){this.GX();return this.Tr.Cp(!0)};ba.prototype.GX=function(){Object(ma.b)(this,void 0,void 0,function(){return Object(ma.d)(this,function(w){switch(w.label){case 0:return this.sp=new b,this.Zl=new b,this.iB=!1,this.id=null,this.DR=
!1,[4,this.Y6()];case 1:return w.ea(),[2]}})})};ba.prototype.Pha=function(){this.bU();this.GX();this.jf&&(this.jf.Li()?this.gh(this.jf.request):this.jf.Vs()&&this.nK(this.jf.result.url,"pdf")&&(this.jf=null,this.FX()));this.sf&&this.sf.Li()&&this.gh(this.sf.request);this.xe&&this.xe.Li()?this.gh(this.xe.request):this.we&&this.we.Li()&&this.NT();var w;for(w=0;w<this.Vg.length;w++)this.Vg[w]&&(this.Vg[w].Li()?this.gh(this.Vg[w].request):this.Vg[w].Vs()&&this.nK(this.Vg[w].result.url,"image")&&(this.Vg[w]=
null,this.fE(Object(fa.uniqueId)(),w)));for(w=0;w<this.Wi.length;w++)this.Wi[w]&&this.Wi[w].Li()&&!this.Wi[w].Vca()&&this.gh(this.Wi[w].request);for(w=0;w<this.Jf.length;w++)this.Jf[w]&&this.Jf[w].Li()&&this.gh(this.Jf[w].request)};ba.prototype.Fca=function(){return this.iB?Promise.resolve():(this.iB=!0,this.timeStamp=Date.now(),this.Tr.PC())};ba.prototype.Gla=function(){var w=this,ea,ja,aa,ca,ia;return new Promise(function(ha,la){if(w.zm)ea=new FormData,ea.append("file",w.zm.fileHandle,w.zm.fileHandle.name),
ja=w.zm.loadCallback,ca="upload",aa=w.zm.extension;else if(w.hu)ea={uri:w.hu.uri,ypa:w.hu.shareId},ea=Object.keys(ea).map(function(ra){return ra+"="+(ea[ra]?encodeURIComponent(ea[ra]):"")}).join("&"),ia="application/x-www-form-urlencoded; charset=UTF-8",ja=w.hu.loadCallback,ca="url",aa=w.hu.extension;else{ha();return}var na=new XMLHttpRequest,qa=Object(z.j)(w.Ne,"AuxUpload");qa=Object(a.a)(qa,{type:ca,ext:aa});na.open("POST",qa);na.withCredentials=w.Gh();ia&&na.setRequestHeader("Content-Type",ia);
na.addEventListener("load",function(){if(na.readyState===na.DONE&&200===na.status){var ra=JSON.parse(na.response);w.PH=ra.uri;ja(ra);ha(ra)}});na.addEventListener("error",function(){la(na.statusText+" "+JSON.stringify(na))});w.zm&&null!=w.zm.onProgress&&(na.upload.onprogress=function(ra){w.zm.onProgress(ra)});na.send(ea)})};ba.prototype.Gha=function(w){this.password=w||null;this.Zl.Vs()||(this.Zl=new b,this.gh({t:"pages"}));return this.Zl.promise};ba.prototype.Qx=function(w){this.mI=w||null;this.Zl.Vs()||
this.gh({t:"pages"});return this.Zl.promise};ba.prototype.Dv=function(w){w=Object.assign(w,{uri:encodeURIComponent(this.PH)});this.mI&&(w.ext=this.mI);this.$g&&(w.c=this.$g);this.password&&(w.pswd=this.password);this.jH&&(w.cacheKey=this.jH);this.AK&&(w.officeOptions=this.AK);return w};ba.prototype.mia=function(){0<this.zt.length()&&10>=this.Er&&this.nia(this.zt.pop().data)};ba.prototype.s5=function(w){0<this.zt.length()&&this.zt.contains(w)&&this.zt.remove(w)};ba.prototype.gh=function(w){w=this.Dv(w);
this.Tr.send(w)};ba.prototype.YX=function(w,ea){10<this.Er?this.zt.push(w,ea):(this.Er++,w=this.Dv(ea),this.Tr.send(w))};ba.prototype.nia=function(w){this.Er++;w=this.Dv(w);this.Tr.send(w)};ba.prototype.hl=function(w){return w};ba.prototype.aU=function(w){this.xM&&w?Object(da.j)("Server failed health check. Single server mode ignoring check."):!this.Sna&&w&&3>=this.Vh?(this.vJ=!0,this.Tr.Cp()):3<this.Vh&&(this.xM=!0)};ba.prototype.Nea=function(w){var ea=this,ja=w.data,aa=w.err,ca=w.t;switch(ca){case "upload":aa?
this.Hla.reject(aa):this.Hla.resolve("Success");break;case "pages":aa?this.Zl.reject(aa):ka(ja,ca,this.Zl)&&this.Zl.resolve(ja);break;case "config":if(aa)this.sp.reject(aa);else if(ka(ja,ca,this.sp)){this.aU(ja.unhealthy);ja.id&&(this.id=ja.id);if(ja.auth){var ia=Object(e.a)("wvsQueryParameters");ia.auth=ja.auth;Object(e.b)("wvsQueryParameters",ia)}ja.serverVersion&&(this.eF=ja.serverVersion,Object(da.h)("[WebViewer Server] server version: "+this.eF));ja.serverID?(this.Vh=ja.serverID===this.cY&&this.vJ?
this.Vh+1:0,this.cY=ja.serverID):this.Vh=0;this.vJ=!1;this.sp.resolve(ja)}break;case "health":aa?this.sp.reject(aa):ka(ja,ca,this.sp)&&this.aU(ja.unhealthy);break;case "pdf":ja.url=Object(a.a)(this.Ne+"../"+encodeURI(ja.url));aa?this.jf.reject(aa):ka(ja,ca,this.jf)&&this.jf.resolve(ja);break;case "ApString2Xod":ja.url=Object(a.a)(this.Ne+"../data/"+encodeURI(ja.url));aa?this.Ri[ja.rID].reject(aa):ka(ja,ca,this.Ri[ja.rID])&&this.Ri[ja.rID].resolve(ja);break;case "docmod":ja.url=Object(a.a)(this.Ne+
"../"+encodeURI(ja.url));aa?this.Ri[ja.rID].reject(aa):ka(ja,ca,this.jf)&&this.Ri[ja.rID].resolve(ja);break;case "xod":if(aa)this.xe&&this.xe.Li()&&this.xe.reject(aa),this.we&&this.we.Li()&&this.we.reject(aa);else if(ja.notFound)ja.noCreate||this.xe&&this.xe.Li()&&this.xe.resolve(ja),this.we&&this.we.Li()&&this.we.resolve(ja);else{ja.url&&(ja.url=Object(a.a)(this.Ne+"../"+encodeURI(ja.url)));if(!this.we||this.we.Vs())this.we=new b,this.we.request={t:"xod",noCreate:!0};this.xe||(this.xe=new b,this.xe.request=
{t:"xod"});this.we.resolve(ja);this.xe.resolve(ja)}break;case "cAnnots":ia=this.sf;if(aa)ia.reject(aa);else if(ka(ja,ca,ia)){ia.ZL();var ha=[],la=ja.annots;ja=function(oa){var wa=la[oa].s,Da=la[oa].e,Ha=na.Ne+"../"+encodeURI(la[oa].xfdf),La="true"===la[oa].hasAppearance?Object(a.a)(Ha+".xodapp"):null,Ca=Object(fa.range)(wa,Da+1);ha[oa]={range:Ca,promise:new Promise(function(Ka,Ra){var Ma=new XMLHttpRequest;Ma.open("GET",Object(a.a)(Ha));Ma.responseType="text";Ma.withCredentials=ea.Gh();Ma.addEventListener("load",
function(){Ma.readyState===Ma.DONE&&200===Ma.status&&Ka({Yq:Ma.response,Xk:La,range:Ca})});Ma.addEventListener("error",function(){Ra(Ma.statusText+" "+JSON.stringify(Ma))});Ma.send()})}};var na=this;for(aa=0;aa<la.length;aa++)ja(aa);ia.resolve(ha)}break;case "annots":if(aa)this.sf.reject(aa);else if(ka(ja,ca,this.sf)){this.sf.ZL();var qa=new XMLHttpRequest;ia=this.Ne+"../"+encodeURI(ja.url);var ra=ja.hasAppearance?Object(a.a)(ia+".xodapp"):null;qa.open("GET",Object(a.a)(ia));qa.responseType="text";
qa.withCredentials=this.Gh();qa.addEventListener("load",function(){qa.readyState===qa.DONE&&200===qa.status&&ea.sf.resolve({Yq:qa.response,Xk:ra})});qa.addEventListener("error",function(){ea.sf.reject(qa.statusText+" "+JSON.stringify(qa))});qa.send()}break;case "image":this.Er--;var ta=this.Vg[ja.p];aa?ta.promise.reject(aa):ka(ja,ca,ta)&&(ta.result=ja,ta.result.url=Object(a.a)(this.Ne+"../"+encodeURI(ta.result.url)),ta.resolve(ta.result));break;case "tiles":this.Er--;ta=ja.rID;ia=this.Jf[ta];this.Jf[ta]=
null;this.UB.push(ta);if(aa)ia.reject(aa);else if(ka(ja,ca,ia)){for(aa=0;aa<ja.tiles.length;aa++)ja.tiles[aa]=Object(a.a)(this.Ne+"../"+encodeURI(ja.tiles[aa]));ia.resolve(ja)}break;case "text":ta=this.Wi[ja.p];if(aa)ta.reject(aa);else if(ka(ja,ca,ta)){ta.ZL();var va=new XMLHttpRequest;ja=Object(a.a)(this.Ne+"../"+encodeURI(ja.url));va.open("GET",ja);va.withCredentials=this.Gh();va.addEventListener("load",function(){va.readyState===va.DONE&&200===va.status&&(ta.result=JSON.parse(va.response),ta.resolve(ta.result))});
va.addEventListener("error",function(oa){ta.reject(va.statusText+" "+JSON.stringify(oa))});va.send()}break;case "progress":"loading"===ja.t&&this.trigger(y.a.Events.DOCUMENT_LOADING_PROGRESS,[ja.bytes,ja.total])}this.mia();!ca&&w.echo&&w&&"apstring2xod"===w.echo.t&&(w=w.echo.reqID)&&(2<=parseInt(this.eF,10)?this.Ri[w].reject("Message unhandled by server"):this.Ri[w].reject())};ba.prototype.X$=function(){return Object(ma.b)(this,void 0,void 0,function(){return Object(ma.d)(this,function(w){switch(w.label){case 0:return[4,
this.Fca()];case 1:return w.ea(),[2,this.sp.promise]}})})};ba.prototype.F$=function(w){for(var ea=this,ja=new XMLHttpRequest,aa=Object(a.a)(this.Ne+"aul",{id:this.id}),ca=new FormData,ia={},ha=0;ha<w.body.length;ha++){var la=w.body[ha];ia[la.id]=la.XG.w+";"+la.XG.h;ca.append(la.id,la.XG.dataString)}w={t:"apstring2xod",reqID:this.FV++,parts:ia};var na=this.Dv(w);ca.append("msg",JSON.stringify(na));this.Ri[na.reqID]=new b;ja.open("POST",aa);ja.withCredentials=this.Gh;aa=new Promise(function(qa,ra){ja.onreadystatechange=
function(){4===ja.readyState&&(200===ja.status?qa():ra("An error occurred while sending down appearance strings to the server"))}});ja.send(ca);return aa.then(function(){return ea.Ri[na.reqID].promise})};ba.prototype.T5=function(){var w=this.eF.split("-")[0].split("."),ea=["1","5","9"];if(3!==w.length)throw Error("Invalid WVS version length.");if(3!==ea.length)throw Error("Invalid version length.");for(var ja=0;ja<w.length;++ja){if(ea.length===ja||w[ja]>ea[ja])return-1;if(w[ja]!==ea[ja])return 1}return 0};
ba.prototype.op=function(){return 0>=this.T5()};ba.prototype.vI=function(){this.sf||(this.sf=new b,this.op()?this.sf.request={t:"cAnnots"}:this.sf.request={t:"annots"},this.gh(this.sf.request));return this.sf.promise};ba.prototype.fE=function(w,ea){this.Vg[ea]||(this.Vg[ea]=new b,this.Vg[ea].request={t:"image",p:ea},this.YX(w,this.Vg[ea].request));return this.Vg[ea].promise};ba.prototype.Hha=function(w){this.Wi[w]||(this.Wi[w]=new b,this.Wi[w].request={t:"text",p:w},this.gh(this.Wi[w].request));return this.Wi[w].promise};
ba.prototype.Iha=function(w,ea,ja,aa,ca){var ia=this.Jf.length;this.UB.length&&(ia=this.UB.pop());this.Jf[ia]=new b;this.Jf[ia].request={t:"tiles",p:ea,z:ja,r:aa,size:ca,rID:ia};this.YX(w,this.Jf[ia].request);return this.Jf[ia].promise};ba.prototype.FX=function(){this.jf||(this.jf=new b,this.jf.request={t:"pdf"},this.DR?this.jf.resolve({url:this.PH}):this.gh(this.jf.request));return this.jf.promise};ba.prototype.lT=function(w){var ea=this,ja=new XMLHttpRequest,aa=Object(a.a)(this.Ne+"aul",{id:this.id}),
ca=new FormData,ia={};w.annots&&(ia.annots="xfdf");w.watermark&&(ia.watermark="png");w.redactions&&(ia.redactions="redact");ia={t:"docmod",reqID:this.FV++,parts:ia};w.print&&(ia.print=!0);var ha=this.Dv(ia);ca.append("msg",JSON.stringify(ha));return Promise.all([w.annots,w.watermark,w.redactions].map(function(la){return Promise.resolve(la)})).then(function(la){var na=la[0],qa=la[1];la=la[2];na&&ca.append("annots",na);qa&&ca.append("watermark",qa);la&&ca.append("redactions",la);ea.Ri[ha.reqID]=new b;
ja.open("POST",aa);ja.withCredentials=ea.Gh;na=new Promise(function(ra,ta){ja.onreadystatechange=function(){4===ja.readyState&&(200===ja.status?ra():ta("An error occurred while sending down annotation data to the server"))}});ja.send(ca);return na.then(function(){return ea.Ri[ha.reqID].promise})})};ba.prototype.NT=function(){this.we||(this.we=new b,this.we.request={t:"xod",noCreate:!0},this.gh(this.we.request));return this.we.promise};ba.prototype.Jha=function(){this.xe||(this.xe=new b,this.xe.request=
{t:"xod"},this.gh(this.xe.request));return this.xe.promise};ba.prototype.ko=function(){return!0};ba.prototype.request=function(){};ba.prototype.ZW=function(){};ba.prototype.abort=function(){for(var w=0;w<this.Jf.length;w++)this.Jf[w]&&(this.Jf[w].resolve(null),this.Jf[w]=null,this.UB.push(w));this.close()};ba.prototype.rE=function(w){this.$g=this.$g||{};this.$g.headers=w};ba.prototype.qo=function(w){this.$g=this.$g||{};this.$g.internal=this.$g.internal||{};this.$g.internal.withCredentials=w};ba.prototype.Gh=
function(){return this.$g&&this.$g.internal?this.$g.internal.withCredentials:null};ba.prototype.getFileData=function(){return Promise.reject()};return ba}();Object(Ba.a)(r);Object(f.a)(r);Object(f.b)(r);ua["default"]=r},462:function(Ba,ua,r){var pa=r(1),ka=r(2),ma=r(34),fa=r(40),da=r(163),z=r(112),x=function(){function f(e,a,b,h,n,ba){void 0===b&&(b=null);void 0===h&&(h=null);void 0===n&&(n=null);void 0===ba&&(ba=null);this.mV=!1;this.Vh=0;this.LQ=this.Zla(e);this.url=a?this.LQ+"/"+a:this.LQ+"/ws";
this.IH=b;this.ux=h;this.Bv=n;this.DL=ba}f.prototype.Zla=function(e){var a=e.indexOf("://"),b="ws://";0>a?a=0:(5===a&&(b="wss://"),a+=3);var h=e.lastIndexOf("/");0>h&&(h=e.length);return b+e.slice(a,h)};f.prototype.send=function(e){this.Do.readyState===WebSocket.CLOSED||this.mV||this.Do.send(JSON.stringify(e))};f.prototype.PC=function(){return Object(pa.b)(this,void 0,void 0,function(){var e,a=this;return Object(pa.d)(this,function(){e=Object(fa.a)("wvsQueryParameters");e.bcid=Object(ma.k)(8);Object(fa.b)("wvsQueryParameters",
e);return[2,new Promise(function(b,h){var n=Object(da.a)(a.url);a.Do=new WebSocket(n);a.Do.onopen=function(){a.ux&&a.ux();b()};a.Do.onerror=function(ba){a.mV=!0;h(ba)};a.Do.onclose=function(ba){var w=ba.code;return Object(pa.b)(a,void 0,void 0,function(){var ea=this;return Object(pa.d)(this,function(ja){switch(ja.label){case 0:return this.Bv&&this.Bv(),3E3===w?[3,3]:8>this.Vh++?[4,new Promise(function(aa){return setTimeout(function(){return Object(pa.b)(ea,void 0,void 0,function(){return Object(pa.d)(this,
function(ca){switch(ca.label){case 0:return this.DL(),[4,this.PC()];case 1:return ca.ea(),aa(),[2]}})})},3E3)})]:[3,2];case 1:return ja.ea(),[3,3];case 2:h(z.a),ja.label=3;case 3:return[2]}})})};a.Do.onmessage=function(ba){ba&&ba.data&&(ba=JSON.parse(ba.data),ba.hb?a.send({hb:!0}):ba.end?close():a.IH(ba))}})]})})};f.prototype.Cp=function(e){void 0===e&&(e=!1);this.Vh=0;e?this.Do.close(3E3):this.Do.close();return Promise.resolve()};return f}(),y=function(){function f(e,a,b,h,n,ba,w){void 0===h&&(h=
null);void 0===n&&(n=null);void 0===ba&&(ba=null);void 0===w&&(w=null);this.Vh=this.eE=this.id=0;this.Hw=!1;this.request=null;e=this.gga(e);this.url=a?e+"/"+a+"pf":e+"/pf";this.YE=b;this.IH=h;this.ux=n;this.Bv=ba;this.DL=w}f.prototype.gga=function(e){var a=e.lastIndexOf("/");0>a&&(a=e.length);return e.slice(0,a)};f.prototype.I6=function(e){e=e.split("\n");for(e[e.length-1]&&e.pop();0<e.length&&3>e[e.length-1].length;)"]"===e.pop()&&(this.id=0);0<e.length&&3>e[0].length&&e.shift();for(var a=0;a<e.length;++a)e[a].endsWith(",")&&
(e[a]=e[a].substr(0,e[a].length-1));return e};f.prototype.PX=function(){return Object(pa.b)(this,void 0,void 0,function(){var e=this;return Object(pa.d)(this,function(a){switch(a.label){case 0:return 8>this.Vh++?[4,new Promise(function(b){return setTimeout(function(){e.DL();e.PC();b()},3E3)})]:[3,2];case 1:a.ea(),a.label=2;case 2:return[2]}})})};f.prototype.iga=function(e){Object(pa.b)(this,void 0,void 0,function(){var a,b;return Object(pa.d)(this,function(h){switch(h.label){case 0:a=null,b=0,h.label=
1;case 1:if(!(b<e.length))return[3,6];a=JSON.parse(e[b]);if(!a)return[3,5];if(!a.end)return[3,2];close();return[3,5];case 2:if(!a.id||Number(a.id)===this.id)return[3,4];Object(ka.j)("Reconnecting, new server detected");this.Cp();return[4,this.PX()];case 3:return h.ea(),[3,5];case 4:a.hb&&Number(a.id)===this.id?this.send({hb:!0}):this.Hw||this.IH(a),h.label=5;case 5:return++b,[3,1];case 6:return[2]}})})};f.prototype.Kea=function(e){Object(pa.b)(this,void 0,void 0,function(){var a,b,h;return Object(pa.d)(this,
function(n){switch(n.label){case 0:if(!(3<=e.readyState))return[3,2];try{a=e.responseText.length}catch(ba){return Object(ka.h)("caught exception"),[2]}if(0<a)try{b=this.I6(e.responseText),0===this.id&&0<b.length&&(h=JSON.parse(b.shift()),this.id=h.id,this.Vh=0),this.iga(b)}catch(ba){}return this.Hw?[3,2]:[4,this.rS()];case 1:n.ea(),n.label=2;case 2:return[2]}})})};f.prototype.rS=function(){return Object(pa.b)(this,void 0,void 0,function(){var e=this;return Object(pa.d)(this,function(){return[2,new Promise(function(a,
b){function h(){return Object(pa.b)(e,void 0,void 0,function(){return Object(pa.d)(this,function(ba){switch(ba.label){case 0:b(),this.Cp(),ba.label=1;case 1:return this.Hw&&8>this.Vh?[4,this.PX()]:[3,3];case 2:return ba.ea(),[3,1];case 3:return[2]}})})}e.request=new XMLHttpRequest;e.request.withCredentials=e.YE;var n=Object(da.a)(e.url,0!==e.id?{id:String(e.id),uc:String(e.eE)}:{uc:String(e.eE)});e.eE++;e.request.open("GET",n,!0);e.request.setRequestHeader("Cache-Control","no-cache");e.request.setRequestHeader("X-Requested-With",
"XMLHttpRequest");e.request.onreadystatechange=function(){e.Kea(e.request)};e.request.addEventListener("error",h);e.request.addEventListener("timeout",h);e.request.addEventListener("load",function(){e.ux&&e.ux();a()});e.request.send()})]})})};f.prototype.PC=function(){var e=Object(fa.a)("wvsQueryParameters");e.bcid=Object(ma.k)(8);Object(fa.b)("wvsQueryParameters",e);this.eE=this.id=0;this.Hw=!1;return this.rS()};f.prototype.send=function(e){var a=this,b=new XMLHttpRequest;b.withCredentials=this.YE;
var h=Object(da.a)(this.url,{id:String(this.id)}),n=new FormData;n.append("data",JSON.stringify(e));b.addEventListener("error",function(){a.Cp()});b.open("POST",h);b.setRequestHeader("X-Requested-With","XMLHttpRequest");b.send(n)};f.prototype.Cp=function(){this.id=0;this.Hw=!0;this.Bv&&this.Bv();this.request.abort();return Promise.resolve()};return f}();Ba=function(){function f(e,a,b){this.jR=e;this.target=a;this.YE=b}f.prototype.q$=function(e,a,b,h,n){void 0===e&&(e=!0);void 0===a&&(a=null);void 0===
b&&(b=null);void 0===h&&(h=null);void 0===n&&(n=null);return e?new x(this.jR,this.target,a,b,h,n):new y(this.jR,this.target,this.YE,a,b,h,n)};return f}();ua.a=Ba}}]);}).call(this || window)
