1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6840],{16840:function(e){e.exports=function(e){var t={};function __nested_webpack_require_555__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__nested_webpack_require_555__),n.l=!0,n.exports}return __nested_webpack_require_555__.m=e,__nested_webpack_require_555__.c=t,__nested_webpack_require_555__.d=function(e,t,r){__nested_webpack_require_555__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__nested_webpack_require_555__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__nested_webpack_require_555__.t=function(e,t){if(1&t&&(e=__nested_webpack_require_555__(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__nested_webpack_require_555__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__nested_webpack_require_555__.d(r,n,(function(t){return e[t]}).bind(null,n));return r},__nested_webpack_require_555__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __nested_webpack_require_555__.d(t,"a",t),t},__nested_webpack_require_555__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__nested_webpack_require_555__.p="",__nested_webpack_require_555__(__nested_webpack_require_555__.s="./src/index.js")}({
1"./src/exception.js":function(e,t,r){"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}(n.key),n)}}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,e)})(e)}function _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(o,r.prototype),o}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.r(t),r.d(t,"DownloadException",function(){return n}),r.d(t,"downloadException",function(){return o});var n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}(DownloadException,e);var t,r,n,o=(t=_isNativeReflectConstruct(),function(){var e,r=_getPrototypeOf(DownloadException);if(t){var n=_getPrototypeOf(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return function(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function DownloadException(e,t){var r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,DownloadException),(r=o.call(this,"Downloader error: ".concat(e))).request=t,r.name="DownloadException",r}return r&&_defineProperties(DownloadException.prototype,r),n&&_defineProperties(DownloadException,n),Object.defineProperty(DownloadException,"prototype",{writable:!1}),DownloadException}(_wrapNativeSuper(Error)),o=n},
vendor: 5,287 bytes, lines 1-8
1"./src/index.js":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./exception */"./src/exception.js"),o=r(/*! ./signatures */"./src/signatures.js");/*! 2 * JS File Downloader v 1.1.25 3 * https://github.com/AleeeKoi/js-file-downloader 4 * 5 * Copyright Alessandro Pellizzari 6 * Released under the MIT license 7 * http://opensource.org/licenses/MIT 8 */function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function(e,t,r){return e[t]=r}}function wrap(e,t,r,o){var i,a,u=Object.create((t&&t.prototype instanceof Generator?t:Generator).prototype);return n(u,"_invoke",{value:(i=new Context(o||[]),a="suspendedStart",function(t,n){if("executing"===a)throw Error("Generator is already running");if("completed"===a){if("throw"===t)throw n;return doneResult()}for(i.method=t,i.arg=n;;){var o=i.delegate;if(o){var u=function maybeInvokeDelegate(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,maybeInvokeDelegate(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=TypeError("The iterator does not provide a '"+r+"' method")),c;var o=tryCatch(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,c;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=TypeError("iterator result is not an object"),t.delegate=null,c)}(o,i);if(u){if(u===c)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===a)throw a="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);a="executing";var s=tryCatch(e,r,i);if("normal"===s.type){if(a=i.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:i.done}}"throw"===s.type&&(a="completed",i.method="throw",i.arg=s.arg)}})}),u}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var c={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var s={};define(s,i,function(){return this});var l=Object.getPrototypeOf,f=l&&l(l(values([])));f&&f!==t&&r.call(f,i)&&(s=f);var p=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(s);function defineIteratorMethods(e){["next","throw","return"].forEach(function(t){define(e,t,function(e){return this._invoke(t,e)})})}function AsyncIterator(e,t){var o;n(this,"_invoke",{value:function(n,i){function callInvokeWithMethodAndArg(){return new t(function(o,a){!function invoke(n,o,i,a){var u=tryCatch(e[n],e,o);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==_typeof(s)&&r.call(s,"__await")?t.resolve(s.__await).then(function(e){invoke("next",e,i,a)},function(e){invoke("throw",e,i,a)}):t.resolve(s).then(function(e){c.value=e,i(c)},function(e){return invoke("throw",e,i,a)})}a(u.arg)}(n,i,o,a)})}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,next=function next(){for(;++n<e.length;)if(r.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,n(p,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),n(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,u,"GeneratorFunction")),e.prototype=Object.create(p),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,function(){return this}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Prom
8ise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},defineIteratorMethods(p),define(p,u,"Generator"),define(p,i,function(){return this}),define(p,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function handle(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:values(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)})}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}(n.key),n)}}var i={timeout:4e4,headers:[],forceDesktopMode:!1,autoStart:!0,withCredentials:!1,method:"GET",nameCallback:function(e){return e},contentType:"application/x-www-form-urlencoded",body:null,nativeFallbackOnError:!1,contentTypeDetermination:!1},a=function(){var e,t,r,a;function JsFileDownloader(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,JsFileDownloader),this.params=Object.assign({},i,e),this.link=this.createLink(),this.request=null,this.downloadedFile=null,this.abortController=void 0,this.params.autoStart)?this.downloadFile():this}return r=[{key:"start",value:function(){return this.downloadFile()}},{key:"abort",value:function(e){this.abortController&&this.abortController.abort(e||"Download cancelled")}},{key:"downloadFile",value:function(){var e=this;return new Promise(function(t,r){e.initDownload(t,r)}
8)}},{key:"setAbortListner",value:function(e){this.abortController&&this.abortController.signal.addEventListener("abort",e)}},{key:"unsetAbortListner",value:function(e){this.abortController&&this.abortController.signal.removeEventListener("abort",e)}},{key:"initDownload",value:function(e,t){var r=this,fallback=function(){r.link.target="_blank",r.link.href=r.params.url,r.clickLink()};if(!("download"in this.link)||this.isMobile())return fallback(),e();this.request=this.createRequest(),this.abortController="AbortController"in window?new AbortController:null;var abortListener=function abortListener(e){var n=e.target;r.unsetAbortListner(abortListener),r.request&&r.request.abort(),t(n.reason)};return(this.setAbortListner(abortListener),this.params.url)?(this.request.onload=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r.unsetAbortListner(abortListener),!(200!==parseInt(r.request.status,10))){o.next=3;break}return o.abrupt("return",t(new n.DownloadException("status code [".concat(r.request.status,"]"),r.request)));case 3:return o.next=5,r.startDownload();case 5:return o.abrupt("return",e(r));case 6:case"end":return o.stop()}},_callee)})),this.request.ontimeout=function(){r.unsetAbortListner(abortListener),t(new n.DownloadException("request timeout",r.request))},this.request.onerror=function(){r.unsetAbortListner(abortListener),r.params.nativeFallbackOnError?(fallback(),e(r)):t(new n.DownloadException("network error",r.request))},this.request.send(this.params.body),this):t(new n.DownloadException("url param not defined!",this.request))}},{key:"isMobile",value:function(){return!this.params.forceDesktopMode&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}},{key:"createRequest",value:function(){var e=new XMLHttpRequest;return e.open(this.params.method,this.params.url,!0),!1!==this.params.contentType&&e.setRequestHeader("Content-type",this.params.contentType),this.params.headers.forEach(function(t){e.setRequestHeader(t.name,t.value)}),e.responseType="arraybuffer",this.params.process&&"function"==typeof this.params.process&&e.addEventListener("progress",this.params.process),this.params.onloadstart&&"function"==typeof this.params.onloadstart&&(e.onloadstart=this.params.onloadstart),e.timeout=this.params.timeout,e.withCredentials=!!this.params.withCredentials||!!this.params.includeCredentials,e}},{key:"getFileName",value:function(){if("string"==typeof this.params.filename)return this.params.filename;var e=this.request.getResponseHeader("Content-Disposition"),t=[];e&&(t=e.replace(/["']/g,"").match(/filename\*?=([^;]+)/));var r=t&&t.length>=1?t[1]:this.params.url.split("/").pop().split("?")[0];return this.params.nameCallback(r)}},{key:"getContentTypeFromFileSignature",value:function(e){var t=Object.assign({},o.fileSignatures,this.params.customFileSignatures);return new Promise(function(r,n){var o=new FileReader,i=e.slice(0,4);o.onloadend=function(e){if(e.target.readyState!==FileReader.DONE){n();return}var o=new Uint8Array(e.target.result),i=[];o.forEach(function(e){i.push(e.toString(16))}),r(t[i.join("").toUpperCase()])},o.onerror=n,o.readAsArrayBuffer(i)})}},{key:"getContentTypeFromResponseHeader",value:function(){return this.request.getResponseHeader("content-type")}},{key:"getContentType",value:function(e){var t,r=this;return new Promise((t=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(t){var n,o,i,a,u,c,s,l;return _regeneratorRuntime().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(n=r.params.contentTypeDetermination,o="application/octet-stream",("header"===n||"full"===n)&&(i=r.getContentTypeFromResponseHeader()),!("signature"===n||"full"===n)){f.next=7;break}return f.next=6,r.getContentTypeFromFileSignature(new Blob([e]));case 6:a=f.sent;case 7:"header"===n?t(null!==(u=i)&&void 0!==u?u:o):"signature"===n?t(null!==(c=a)&&void 0!==c?c:o):"full"===n?t(null!==(s=null!==(l=a)&&void 0!==l?l:i)&&void 0!==s?s:o):t(o);case 8:case"end":return f.stop()}},_callee2)})),function(e){return t.apply(this,arguments)}))}},{key:"createLink",value:function(){var e=document.createElement("a");return e.style.display="none",e}},{key:"clickLink",value:function(){var e;try{e=new MouseEvent("click")}catch(t){(e=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,
8!1,!1,0,null)}this.link.dispatchEvent(e)}},{key:"getFile",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(e,t){var r,n;return _regeneratorRuntime().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getContentType(e);case 2:n={type:o.sent};try{r=new File([e],t,n)}catch(o){(r=new Blob([e],n)).name=t,r.lastModifiedDate=new Date}return o.abrupt("return",r);case 6:case"end":return o.stop()}},_callee3,this)})),function(t,r){return e.apply(this,arguments)})},{key:"startDownload",value:(t=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(){var e,t;return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e=this.getFileName(),r.next=3,this.getFile(this.request.response,e);case 3:if(this.downloadedFile=r.sent,!("msSaveOrOpenBlob"in window.navigator)){r.next=6;break}return r.abrupt("return",window.navigator.msSaveOrOpenBlob(this.downloadedFile,e));case 6:return t=window.URL.createObjectURL(this.downloadedFile),this.link.href=t,this.link.download=e,this.clickLink(),setTimeout(function(){(window.URL||window.webkitURL||window).revokeObjectURL(t)},4e4),r.abrupt("return",this.downloadedFile);case 12:case"end":return r.stop()}},_callee4,this)})),function(){return t.apply(this,arguments)})}],_defineProperties(JsFileDownloader.prototype,r),a&&_defineProperties(JsFileDownloader,a),Object.defineProperty(JsFileDownloader,"prototype",{writable:!1}),JsFileDownloader}();t.default=a},
8"./src/signatures.js":function(e,t,r){"use strict";r.r(t),r.d(t,"fileSignatures",function(){return n});var n={"89504E47":"image/png",25504446:"application/pdf"}}
8}).default}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.