/** 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([[0],{456:function(Ba,wa,r){r.r(wa);r.d(wa,"ByteRangeRequest",function(){return z});var oa=r(0),na=r(1);r.n(na);var ma=r(2),fa=r(157);Ba=r(100);var ea=r(262),aa=r(78),w=r(74),x=r(261),h=r(177);r=r(394);var e=[],a=[],b=window,f=function(){return function(){this.Qm=1}}(),n;(function(da){da[da.UNSENT=0]="UNSENT";da[da.DONE=4]="DONE"})(n||(n={}));var z=function(){function da(ia,ca,ba,ja){var la=this;this.url=ia;this.range=ca;this.pf=ba;
this.withCredentials=ja;this.S4=n;this.request=new XMLHttpRequest;this.request.open("GET",this.url,!0);b.Uint8Array&&(this.request.responseType="arraybuffer");ja&&(this.request.withCredentials=ja);y.DISABLE_RANGE_HEADER||(Object(na.isUndefined)(ca.stop)?this.request.setRequestHeader("Range","bytes="+ca.start):this.request.setRequestHeader("Range",["bytes=",ca.start,"-",ca.stop-1].join("")));ba&&Object.keys(ba).forEach(function(ha){la.request.setRequestHeader(ha,ba[ha])});this.request.overrideMimeType?
this.request.overrideMimeType("text/plain; charset=x-user-defined"):this.request.setRequestHeader("Accept-Charset","x-user-defined");this.status=x.a.NOT_STARTED}da.prototype.start=function(ia){var ca=this,ba=this.request;ba.onreadystatechange=function(){if(ca.aborted)return ca.status=x.a.ABORTED,ia({code:x.a.ABORTED});if(this.readyState===ca.S4.DONE){ca.sD();var ja=0===window.document.URL.indexOf("file:///");200===ba.status||206===ba.status||ja&&0===ba.status?(ja=b.ZV(this),ca.wO(ja,ia)):(ca.status=
x.a.ERROR,ia({code:ca.status,status:ca.status}))}};this.request.send(null);this.status=x.a.STARTED};da.prototype.wO=function(ia,ca){this.status=x.a.SUCCESS;if(ca)return ca(!1,ia)};da.prototype.abort=function(){this.sD();this.aborted=!0;this.request.abort()};da.prototype.sD=function(){var ia=Object(h.c)(this.url,this.range,a);-1!==ia&&a.splice(ia,1);if(0<e.length){ia=e.shift();var ca=new da(ia.url,ia.range,this.pf,this.withCredentials);ia.request=ca;a.push(ia);ca.start(Object(h.d)(ia))}};da.prototype.extend=
function(ia){var ca=Object.assign({},this,ia.prototype);ca.constructor=ia;return ca};return da}(),y=function(da){function ia(ca,ba,ja,la,ha){ja=da.call(this,ca,ja,la)||this;ja.uj={};ja.TB=ba;ja.url=ca;ja.DISABLE_RANGE_HEADER=!1;ja.Ky=z;ja.qP=3;ja.pf=ha||{};return ja}Object(oa.c)(ia,da);ia.prototype.uw=function(ca,ba,ja){var la=-1===ca.indexOf("?")?"?":"&";switch(ja){case !1:case w.a.NEVER_CACHE:ca=ca+la+"_="+Object(na.uniqueId)();break;case !0:case w.a.CACHE:ca=ca+la+"_="+ba.start+","+(Object(na.isUndefined)(ba.stop)?
"":ba.stop)}return ca};ia.prototype.NT=function(ca,ba,ja,la){void 0===ja&&(ja={});return new this.Ky(ca,ba,ja,la)};ia.prototype.mca=function(ca,ba,ja,la,ha){for(var ka=0;ka<e.length;ka++)if(Object(na.isEqual)(e[ka].range,ba)&&Object(na.isEqual)(e[ka].url,ca))return e[ka].eh.push(la),e[ka].AE++,null;for(ka=0;ka<a.length;ka++)if(Object(na.isEqual)(a[ka].range,ba)&&Object(na.isEqual)(a[ka].url,ca))return a[ka].eh.push(la),a[ka].AE++,null;ja={url:ca,range:ba,TB:ja,eh:[la],AE:1};if(0===e.length&&a.length<
this.qP)return a.push(ja),ja.request=this.NT(ca,ba,ha,this.withCredentials),ja;e.push(ja);return null};ia.prototype.Eo=function(ca,ba,ja){var la=this.uw(ca,ba,this.TB);(ca=this.mca(la,ba,this.TB,ja,this.pf))&&ca.request.start(Object(h.d)(ca));return function(){var ha=Object(h.c)(la,ba,a);if(-1!==ha){var ka=--a[ha].AE;0===ka&&a[ha].request&&a[ha].request.abort()}else ha=Object(h.c)(la,ba,e),-1!==ha&&(ka=--e[ha].AE,0===ka&&e.splice(ha,1))}};ia.prototype.CV=function(){return{start:-fa.a}};ia.prototype.aga=
function(){var ca=-(fa.a+fa.e);return{start:ca-fa.d,end:ca}};ia.prototype.Xt=function(ca){var ba=this;this.ZB=!0;var ja=fa.a;this.Eo(this.url,this.CV(),function(la,ha,ka){function pa(){var qa=ba.Cd.yV();ba.Eo(ba.url,qa,function(ra,ua){if(ra)return Object(ma.j)("Error loading central directory: "+ra),ca(ra);ua=Object(aa.a)(ua);if(ua.length!==qa.stop-qa.start)return ca("Invalid XOD file: Zip central directory data is wrong size! Should be "+(qa.stop-qa.start)+" but is "+ua.length);ba.Cd.yZ(ua);ba.NI=
!0;ba.ZB=!1;return ca(!1)})}if(la)return Object(ma.j)("Error loading end header: "+la),ca(la,ha,ka);ha=Object(aa.a)(ha);if(ha.length!==ja)return ca("Invalid XOD file: Zip end header data is wrong size!");try{ba.Cd=new ea.a(ha)}catch(qa){return ca(qa)}ba.Cd.Jha?ba.Eo(ba.url,ba.aga(),function(qa,ra){if(qa)return Object(ma.j)("Error loading zip64 header: "+qa),ca(qa);ra=Object(aa.a)(ra);ba.Cd.bia(ra);pa()}):pa()})};ia.prototype.WV=function(ca){ca(Object.keys(this.Cd.ao))};ia.prototype.UM=function(ca,
ba){var ja=this;if(this.Cd.zT(ca)){var la=this.Cd.gx(ca);if(la in this.uj){var ha=this.xh[ca];ha.Ds=this.uj[la];ha.Ds.Qm++;ha.cancel=ha.Ds.cancel}else{var ka=this.Cd.kea(ca),pa=this.Eo(this.url,ka,function(ra,ua){ra?(Object(ma.j)('Error loading part "'+ca+'": '+ra),ja.Eo(ja.url,ka,function(va,Aa){if(va)return ba(va,ca);ja.CZ(Aa,ka,la,ca,ba)})):ja.CZ(ua,ka,la,ca,ba)}),qa=this.xh[ca];qa&&(qa.N0=!0,qa.cancel=function(){qa.Ds.Qm--;0===qa.Ds.Qm&&(pa(),delete ja.uj[la])},this.uj[la]=new f(la),qa.Ds=this.uj[la],
qa.Ds.cancel=qa.cancel)}}else delete this.xh[ca],ba(Error('File not found: "'+ca+'"'),ca)};ia.prototype.CZ=function(ca,ba,ja,la,ha){if(ca.length!==ba.stop-ba.start)ha(Error("Part data is wrong size!"),la);else{do{if(!this.uj[ja])return;la=this.uj[ja].Qm;for(var ka=ba.fr.length,pa=0;pa<ka;++pa){var qa=ba.fr[pa];ha(!1,qa.ar,ca["string"===typeof ca?"substring":"subarray"](qa.start,qa.stop),this.Cd.bX(qa.ar));qa.ar in this.xh&&delete this.xh[qa.ar]}}while(la!==this.uj[ja].Qm);delete this.uj[ja]}};ia.DISABLE_RANGE_HEADER=
!1;ia.qP=3;return ia}(Ba.a);(function(da){function ia(ca,ba,ja){var la=da.call(this)||this,ha;for(ha in ca)la[ha]=ca[ha];la.Pta=ca;la.startOffset=ba;la.endOffset=ja;la.NT=function(ka,pa,qa,ra){Object(na.isUndefined)(pa.stop)?(pa.start+=la.endOffset,pa.stop=la.endOffset):(pa.start+=la.startOffset,pa.stop+=la.startOffset);ka=la.uw(la.url,pa,la.TB);return new ca.Ky(ka,pa,qa,ra)};return la}Object(oa.c)(ia,da);return ia})(y);Object(r.a)(y);Object(r.b)(y);wa["default"]=y}}]);}).call(this || window)
