function mockNetwork(a){if(!global.__minium__["".concat(a,"_network_mocked")]){var b=function(a){if(a=a.split("#")[0],!a)return{};for(var b={},c=a.split("&"),d=0;d<c.length;d++){var e=c[d].split("="),f=global.babelHelpers.slicedToArray(e,2),g=f[0],h=f[1];b[g]=decodeURIComponent(h)}return b};Object.defineProperty(global.__minium__,"".concat(a,"_network_mocked"),{value:!0,writable:!1});var c=function(){"use strict";function a(b,c,d){var e=this;global.babelHelpers.classCallCheck(this,a),this.success=b,this.fail=c,this.callback=d,this.chunkCallback=[],this.headersReceivedCallback=[],this.progressUpdateCallback=[],this.fd=setTimeout(function(){e.headersReceivedCallback.forEach(function(a){e.success&&a({header:e.success.header})}),e.chunkCallback.forEach(function(a){e.success&&a(e.success.data)}),e.progressUpdateCallback.forEach(function(a){e.success&&a({progress:100,totalBytesWritten:100,totalBytesExpectedToWrite:100})}),d(e.success||e.fail)})}return global.babelHelpers.createClass(a,[{key:"abort",value:function(){clearTimeout(this.fd)}},{key:"offChunkReceived",value:function(a){var b=this.chunkCallback.indexOf(a);-1!==b&&this.chunkCallback.splice(b,1)}},{key:"offHeadersReceived",value:function(a){var b=this.headersReceivedCallback.indexOf(a);-1!==b&&this.headersReceivedCallback.splice(b,1)}},{key:"onChunkReceived",value:function(a){this.chunkCallback.push(a)}},{key:"onHeadersReceived",value:function(a){this.headersReceivedCallback.push(a)}},{key:"onProgressUpdate",value:function(a){this.progressUpdateCallback.push(a)}}])}();global.__minium__["".concat(a,"Task")]=c;var d=new global.__minium__.MockRule("".concat(a,"_network_mock_rule"));global.__minium__.setMock(a,function(a){var e=(a.method||"GET").toUpperCase(),f=a.url,g=f.split("?"),h=global.babelHelpers.slicedToArray(g,2),i=h[0],j=h[1],k=b(j||"");"GET"===e&&Object.assign(k,a.data);var l=Object.assign({},a,{url:i,params:k});"GET"===e&&Object.assign(l,{data:k});var m=d.search(a);if(!m)if(l.params){var n=Object.assign({},l);n.url="".concat(l.url,"?").concat(Object.keys(l.params).map(function(a){return"".concat(a,"=").concat(l.params[a])}).join("&")),delete n.params,m=d.search(l,n)}else m=d.search(l);return m?(console.log("@@@@rule match",m),a.__miniumMocked=!0,m.success)?new c(m.success,void 0,function(b){a.success&&a.success(b),a.complete&&a.complete(b)}):m.fail?new c(void 0,m.fail,function(b){a.fail&&a.fail(b),a.complete&&a.complete(b)}):void 0:this.origin(a)})}}