(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{12:function(e,t,r){"use strict";r.d(t,"a",function(){return b});var n=r(8),a=r(2),o=r.n(a),u=r(3),c=r(15),s=r.n(c);function i(e,t){return f.apply(this,arguments)}function f(){return(f=Object(u.a)(o.a.mark(function e(t,r){var n,a,u,c;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.get(r.toLowerCase());case 2:(n=e.sent)?(a=new Blob([n],{type:"binary/octet-stream"}),u=URL.createObjectURL(a),(c=document.createElement("a")).setAttribute("href",u),c.setAttribute("download",r),document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(u)):console.error("File ".concat(r," does not exist"));case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function l(e){return p.apply(this,arguments)}function p(){return(p=Object(u.a)(o.a.mark(function e(t){var r,n,a,u,c,s;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,n=!1,a=void 0,e.prev=3,e.next=6,t.keys();case 6:e.t0=Symbol.iterator,u=e.sent[e.t0]();case 8:if(r=(c=u.next()).done){e.next=14;break}(s=c.value).match(/\.sv$/i)&&i(t,s);case 11:r=!0,e.next=8;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(3),n=!0,a=e.t1;case 20:e.prev=20,e.prev=21,r||null==u.return||u.return();case 23:if(e.prev=23,!n){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}},e,null,[[3,16,20,28],[21,,23,27]])}))).apply(this,arguments)}var d=function(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){return t(n.result)},n.onerror=function(){return r(n.error)},n.onabort=function(){return r()},n.readAsArrayBuffer(e)})};function w(e,t,r){return v.apply(this,arguments)}function v(){return(v=Object(u.a)(o.a.mark(function e(t,r,n){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,d(n);case 3:return e.t1=e.sent,a=new e.t0(e.t1),r.set(n.name.toLowerCase(),a),e.abrupt("return",t.set(n.name.toLowerCase(),a));case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function b(e){return h.apply(this,arguments)}function h(){return(h=Object(u.a)(o.a.mark(function e(t){var r,a,c,f,p,d,v,b;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=new s.a("diablo_fs"),a=new Map,c=0,e.t0=Object,e.next=7,r.json();case 7:e.t1=e.sent,f=e.t0.entries.call(e.t0,e.t1);case 9:if(!(c<f.length)){e.next=18;break}p=f[c],d=Object(n.a)(p,2),v=d[0],b=d[1],a.set(v,b);case 15:c++,e.next=9;break;case 18:return window.DownloadFile=function(e){return i(r,e)},window.DownloadSaves=function(){return l(r)},e.abrupt("return",{files:a,update:function(e,t){return r.set(e,t)},delete:function(e){return r.remove(e)},clear:function(){return r.clear()},download:function(e){return i(r,e)},upload:function(e){return w(r,a,e)},fileUrl:function(){var e=Object(u.a)(o.a.mark(function e(t){var n,a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.get(t.toLowerCase());case 2:if(!(n=e.sent)){e.next=6;break}return a=new Blob([n],{type:"binary/octet-stream"}),e.abrupt("return",URL.createObjectURL(a));case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()});case 23:return e.prev=23,e.t2=e.catch(0),window.DownloadFile=function(){return console.error("IndexedDB is not supported")},window.DownloadSaves=function(){return console.error("IndexedDB is not supported")},e.abrupt("return",{files:new Map,update:function(){return Promise.resolve()},delete:function(){return Promise.resolve()},clear:function(){return Promise.resolve()},download:function(){return Promise.resolve()},upload:function(){return Promise.resolve()},fileUrl:function(){return Promise.resolve()}});case 28:case"end":return e.stop()}},e,null,[[0,23]])}))).apply(this,arguments)}},71:function(e,t,r){"use strict";r.r(t);var n=r(12),a=Object(n.a)();window.addEventListener("message",function(e){var t=e.data,r=e.source;"transfer"===t.method?a.then(function(e){var t=e.files;r.postMessage({method:"storage",files:t},"*")}):"clear"===t.method&&a.then(function(e){return(0,e.clear)()})})}},[[71,3,0]]]);
//# sourceMappingURL=storage.ec121293.chunk.js.map