(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-00216b9e"],{"4d28":function(e,t,n){},"7a6b":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{attrs:{id:"loading"}},[o("img",{attrs:{src:n("bcdd")}}),o("div",{staticClass:"desc"},[e._v(e._s(e.kstatus))])])},a=[],r=(n("63ff"),n("57f0")),c=n("5e1d"),i=n("db4b"),l=n("07a4"),s=n("2bcf"),u=n("7a5b"),f=n("ace7"),d=n("6301"),v=n("fb78"),k=n.n(v),m=n("ab66"),b=n("3a0b"),g=n("5f86"),p=n("b2e6"),h=function(e){function t(){var e;return Object(c["a"])(this,t),e=Object(l["a"])(this,Object(s["a"])(t).apply(this,arguments)),e.kstatus="kstore 正在加载...",e}return Object(u["a"])(t,e),Object(i["a"])(t,[{key:"mounted",value:function(){var e=new P(this);e.Go()}}]),t}(p["c"]);h=Object(f["a"])([Object(p["a"])({})],h);var y=h,P=function(){function e(t){Object(c["a"])(this,e),this.vm=t,this.needFakePolling=!1,this.kstoreLife={AllReady:!1,ReadyParts:[],NumParts:0},d["a"].reflect.BindThisMethods(this)}return Object(i["a"])(e,[{key:"Go",value:function(){var e=this;k.a.waterfall([e.polling,e.commitToStore,e.getAboutPeerInfo,e.getConfigs,e.jumpAfterKStoreReady],(function(e,t){"cancel"!==e&&console.log("PollKStoreReadyFlow done. error:",e)}))}},{key:"polling",value:function(e){var t=this,n=new d["a"].util.Once,o={AllReady:!1,ReadyParts:[],NumParts:0},a=setInterval(Object(r["a"])(regeneratorRuntime.mark((function r(){var c,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!o.AllReady){r.next=5;break}return clearInterval(a),n.Do((function(){console.log("wait kstore.AllReady done, ks:",o),e(null)})),r.abrupt("return");case 5:return r.next=7,fetch("/api/life");case 7:return c=r.sent,r.next=10,c.json();case 10:i=r.sent,o=i,console.log("polling:",o),t.vm.kstatus="kstore 正在玩命加载，请稍候... ".concat(o.ReadyParts.length,"/").concat(o.NumParts),o.AllReady&&(t.vm.kstatus="kstore 准备就绪，即将跳转 ".concat(o.ReadyParts.length,"/").concat(o.NumParts),console.log("stop polling"));case 15:case"end":return r.stop()}}),r)}))),200);setTimeout((function(){n.Do((function(){console.log("wait kstore.AllReady timeout, force to redirect, ks:",o),clearInterval(a),e(null)}))}),2e3)}},{key:"fakePolling",value:function(e){if(this.needFakePolling)var t=this,n=1e3/this.kstoreLife.NumParts,o=0,a=setInterval((function(){o++,t.vm.kstatus="kstore 正在玩命加载，请稍候... ".concat(o,"/").concat(t.kstoreLife.NumParts),o===t.kstoreLife.NumParts&&(clearInterval(a),e(null))}),n);else e(null)}},{key:"commitToStore",value:function(e){b["a"].commit("SetKStoreReady"),e(null)}},{key:"getAboutPeerInfo",value:function(e){d["a"].rpc.Client.AboutPeer((function(t){console.log("getAboutPeerInfo: ",t);var n=new m["a"];n.peerId=t.peerId,n.version=t.version,n.isOfficialPeer=t.isOfficialPeer,n.detectNewVersion=t.detectNewVersion,n.newVersion=t.newVersion,b["a"].commit("SetAboutPeerInfo",n),e(null)}),(function(t,n){e("".concat(t," failed: ").concat(n))}))}},{key:"getConfigs",value:function(e){d["a"].rpc.Client.GetConfigExt((function(t){var n=t[1];n?e(n):(b["a"].commit("SetConfigs",t[0]),e(null))}),(function(t,n){e("".concat(t," failed: ").concat(n))}))}},{key:"jumpAfterKStoreReady",value:function(e){var t="/desk";g["c"].has(g["a"])&&(t=g["c"].get(g["a"])),console.log("kstore ready, jump to:",t),this.vm.$router.push(t),e(null)}}]),e}(),w=y,R=(n("fced"),n("5511"));n.d(t,"PollKStoreReadyFlow",(function(){return P}));var j=Object(R["a"])(w,o,a,!1,null,null,null);t["default"]=j.exports},bcdd:function(e,t,n){e.exports=n.p+"img/loading2.547d53b9.gif"},fced:function(e,t,n){"use strict";var o=n("4d28"),a=n.n(o);a.a}}]);