/** 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([[14],{442:function(Ba,ua,r){r.r(ua);var pa=r(1),ka=r(0);r.n(ka);var ma=r(2),fa=r(147);Ba=r(51);var da=r(94),z=r(246),x=r(71),y=r(245);r=r(375);var f=window,e=function(){function h(n,ba,w){var ea=-1===n.indexOf("?")?"?":"&";switch(ba){case x.a.NEVER_CACHE:this.url=n+ea+"_="+Object(ka.uniqueId)();break;default:this.url=n}this.af=w;this.request=new XMLHttpRequest;this.request.open("GET",this.url,!0);this.request.setRequestHeader("X-Requested-With",
"XMLHttpRequest");this.request.overrideMimeType?this.request.overrideMimeType("text/plain; charset=x-user-defined"):this.request.setRequestHeader("Accept-Charset","x-user-defined");this.status=y.a.NOT_STARTED}h.prototype.start=function(n,ba){var w=this,ea=this,ja=this.request,aa;ea.Yw=0;n&&Object.keys(n).forEach(function(ca){w.request.setRequestHeader(ca,n[ca])});ba&&(this.request.withCredentials=ba);this.TD=setInterval(function(){var ca=0===window.document.URL.indexOf("file:///");ca=200===ja.status||
ca&&0===ja.status;if(ja.readyState!==y.b.DONE||ca){try{ja.responseText}catch(ia){return}ea.Yw<ja.responseText.length&&(aa=ea.oga())&&ea.trigger(h.Events.DATA,[aa]);0===ja.readyState&&(clearInterval(ea.TD),ea.trigger(h.Events.DONE))}else clearInterval(ea.TD),ea.trigger(h.Events.DONE,["Error received return status "+ja.status])},1E3);this.request.send(null);this.status=y.a.STARTED};h.prototype.oga=function(){var n=this.request,ba=n.responseText;if(0!==ba.length)if(this.Yw===ba.length)clearInterval(this.TD),
this.trigger(h.Events.DONE);else return ba=Math.min(this.Yw+3E6,ba.length),n=f.vT(n,this.Yw,!0,ba),this.Yw=ba,n};h.prototype.abort=function(){clearInterval(this.TD);var n=this;this.request.onreadystatechange=function(){Object(ma.j)("StreamingRequest aborted");n.status=y.a.ABORTED;return n.trigger(h.Events.ABORTED)};this.request.abort()};h.prototype.finish=function(){var n=this;this.request.onreadystatechange=function(){n.status=y.a.SUCCESS;return n.trigger(h.Events.DONE)};this.request.abort()};h.Events=
{DONE:"done",DATA:"data",ABORTED:"aborted"};return h}();Object(Ba.a)(e);var a;(function(h){h[h.LOCAL_HEADER=0]="LOCAL_HEADER";h[h.FILE=1]="FILE";h[h.CENTRAL_DIR=2]="CENTRAL_DIR"})(a||(a={}));var b=function(h){function n(){var ba=h.call(this)||this;ba.buffer="";ba.state=a.LOCAL_HEADER;ba.wM=4;ba.Rl=null;ba.ht=fa.c;ba.An={};return ba}Object(pa.c)(n,h);n.prototype.hga=function(ba){var w;for(ba=this.buffer+ba;ba.length>=this.ht;)switch(this.state){case a.LOCAL_HEADER:this.Rl=w=this.sga(ba.slice(0,this.ht));
if(w.Qt!==fa.g)throw Error("Wrong signature in local header: "+w.Qt);ba=ba.slice(this.ht);this.state=a.FILE;this.ht=w.hH+w.qq+w.Xv+this.wM;this.trigger(n.Events.HEADER,[w]);break;case a.FILE:this.Rl.name=ba.slice(0,this.Rl.qq);this.An[this.Rl.name]=this.Rl;w=this.ht-this.wM;var ea=ba.slice(this.Rl.qq+this.Rl.Xv,w);this.trigger(n.Events.FILE,[this.Rl.name,ea,this.Rl.yH]);ba=ba.slice(w);if(ba.slice(0,this.wM)===fa.h)this.state=a.LOCAL_HEADER,this.ht=fa.c;else return this.state=a.CENTRAL_DIR,!0}this.buffer=
ba;return!1};n.Events={HEADER:"header",FILE:"file"};return n}(z.a);Object(Ba.a)(b);Ba=function(h){function n(ba,w,ea,ja,aa){ea=h.call(this,ba,ea,ja)||this;ea.url=ba;ea.stream=new e(ba,w);ea.Xd=new b;ea.xW=window.createPromiseCapability();ea.$W={};ea.af=aa;return ea}Object(pa.c)(n,h);n.prototype.Qx=function(ba){var w=this;this.request([this.oj,this.Fk,this.nj]);this.stream.addEventListener(e.Events.DATA,function(ea){try{if(w.Xd.hga(ea))return w.stream.finish()}catch(ja){throw w.stream.abort(),w.Tv(ja),
ba(ja),ja;}});this.stream.addEventListener(e.Events.DONE,function(ea){w.Nfa=!0;w.xW.resolve();ea&&(w.Tv(ea),ba(ea))});this.Xd.addEventListener(b.Events.HEADER,Object(ka.bind)(this.ZW,this));this.Xd.addEventListener(b.Events.FILE,Object(ka.bind)(this.Iga,this));return this.stream.start(this.af,this.withCredentials)};n.prototype.sT=function(ba){var w=this;this.xW.promise.then(function(){ba(Object.keys(w.Xd.An))})};n.prototype.ko=function(){return!0};n.prototype.request=function(ba){var w=this;this.Nfa&&
ba.forEach(function(ea){w.$W[ea]||w.jla(ea)})};n.prototype.ZW=function(){};n.prototype.abort=function(){this.stream&&this.stream.abort()};n.prototype.jla=function(ba){this.trigger(da.a.Events.PART_READY,[{Ya:ba,error:"Requested part not found",zi:!1,Uf:!1}])};n.prototype.Iga=function(ba,w,ea){this.$W[ba]=!0;this.trigger(da.a.Events.PART_READY,[{Ya:ba,data:w,zi:!1,Uf:!1,error:null,Yc:ea}])};return n}(da.a);Object(r.a)(Ba);Object(r.b)(Ba);ua["default"]=Ba}}]);}).call(this || window)
