@nocobase/plugin-backup-restore 2.0.22 → 2.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).push([["418"],{657:function(e,t,n){n.r(t),n.d(t,{BackupAndRestoreList:function(){return C}});var r=n(375),l=n(418),a=n(342),o=n(59),i=n(506),u=n(155),c=n.n(u),s=n(404);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n,r,l,a,o){try{var i=e[a](o),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,l)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var a=e.apply(t,n);function o(e){d(a,r,l,o,i,"next",e)}function i(e){d(a,r,l,o,i,"throw",e)}o(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],o=!0,i=!1;try{for(l=l.call(e);!(o=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){var n,r,l,a={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(l=2&c[0]?r.return:c[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,c[1])).done)return l;switch(r=0,l&&(c=[2&c[0],l.value]),c[0]){case 0:case 1:l=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(l=(l=a.trys).length>0&&l[l.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!l||c[1]>l[0]&&c[1]<l[3])){a.label=c[1];break}if(6===c[0]&&a.label<l[1]){a.label=l[1],l=c;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(c);break}l[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=l=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var v=o.Upload.Dragger,g=function(e){var t=e.collectionsData,n=(0,s.Wl)().t,r=y((0,u.useState)(!1),2),l=r[0],i=r[1],f=y((0,u.useState)(t),2),d=f[0],m=f[1];(0,u.useEffect)(function(){m(t)},[t]);var b=(0,a.useAPIClient)(),v=(0,a.useCompile)(),g=(0,u.useMemo)(function(){return b.resource("backupFiles")},[b]),k=[{title:n("Collection"),dataIndex:"collection",key:"collection",render:function(e,t){var n=v(t.title);return t.name===n?n:c().createElement("div",null,t.name," ",c().createElement("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"}},"(",v(t.title),")"))}},{title:n("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],E=Object.keys(d||{}).map(function(e){return{key:e,label:n("".concat(e,".title")),children:c().createElement(c().Fragment,null,c().createElement(o.Alert,{style:{marginBottom:16},message:n("".concat(e,".description"))}),c().createElement(o.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:d[e],columns:k,scroll:{y:400}}))}});return c().createElement(c().Fragment,null,c().createElement("a",{onClick:function(){return p(function(){var t;return h(this,function(n){switch(n.label){case 0:if(!e.isBackup)return[3,2];return[4,g.dumpableCollections()];case 1:m(null==(t=n.sent())?void 0:t.data),i(!0),n.label=2;case 2:return i(!0),[2]}})})()}},n("Learn more")),c().createElement(o.Modal,{title:n("Backup instructions"),width:"80vw",open:l,footer:null,onOk:function(){i(!1)},onCancel:function(){i(!1)}},c().createElement(o.Tabs,{defaultActiveKey:"required",items:E})))},k=function(e){var t=e.ButtonComponent,n=void 0===t?o.Button:t,r=e.title,i=e.upload,f=void 0!==i&&i,d=e.fileData,m=(0,s.Wl)().t,b=y((0,u.useState)(["required"]),2),v=b[0],k=b[1],E=y((0,u.useState)(!1),2),C=E[0],O=E[1],S=y((0,u.useState)(null),2),P=S[0],j=S[1],B=y((0,u.useState)(!1),2),x=B[0],D=B[1],A=(0,a.useAPIClient)(),I=(0,u.useMemo)(function(){return A.resource("backupFiles")},[A]),F=y((0,u.useState)([]),2),T=F[0],q=F[1];return(0,u.useEffect)(function(){q(Object.keys((null==P?void 0:P.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}}))},[P]),c().createElement(c().Fragment,null,c().createElement(n,{onClick:function(){return p(function(){var e,t,n,r;return h(this,function(l){switch(l.label){case 0:if(O(!0),f)return[3,2];return D(!0),[4,I.get({filterByTk:d.name})];case 1:q(Object.keys((null==(r=l.sent().data)||null==(t=r.data)||null==(e=t.meta)?void 0:e.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),j(null==r||null==(n=r.data)?void 0:n.meta),D(!1),l.label=2;case 2:return[2]}})})()}},r),c().createElement(o.Modal,{title:m("Restore"),width:800,footer:f&&!P?null:void 0,open:C,onOk:function(){I.restore({values:{dataTypes:v,filterByTk:null==d?void 0:d.name,key:null==P?void 0:P.key}}),O(!1)},onCancel:function(){O(!1),j(null),k(["required"])}},c().createElement(o.Spin,{spinning:x},f&&!P&&c().createElement(w,{setRestoreData:j}),(!f||P)&&[c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},key:"info"},m("Select the data to be restored")," (",c().createElement(g,{collectionsData:null==P?void 0:P.dumpableCollectionsGroupByGroup}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8},key:"dataType"},c().createElement(l.FormItem,null,c().createElement(a.Checkbox.Group,{options:T,style:{flexDirection:"column"},value:v,onChange:function(e){return k(e)}})))])))},E=function(e){var t=e.ButtonComponent,n=void 0===t?o.Button:t,l=e.refresh,i=(0,s.Wl)().t,f=y((0,u.useState)(!1),2),d=f[0],m=f[1],b=y((0,u.useState)(["required"]),2),v=b[0],k=b[1],E=(0,a.useAPIClient)(),w=y((0,u.useState)([]),2),C=w[0],O=w[1];return c().createElement(c().Fragment,null,c().createElement(n,{icon:c().createElement(r.PlusOutlined,null),type:"primary",onClick:function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return[4,E.resource("backupFiles").dumpableCollections()];case 1:return O(Object.keys(e.sent().data||[]).map(function(e){return{value:e,label:i("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),m(!0),[2]}})})()}},i("New backup")),c().createElement(o.Modal,{title:i("New backup"),width:800,open:d,onOk:function(){E.request({url:"backupFiles:create",method:"post",data:{dataTypes:v}}),m(!1),k(["required"]),setTimeout(function(){l()},500)},onCancel:function(){m(!1),k(["required"])}},c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"}},i("Select the data to be backed up")," (",c().createElement(g,{isBackup:!0}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8}},c().createElement(a.Checkbox.Group,{options:C,style:{flexDirection:"column"},onChange:function(e){return k(e)},value:v}))))},w=function(e){var t,n,l=(0,s.Wl)().t;return c().createElement(v,(t={multiple:!1,action:"/backupFiles:upload",onChange:function(t){t.fileList.length>1&&t.fileList.splice(0,t.fileList.length-1);var n,r,a,i=t.file.status;"done"===i?(o.message.success("".concat(t.file.name," ")+l("file uploaded successfully")),e.setRestoreData(b(m({},null==(r=t.file.response)||null==(n=r.data)?void 0:n.meta),{key:null==(a=t.file.response)?void 0:a.data.key}))):"error"===i&&o.message.error("".concat(t.file.name," ")+l("file upload failed"))},onDrop:function(e){console.log("Dropped files",e.dataTransfer.files)}},n=(0,a.useAPIClient)(),b(m({},t),{customRequest:function(e){var t=e.action,r=e.data,l=e.file,a=e.filename,o=e.headers,i=e.onError,u=e.onProgress,c=e.onSuccess,s=e.withCredentials,f=new FormData;return r&&Object.keys(r).forEach(function(e){f.append(e,r[e])}),f.append(a,l),n.axios.post(t,f,{withCredentials:s,headers:o,onUploadProgress:function(e){var t=e.total;u({percent:Math.round(e.loaded/t*100).toFixed(2)},l)}}).then(function(e){c(e.data,l)}).catch(i).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}},onChange:function(e){var n;null==(n=t.onChange)||n.call(t,e)}})),c().createElement("p",{className:"ant-upload-drag-icon"},c().createElement(r.InboxOutlined,null)),c().createElement("p",{className:"ant-upload-text"}," ",l("Click or drag file to this area to upload")))},C=function(){var e=(0,s.Wl)().t,t=(0,a.useAPIClient)(),n=y((0,u.useState)([]),2),l=n[0],f=n[1],d=y((0,u.useState)(!1),2),m=d[0],b=d[1],v=y((0,u.useState)(!1),2),g=(v[0],v[1]),w=o.App.useApp().modal,C=(0,u.useMemo)(function(){return t.resource("backupFiles")},[t]);(0,u.useEffect)(function(){O()},[]);var O=function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return b(!0),[4,C.list()];case 1:return f(e.sent().data.data),b(!1),[2]}})})()},S=function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return[4,O()];case 1:return e.sent(),[2]}})})()},P=function(t){w.confirm({title:e("Delete record",{ns:"client"}),content:e("Are you sure you want to delete it?",{ns:"client"}),onOk:function(){return p(function(){return h(this,function(n){switch(n.label){case 0:return[4,C.destroy({filterByTk:t.name})];case 1:return n.sent(),[4,O()];case 2:return n.sent(),o.message.success(e("Deleted successfully")),[2]}})})()}})};return c().createElement("div",null,c().createElement(o.Card,{bordered:!1},c().createElement(o.Space,{style:{float:"right",marginBottom:16}},c().createElement(o.Button,{onClick:S,icon:c().createElement(r.ReloadOutlined,null)},e("Refresh")),c().createElement(k,{upload:!0,title:c().createElement(c().Fragment,null,c().createElement(r.UploadOutlined,null)," ",e("Restore backup from local"))}),c().createElement(E,{refresh:S})),c().createElement(o.Table,{dataSource:l,loading:m,columns:[{title:e("Backup file"),dataIndex:"name",width:400,onCell:function(e){return e.inProgress?{colSpan:4}:{}},render:function(t,n){return n.inProgress?c().createElement("div",{style:{color:"rgba(0, 0, 0, 0.88)"}},t,"(",e("Backing up"),"...)"):c().createElement("div",null,t)}},{title:e("File size"),dataIndex:"fileSize",onCell:function(e){return e.inProgress?{colSpan:0}:{}}},{title:e("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e){return c().createElement(a.DatePicker.ReadPretty,{value:e,showTime:!0})}},{title:e("Actions",{ns:"client"}),dataIndex:"actions",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(n,r){return c().createElement(o.Space,{split:c().createElement(o.Divider,{type:"vertical"})},c().createElement(k,{ButtonComponent:"a",title:e("Restore"),fileData:r}),c().createElement("a",{type:"link",onClick:function(){return p(function(){var e,n;return h(this,function(l){switch(l.label){case 0:return g(r.name),[4,t.request({url:"backupFiles:download",method:"get",params:{filterByTk:r.name},responseType:"blob"})];case 1:return e=l.sent(),g(!1),n=new Blob([e.data]),(0,i.saveAs)(n,r.name),[2]}})})()}},e("Download")),c().createElement("a",{onClick:function(){return P(r)}},e("Delete")))}}]})))}}}]);
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("file-saver"),require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-backup-restore",["react-i18next","file-saver","@nocobase/client","@formily/antd-v5","react","@ant-design/icons","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-backup-restore"]=t(require("react-i18next"),require("file-saver"),require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("antd")):e["@nocobase/plugin-backup-restore"]=t(e["react-i18next"],e["file-saver"],e["@nocobase/client"],e["@formily/antd-v5"],e.react,e["@ant-design/icons"],e.antd)}(self,function(e,t,n,r,o,i,u){return function(){var c,a,f,l,s,p,d={551:function(e,t,n){"use strict";n.d(t,{A7:function(){return o},lV:function(){return i}}),n(772);var r=n(238),o="backup-restore";function i(){return(0,r.useTranslation)(o,{nsMode:"fallback"})}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=i},632:function(e){"use strict";e.exports=r},772:function(e){"use strict";e.exports=n},721:function(e){"use strict";e.exports=u},346:function(e){"use strict";e.exports=t},156:function(e){"use strict";e.exports=o},238:function(t){"use strict";t.exports=e}},b={};function y(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return d[e](n,n.exports,y),n.exports}y.m=d,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return"e4f348aa71db3614.js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c={},a="@nocobase/plugin-backup-restore:",y.l=function(e,t,n,r){if(c[e])return void c[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),f=0;f<u.length;f++){var l=u[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==a+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-webpack",a+n),o.src=e),c[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=c[e];if(delete c[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(f=window.__webpack_public_path__||"/").endsWith("/")||(f+="/"),y.p=f+"static/plugins/@nocobase/plugin-backup-restore/dist/client/",l={909:0},y.f.j=function(e,t){var n=y.o(l,e)?l[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=l[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(l,e)&&(0!==(n=l[e])&&(l[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},s=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==l[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);u&&u(y)}for(e&&e(t);c<o.length;c++)r=o[c],y.o(l,r)&&l[r]&&l[r][0](),l[r]=0},(p=self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).forEach(s.bind(null,0)),p.push=s.bind(null,p.push.bind(p));var v={};return!function(){"use strict";y.r(v),y.d(v,{PluginBackupRestoreClient:function(){return d},default:function(){return b}});var e=y(772),t=y(156),n=y.n(t),r=function(t){return n().createElement(e.SchemaComponentOptions,null,t.children)};r.displayName="DuplicatorProvider";var o=y(551),i=y(581);function u(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function c(e,t,n){return(c=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&f(o,n.prototype),o}).apply(null,arguments)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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,n)}function n(){return c(e,arguments,a(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var p=(0,e.lazy)(function(){return i("imported_-300v59_component",y.e("611").then(y.bind(y,95)))},"BackupAndRestoreList").BackupAndRestoreList,d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=a(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var a=[i,c];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.use(r),t.app.pluginSettingsManager.add(o.A7,{title:t.t("Backup & Restore"),icon:"CloudServerOutlined",Component:p,aclSnippet:"pm.backup-restore"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){u(i,r,o,c,a,"next",e)}function a(e){u(i,r,o,c,a,"throw",e)}c(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(l(e.Plugin)),b=d}(),v}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("file-saver"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("@nocobase/plugin-backup-restore",["react-i18next","file-saver","@formily/antd-v5","react","antd","@nocobase/client","@ant-design/icons"],t):"object"==typeof exports?exports["@nocobase/plugin-backup-restore"]=t(require("react-i18next"),require("file-saver"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):e["@nocobase/plugin-backup-restore"]=t(e["react-i18next"],e["file-saver"],e["@formily/antd-v5"],e.react,e.antd,e["@nocobase/client"],e["@ant-design/icons"])}(self,function(e,t,r,n,o,i,u){return function(){var c,a,s,l={404:function(e,t,r){"use strict";r.d(t,{CU:function(){return o},Wl:function(){return i}}),r(342);var n=r(953),o="backup-restore";function i(){return(0,n.useTranslation)(o,{nsMode:"fallback"})}},631:function(e){e.exports=function(e,t){return"u">typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},375:function(e){"use strict";e.exports=u},418:function(e){"use strict";e.exports=r},342:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=o},506:function(e){"use strict";e.exports=t},155:function(e){"use strict";e.exports=n},953:function(t){"use strict";t.exports=e}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return l[e](r,r.exports,p),r.exports}p.m=l,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var r in t)p.o(t,r)&&!p.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,r){return p.f[r](e,t),t},[]))},p.u=function(e){return"10f4c576bd93c7ad.js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d={},p.l=function(e,t,r,n){if(d[e])return void d[e].push(t);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-backup-restore:"+r){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","@nocobase/plugin-backup-restore:"+r),o.src=e),d[e]=[t];var s=function(t,r){o.onerror=o.onload=null,clearTimeout(l);var n=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(b=p.g.location+"");var d,b,v=p.g.document;if(!b&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(b=v.currentScript.src),!b)){var y=v.getElementsByTagName("script");if(y.length)for(var h=y.length-1;h>-1&&(!b||!/^http(s?):/.test(b));)b=y[h--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");p.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},p.f.j=function(e,t){var r=p.o(c,e)?c[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=c[e]=[t,n]});t.push(r[2]=n);var o=p.p+p.u(e),i=Error();p.l(o,function(t){if(p.o(c,e)&&(0!==(r=c[e])&&(c[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},a=function(e,t){var r,n,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(r in i)p.o(i,r)&&(p.m[r]=i[r]);u&&u(p)}for(e&&e(t);a<o.length;a++)n=o[a],p.o(c,n)&&c[n]&&c[n][0](),c[n]=0},(s=self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).forEach(a.bind(null,0)),s.push=a.bind(null,s.push.bind(s));var g={};return!function(){"use strict";var e=window.__webpack_public_path__||"/";"/"!==e.charAt(e.length-1)&&(e+="/"),p.p=e+"static/plugins/@nocobase/plugin-backup-restore/dist/client/"}(),!function(){"use strict";p.r(g),p.d(g,{default:function(){return v},PluginBackupRestoreClient:function(){return b}});var e=p(342),t=p(155),r=p.n(t),n=function(t){return r().createElement(e.SchemaComponentOptions,null,t.children)};n.displayName="DuplicatorProvider";var o=p(404),i=p(631);function u(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function c(e,t,r){return(c=f()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&s(o,r.prototype),o}).apply(null,arguments)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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,r)}function r(){return c(e,arguments,a(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var d=(0,e.lazy)(function(){return i("imported_-300v59_component",p.e("418").then(p.bind(p,657)))},"BackupAndRestoreList").BackupAndRestoreList,b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=a(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&s(r,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var s=[c,a];if(r)throw TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(e){return this.app.use(n),this.app.pluginSettingsManager.add(o.CU,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:d,aclSnippet:"pm.backup-restore"}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){u(i,n,o,c,a,"next",e)}function a(e){u(i,n,o,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(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,n.key,n)}}(r.prototype,t),r}(l(e.Plugin)),v=b}(),g}()});
@@ -10,15 +10,15 @@
10
10
  module.exports = {
11
11
  "@ant-design/icons": "5.6.1",
12
12
  "@formily/antd-v5": "1.2.3",
13
- "@nocobase/client": "2.0.22",
13
+ "@nocobase/client": "2.1.0-alpha.10",
14
14
  "antd": "5.24.2",
15
15
  "file-saver": "2.0.5",
16
16
  "react": "18.2.0",
17
- "@nocobase/server": "2.0.22",
18
- "@nocobase/utils": "2.0.22",
19
- "@nocobase/database": "2.0.22",
17
+ "@nocobase/server": "2.1.0-alpha.10",
18
+ "@nocobase/utils": "2.1.0-alpha.10",
19
+ "@nocobase/database": "2.1.0-alpha.10",
20
20
  "dayjs": "1.11.13",
21
21
  "lodash": "4.17.21",
22
22
  "react-i18next": "11.18.6",
23
- "@nocobase/actions": "2.0.22"
23
+ "@nocobase/actions": "2.1.0-alpha.10"
24
24
  };
@@ -1 +1 @@
1
- {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-03-20T04:46:26.823Z"}
1
+ {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-03-20T09:02:44.761Z"}
@@ -1 +1 @@
1
- {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-03-20T04:46:25.010Z"}
1
+ {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-03-20T09:02:42.990Z"}
@@ -1,8 +1,8 @@
1
- (function(){var e={6726:function(e){function allocUnsafe(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}if(e<0){throw new RangeError('"size" argument must not be negative')}if(Buffer.allocUnsafe){return Buffer.allocUnsafe(e)}else{return new Buffer(e)}}e.exports=allocUnsafe},6615:function(e,t,r){var i=r(2852);var n=r(6726);e.exports=function alloc(e,t,r){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}if(e<0){throw new RangeError('"size" argument must not be negative')}if(Buffer.alloc){return Buffer.alloc(e,t,r)}var o=n(e);if(e===0){return o}if(t===undefined){return i(o,0)}if(typeof r!=="string"){r=undefined}return i(o,t,r)}},4794:function(e,t,r){var i=r(4300).Buffer;var n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){n=new Int32Array(n)}function ensureBuffer(e){if(i.isBuffer(e)){return e}var t=typeof i.alloc==="function"&&typeof i.from==="function";if(typeof e==="number"){return t?i.alloc(e):new i(e)}else if(typeof e==="string"){return t?i.from(e):new i(e)}else{throw new Error("input must be buffer, number, or string, received "+typeof e)}}function bufferizeInt(e){var t=ensureBuffer(4);t.writeInt32BE(e,0);return t}function _crc32(e,t){e=ensureBuffer(e);if(i.isBuffer(t)){t=t.readUInt32BE(0)}var r=~~t^-1;for(var o=0;o<e.length;o++){r=n[(r^e[o])&255]^r>>>8}return r^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};e.exports=crc32},2852:function(e){var t=function(){try{if(!Buffer.isEncoding("latin1")){return false}var e=Buffer.alloc?Buffer.alloc(4):new Buffer(4);e.fill("ab","ucs2");return e.toString("hex")==="61006200"}catch(e){return false}}();function isSingleByte(e){return e.length===1&&e.charCodeAt(0)<256}function fillWithNumber(e,t,r,i){if(r<0||i>e.length){throw new RangeError("Out of range index")}r=r>>>0;i=i===undefined?e.length:i>>>0;if(i>r){e.fill(t,r,i)}return e}function fillWithBuffer(e,t,r,i){if(r<0||i>e.length){throw new RangeError("Out of range index")}if(i<=r){return e}r=r>>>0;i=i===undefined?e.length:i>>>0;var n=r;var o=t.length;while(n<=i-o){t.copy(e,n);n+=o}if(n!==i){t.copy(e,n,0,i-n)}return e}function fill(e,r,i,n,o){if(t){return e.fill(r,i,n,o)}if(typeof r==="number"){return fillWithNumber(e,r,i,n)}if(typeof r==="string"){if(typeof i==="string"){o=i;i=0;n=e.length}else if(typeof n==="string"){o=n;n=e.length}if(o!==undefined&&typeof o!=="string"){throw new TypeError("encoding must be a string")}if(o==="latin1"){o="binary"}if(typeof o==="string"&&!Buffer.isEncoding(o)){throw new TypeError("Unknown encoding: "+o)}if(r===""){return fillWithNumber(e,0,i,n)}if(isSingleByte(r)){return fillWithNumber(e,r.charCodeAt(0),i,n)}r=new Buffer(r,o)}if(Buffer.isBuffer(r)){return fillWithBuffer(e,r,i,n)}return fillWithNumber(e,0,i,n)}e.exports=fill},5898:function(e,t,r){function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=r(4300).Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},3235:function(e,t,r){"use strict";const i=r(8300);const n=r(1554);const o=r(2283);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!n(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!i(e)||i(e).ext!=="tar")){return Promise.resolve([])}const t=o.extract();const r=[];t.on("entry",((e,t,i)=>{const n=[];t.on("data",(e=>n.push(e)));t.on("end",(()=>{const t={data:Buffer.concat(n),mode:e.mode,mtime:e.mtime,path:e.name,type:e.type};if(e.type==="symlink"||e.type==="link"){t.linkname=e.linkname}r.push(t);i()}))}));const a=new Promise(((i,n)=>{if(!Buffer.isBuffer(e)){e.on("error",n)}t.on("finish",(()=>i(r)));t.on("error",n)}));t.then=a.then.bind(a);t.catch=a.catch.bind(a);if(Buffer.isBuffer(e)){t.end(e)}else{e.pipe(t)}return t}},8300:function(e){"use strict";e.exports=e=>{const t=new Uint8Array(e);if(!(t&&t.length>1)){return null}const check=(e,r)=>{r=Object.assign({offset:0},r);for(let i=0;i<e.length;i++){if(e[i]!==t[i+r.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])&&check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check([80,75,3,4])&&check([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(t[6]===0||t[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([0,0,0])&&(t[3]===24||t[3]===32)&&check([102,116,121,112],{offset:4})||check([51,103,112,53])||check([0,0,0,28,102,116,121,112,109,112,52,50])&&check([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||check([0,0,0,28,102,116,121,112,105,115,111,109])||check([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0])){return{ext:"mp4",mime:"video/mp4"}}if(check([0,0,0,28,102,116,121,112,77,52,86])){return{ext:"m4v",mime:"video/x-m4v"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=t.subarray(4,4+4096);const r=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(r>=0){const t=r+3;const findDocType=r=>Array.from(r).every(((r,i)=>e[t+i]===r.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}if(check([73,68,51])||check([255,251])){return{ext:"mp3",mime:"audio/mpeg"}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((t[0]===67||t[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},2454:function(e,t,r){"use strict";const i=r(3235);const n=r(8688);const o=r(1554);const a=r(9562);const s=r(3467);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!o(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!n(e)||n(e).ext!=="bz2")){return Promise.resolve([])}if(Buffer.isBuffer(e)){return i()(a.decode(e))}return i()(e.pipe(s()))}},8688:function(e){"use strict";const toBytes=e=>Array.from(e).map((e=>e.charCodeAt(0)));const t=toBytes("META-INF/mozilla.rsa");const r=toBytes("[Content_Types].xml");const i=toBytes("_rels/.rels");e.exports=e=>{const n=new Uint8Array(e);if(!(n&&n.length>1)){return null}const check=(e,t)=>{t=Object.assign({offset:0},t);for(let r=0;r<e.length;r++){if(t.mask){if(e[r]!==(t.mask[r]&n[r+t.offset])){return false}}else if(e[r]!==n[r+t.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])){if(check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check(t,{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check(r,{offset:30})||check(i,{offset:30})){const e=n.subarray(4,4+2e3);const nextZipHeaderIndex=e=>e.findIndex(((e,t,r)=>r[t]===80&&r[t+1]===75&&r[t+2]===3&&r[t+3]===4));const t=nextZipHeaderIndex(e);if(t!==-1){const e=n.subarray(t+8,t+8+1e3);const r=nextZipHeaderIndex(e);if(r!==-1){const e=8+t+r+30;if(check(toBytes("word/"),{offset:e})){return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}}if(check(toBytes("ppt/"),{offset:e})){return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}if(check(toBytes("xl/"),{offset:e})){return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}}}if(check([80,75])&&(n[2]===3||n[2]===5||n[2]===7)&&(n[3]===4||n[3]===6||n[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(n[6]===0||n[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([51,103,112,53])||check([0,0,0])&&check([102,116,121,112],{offset:4})&&(check([109,112,52,49],{offset:8})||check([109,112,52,50],{offset:8})||check([105,115,111,109],{offset:8})||check([105,115,111,50],{offset:8})||check([109,109,112,52],{offset:8})||check([77,52,86],{offset:8})||check([100,97,115,104],{offset:8}))){return{ext:"mp4",mime:"video/mp4"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=n.subarray(4,4+4096);const t=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(t!==-1){const r=t+3;const findDocType=t=>Array.from(t).every(((t,i)=>e[r+i]===t.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}for(let e=0;e<2&&e<n.length-16;e++){if(check([73,68,51],{offset:e})||check([255,226],{offset:e,mask:[255,226]})){return{ext:"mp3",mime:"audio/mpeg"}}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((n[0]===67||n[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},7335:function(e,t,r){"use strict";const i=r(9796);const n=r(3235);const o=r(1608);const a=r(1554);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!a(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!o(e)||o(e).ext!=="gz")){return Promise.resolve([])}const t=i.createGunzip();const r=n()(t);if(Buffer.isBuffer(e)){t.end(e)}else{e.pipe(t)}return r}},1608:function(e){"use strict";e.exports=e=>{const t=new Uint8Array(e);if(!(t&&t.length>1)){return null}const check=(e,r)=>{r=Object.assign({offset:0},r);for(let i=0;i<e.length;i++){if(e[i]!==t[i+r.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])&&check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check([80,75,3,4])&&check([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(t[6]===0||t[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([0,0,0])&&(t[3]===24||t[3]===32)&&check([102,116,121,112],{offset:4})||check([51,103,112,53])||check([0,0,0,28,102,116,121,112,109,112,52,50])&&check([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||check([0,0,0,28,102,116,121,112,105,115,111,109])||check([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0])){return{ext:"mp4",mime:"video/mp4"}}if(check([0,0,0,28,102,116,121,112,77,52,86])){return{ext:"m4v",mime:"video/x-m4v"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=t.subarray(4,4+4096);const r=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(r>=0){const t=r+3;const findDocType=r=>Array.from(r).every(((r,i)=>e[t+i]===r.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}if(check([73,68,51])||check([255,251])){return{ext:"mp3",mime:"audio/mpeg"}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((t[0]===67||t[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},8396:function(e,t,r){"use strict";const i=r(7128);const n=r(8771);const o=r(126);const a=r(8781);const getType=(e,t)=>{const r=61440;const i=16384;const n=40960;const o=e.versionMadeBy>>8;if((t&r)===n){return"symlink"}if((t&r)===i||o===0&&e.externalFileAttributes===16){return"directory"}return"file"};const extractEntry=(e,t)=>{const r={mode:e.externalFileAttributes>>16&65535,mtime:e.getLastModDate(),path:e.fileName};r.type=getType(e,r.mode);if(r.mode===0&&r.type==="directory"){r.mode=493}if(r.mode===0){r.mode=420}return o(t.openReadStream.bind(t))(e).then(n.buffer).then((e=>{r.data=e;if(r.type==="symlink"){r.linkname=e.toString()}return r})).catch((e=>{t.close();throw e}))};const extractFile=e=>new Promise(((t,r)=>{const i=[];e.readEntry();e.on("entry",(t=>{extractEntry(t,e).catch(r).then((t=>{i.push(t);e.readEntry()}))}));e.on("error",r);e.on("end",(()=>t(i)))}));e.exports=()=>e=>{if(!Buffer.isBuffer(e)){return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof e}`))}if(!i(e)||i(e).ext!=="zip"){return Promise.resolve([])}return o(a.fromBuffer)(e,{lazyEntries:true}).then(extractFile)}},7420:function(e,t,r){var i=r(2781).PassThrough;var n=r(7426);e.exports=function(e){e=n({},e);var t=e.array;var r=e.encoding;var o=r==="buffer";var a=false;if(t){a=!(r||o)}else{r=r||"utf8"}if(o){r=null}var s=0;var u=[];var l=new i({objectMode:a});if(r){l.setEncoding(r)}l.on("data",(function(e){u.push(e);if(a){s=u.length}else{s+=e.length}}));l.getBufferedValue=function(){if(t){return u}return o?Buffer.concat(u,s):u.join("")};l.getBufferedLength=function(){return s};return l}},8771:function(e,t,r){"use strict";var i=r(5222);var n=r(7426);var o=r(7420);function getStream(e,t){if(!e){return i.reject(new Error("Expected a stream"))}t=n({maxBuffer:Infinity},t);var r=t.maxBuffer;var a;var s;var u=new i((function(i,n){a=o(t);e.once("error",error);e.pipe(a);a.on("data",(function(){if(a.getBufferedLength()>r){n(new Error("maxBuffer exceeded"))}}));a.once("error",error);a.on("end",i);s=function(){if(e.unpipe){e.unpipe(a)}};function error(e){if(e){e.bufferedData=a.getBufferedValue()}n(e)}}));u.then(s,s);return u.then((function(){return a.getBufferedValue()}))}e.exports=getStream;e.exports.buffer=function(e,t){return getStream(e,n({},t,{encoding:"buffer"}))};e.exports.array=function(e,t){return getStream(e,n({},t,{array:true}))}},126:function(e){"use strict";var processFn=function(e,t,r){return function(){var i=this;var n=new Array(arguments.length);for(var o=0;o<arguments.length;o++){n[o]=arguments[o]}return new t((function(t,o){n.push((function(e,i){if(e){o(e)}else if(r.multiArgs){var n=new Array(arguments.length-1);for(var a=1;a<arguments.length;a++){n[a-1]=arguments[a]}t(n)}else{t(i)}}));e.apply(i,n)}))}};var t=e.exports=function(e,t,r){if(typeof t!=="function"){r=t;t=Promise}r=r||{};r.exclude=r.exclude||[/.+Sync$/];var filter=function(e){var match=function(t){return typeof t==="string"?e===t:t.test(e)};return r.include?r.include.some(match):!r.exclude.some(match)};var i=typeof e==="function"?function(){if(r.excludeMain){return e.apply(this,arguments)}return processFn(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce((function(i,n){var o=e[n];i[n]=typeof o==="function"&&filter(n)?processFn(o,t,r):o;return i}),i)};t.all=t},9350:function(e,t,r){"use strict";const i=r(1017);const n=r(7758);const o=r(3235);const a=r(2454);const s=r(7335);const u=r(8396);const l=r(9126);const c=r(9205);const d=r(5723);const p=c(n);const runPlugins=(e,t)=>{if(t.plugins.length===0){return Promise.resolve([])}return Promise.all(t.plugins.map((r=>r(e,t)))).then((e=>e.reduce(((e,t)=>e.concat(t)))))};const safeMakeDir=(e,t)=>p.realpath(e).catch((r=>{const n=i.dirname(e);return safeMakeDir(n,t)})).then((r=>{if(r.indexOf(t)!==0){throw new Error("Refusing to create a directory outside the output path.")}return l(e).then(p.realpath)}));const preventWritingThroughSymlink=(e,t)=>p.readlink(e).catch((e=>null)).then((e=>{if(e){throw new Error("Refusing to write into a symlink")}return t}));const extractFile=(e,t,r)=>runPlugins(e,r).then((e=>{if(r.strip>0){e=e.map((e=>{e.path=d(e.path,r.strip);return e})).filter((e=>e.path!=="."))}if(typeof r.filter==="function"){e=e.filter(r.filter)}if(typeof r.map==="function"){e=e.map(r.map)}if(!t){return e}return Promise.all(e.map((e=>{const r=i.join(t,e.path);const n=e.mode&~process.umask();const o=new Date;if(e.type==="directory"){return l(t).then((e=>p.realpath(e))).then((e=>safeMakeDir(r,e))).then((()=>p.utimes(r,o,e.mtime))).then((()=>e))}return l(t).then((e=>p.realpath(e))).then((e=>safeMakeDir(i.dirname(r),e).then((()=>e)))).then((t=>{if(e.type==="file"){return preventWritingThroughSymlink(r,t)}return t})).then((e=>p.realpath(i.dirname(r)).then((t=>{if(t.indexOf(e)!==0){throw new Error("Refusing to write outside output directory: "+t)}})))).then((()=>{if(e.type==="link"){return p.link(e.linkname,r)}if(e.type==="symlink"&&process.platform==="win32"){return p.link(e.linkname,r)}if(e.type==="symlink"){return p.symlink(e.linkname,r)}return p.writeFile(r,e.data,{mode:n})})).then((()=>e.type==="file"&&p.utimes(r,o,e.mtime))).then((()=>e))})))}));e.exports=(e,t,r)=>{if(typeof e!=="string"&&!Buffer.isBuffer(e)){return Promise.reject(new TypeError("Input file required"))}if(typeof t==="object"){r=t;t=null}r=Object.assign({plugins:[o(),a(),s(),u()]},r);const i=typeof e==="string"?p.readFile(e):Promise.resolve(e);return i.then((e=>extractFile(e,t,r)))}},9205:function(e){"use strict";var processFn=function(e,t,r){return function(){var i=this;var n=new Array(arguments.length);for(var o=0;o<arguments.length;o++){n[o]=arguments[o]}return new t((function(t,o){n.push((function(e,i){if(e){o(e)}else if(r.multiArgs){var n=new Array(arguments.length-1);for(var a=1;a<arguments.length;a++){n[a-1]=arguments[a]}t(n)}else{t(i)}}));e.apply(i,n)}))}};var t=e.exports=function(e,t,r){if(typeof t!=="function"){r=t;t=Promise}r=r||{};r.exclude=r.exclude||[/.+Sync$/];var filter=function(e){var match=function(t){return typeof t==="string"?e===t:t.test(e)};return r.include?r.include.some(match):!r.exclude.some(match)};var i=typeof e==="function"?function(){if(r.excludeMain){return e.apply(this,arguments)}return processFn(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce((function(i,n){var o=e[n];i[n]=typeof o==="function"&&filter(n)?processFn(o,t,r):o;return i}),i)};t.all=t},1205:function(e,t,r){var i=r(1223);var noop=function(){};var isRequest=function(e){return e.setHeader&&typeof e.abort==="function"};var isChildProcess=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var eos=function(e,t,r){if(typeof t==="function")return eos(e,null,t);if(!t)t={};r=i(r||noop);var n=e._writableState;var o=e._readableState;var a=t.readable||t.readable!==false&&e.readable;var s=t.writable||t.writable!==false&&e.writable;var u=false;var onlegacyfinish=function(){if(!e.writable)onfinish()};var onfinish=function(){s=false;if(!a)r.call(e)};var onend=function(){a=false;if(!s)r.call(e)};var onexit=function(t){r.call(e,t?new Error("exited with error code: "+t):null)};var onerror=function(t){r.call(e,t)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(u)return;if(a&&!(o&&(o.ended&&!o.destroyed)))return r.call(e,new Error("premature close"));if(s&&!(n&&(n.ended&&!n.destroyed)))return r.call(e,new Error("premature close"))};var onrequest=function(){e.req.on("finish",onfinish)};if(isRequest(e)){e.on("complete",onfinish);e.on("abort",onclose);if(e.req)onrequest();else e.on("request",onrequest)}else if(s&&!n){e.on("end",onlegacyfinish);e.on("close",onlegacyfinish)}if(isChildProcess(e))e.on("exit",onexit);e.on("end",onend);e.on("finish",onfinish);if(t.error!==false)e.on("error",onerror);e.on("close",onclose);return function(){u=true;e.removeListener("complete",onfinish);e.removeListener("abort",onclose);e.removeListener("request",onrequest);if(e.req)e.req.removeListener("finish",onfinish);e.removeListener("end",onlegacyfinish);e.removeListener("close",onlegacyfinish);e.removeListener("finish",onfinish);e.removeListener("exit",onexit);e.removeListener("end",onend);e.removeListener("error",onerror);e.removeListener("close",onclose)}};e.exports=eos},5010:function(e,t,r){var i=r(7147);var n=r(3837);var o=r(2781);var a=o.Readable;var s=o.Writable;var u=o.PassThrough;var l=r(4833);var c=r(2361).EventEmitter;t.createFromBuffer=createFromBuffer;t.createFromFd=createFromFd;t.BufferSlicer=BufferSlicer;t.FdSlicer=FdSlicer;n.inherits(FdSlicer,c);function FdSlicer(e,t){t=t||{};c.call(this);this.fd=e;this.pend=new l;this.pend.max=1;this.refCount=0;this.autoClose=!!t.autoClose}FdSlicer.prototype.read=function(e,t,r,n,o){var a=this;a.pend.go((function(s){i.read(a.fd,e,t,r,n,(function(e,t,r){s();o(e,t,r)}))}))};FdSlicer.prototype.write=function(e,t,r,n,o){var a=this;a.pend.go((function(s){i.write(a.fd,e,t,r,n,(function(e,t,r){s();o(e,t,r)}))}))};FdSlicer.prototype.createReadStream=function(e){return new ReadStream(this,e)};FdSlicer.prototype.createWriteStream=function(e){return new WriteStream(this,e)};FdSlicer.prototype.ref=function(){this.refCount+=1};FdSlicer.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");if(e.autoClose){i.close(e.fd,onCloseDone)}function onCloseDone(t){if(t){e.emit("error",t)}else{e.emit("close")}}};n.inherits(ReadStream,a);function ReadStream(e,t){t=t||{};a.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end;this.pos=this.start;this.destroyed=false}ReadStream.prototype._read=function(e){var t=this;if(t.destroyed)return;var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null){r=Math.min(r,t.endOffset-t.pos)}if(r<=0){t.destroyed=true;t.push(null);t.context.unref();return}t.context.pend.go((function(e){if(t.destroyed)return e();var n=new Buffer(r);i.read(t.context.fd,n,0,r,t.pos,(function(r,i){if(r){t.destroy(r)}else if(i===0){t.destroyed=true;t.push(null);t.context.unref()}else{t.pos+=i;t.push(n.slice(0,i))}e()}))}))};ReadStream.prototype.destroy=function(e){if(this.destroyed)return;e=e||new Error("stream destroyed");this.destroyed=true;this.emit("error",e);this.context.unref()};n.inherits(WriteStream,s);function WriteStream(e,t){t=t||{};s.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end==null?Infinity:+t.end;this.bytesWritten=0;this.pos=this.start;this.destroyed=false;this.on("finish",this.destroy.bind(this))}WriteStream.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return;if(n.pos+e.length>n.endOffset){var o=new Error("maximum file length exceeded");o.code="ETOOBIG";n.destroy();r(o);return}n.context.pend.go((function(t){if(n.destroyed)return t();i.write(n.context.fd,e,0,e.length,n.pos,(function(e,i){if(e){n.destroy();t();r(e)}else{n.bytesWritten+=i;n.pos+=i;n.emit("progress");t();r()}}))}))};WriteStream.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this.context.unref()};n.inherits(BufferSlicer,c);function BufferSlicer(e,t){c.call(this);t=t||{};this.refCount=0;this.buffer=e;this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}BufferSlicer.prototype.read=function(e,t,r,i,n){var o=i+r;var a=o-this.buffer.length;var s=a>0?a:r;this.buffer.copy(e,t,i,o);setImmediate((function(){n(null,s)}))};BufferSlicer.prototype.write=function(e,t,r,i,n){e.copy(this.buffer,i,t,t+r);setImmediate((function(){n(null,r,e)}))};BufferSlicer.prototype.createReadStream=function(e){e=e||{};var t=new u(e);t.destroyed=false;t.start=e.start||0;t.endOffset=e.end;t.pos=t.endOffset||this.buffer.length;var r=this.buffer.slice(t.start,t.pos);var i=0;while(true){var n=i+this.maxChunkSize;if(n>=r.length){if(i<r.length){t.write(r.slice(i,r.length))}break}t.write(r.slice(i,n));i=n}t.end();t.destroy=function(){t.destroyed=true};return t};BufferSlicer.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new s(e);r.start=e.start||0;r.endOffset=e.end==null?this.buffer.length:+e.end;r.bytesWritten=0;r.pos=r.start;r.destroyed=false;r._write=function(e,i,n){if(r.destroyed)return;var o=r.pos+e.length;if(o>r.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG";r.destroyed=true;n(a);return}e.copy(t.buffer,r.pos,0,e.length);r.bytesWritten+=e.length;r.pos=o;r.emit("progress");n()};r.destroy=function(){r.destroyed=true};return r};BufferSlicer.prototype.ref=function(){this.refCount+=1};BufferSlicer.prototype.unref=function(){this.refCount-=1;if(this.refCount<0){throw new Error("invalid unref")}};function createFromBuffer(e,t){return new BufferSlicer(e,t)}function createFromFd(e,t){return new FdSlicer(e,t)}},7128:function(e){"use strict";e.exports=function(e){if(!(e&&e.length>1)){return null}if(e[0]===255&&e[1]===216&&e[2]===255){return{ext:"jpg",mime:"image/jpeg"}}if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71){return{ext:"png",mime:"image/png"}}if(e[0]===71&&e[1]===73&&e[2]===70){return{ext:"gif",mime:"image/gif"}}if(e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80){return{ext:"webp",mime:"image/webp"}}if(e[0]===70&&e[1]===76&&e[2]===73&&e[3]===70){return{ext:"flif",mime:"image/flif"}}if((e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42)&&e[8]===67&&e[9]===82){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42){return{ext:"tif",mime:"image/tiff"}}if(e[0]===66&&e[1]===77){return{ext:"bmp",mime:"image/bmp"}}if(e[0]===73&&e[1]===73&&e[2]===188){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(e[0]===56&&e[1]===66&&e[2]===80&&e[3]===83){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===109&&e[31]===105&&e[32]===109&&e[33]===101&&e[34]===116&&e[35]===121&&e[36]===112&&e[37]===101&&e[38]===97&&e[39]===112&&e[40]===112&&e[41]===108&&e[42]===105&&e[43]===99&&e[44]===97&&e[45]===116&&e[46]===105&&e[47]===111&&e[48]===110&&e[49]===47&&e[50]===101&&e[51]===112&&e[52]===117&&e[53]===98&&e[54]===43&&e[55]===122&&e[56]===105&&e[57]===112){return{ext:"epub",mime:"application/epub+zip"}}if(e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===77&&e[31]===69&&e[32]===84&&e[33]===65&&e[34]===45&&e[35]===73&&e[36]===78&&e[37]===70&&e[38]===47&&e[39]===109&&e[40]===111&&e[41]===122&&e[42]===105&&e[43]===108&&e[44]===108&&e[45]===97&&e[46]===46&&e[47]===114&&e[48]===115&&e[49]===97){return{ext:"xpi",mime:"application/x-xpinstall"}}if(e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)){return{ext:"zip",mime:"application/zip"}}if(e[257]===117&&e[258]===115&&e[259]===116&&e[260]===97&&e[261]===114){return{ext:"tar",mime:"application/x-tar"}}if(e[0]===82&&e[1]===97&&e[2]===114&&e[3]===33&&e[4]===26&&e[5]===7&&(e[6]===0||e[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(e[0]===31&&e[1]===139&&e[2]===8){return{ext:"gz",mime:"application/gzip"}}if(e[0]===66&&e[1]===90&&e[2]===104){return{ext:"bz2",mime:"application/x-bzip2"}}if(e[0]===55&&e[1]===122&&e[2]===188&&e[3]===175&&e[4]===39&&e[5]===28){return{ext:"7z",mime:"application/x-7z-compressed"}}if(e[0]===120&&e[1]===1){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(e[0]===0&&e[1]===0&&e[2]===0&&(e[3]===24||e[3]===32)&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112||e[0]===51&&e[1]===103&&e[2]===112&&e[3]===53||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[16]===109&&e[17]===112&&e[18]===52&&e[19]===49&&e[20]===109&&e[21]===112&&e[22]===52&&e[23]===50&&e[24]===105&&e[25]===115&&e[26]===111&&e[27]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===105&&e[9]===115&&e[10]===111&&e[11]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===0){return{ext:"mp4",mime:"video/mp4"}}if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===86){return{ext:"m4v",mime:"video/x-m4v"}}if(e[0]===77&&e[1]===84&&e[2]===104&&e[3]===100){return{ext:"mid",mime:"audio/midi"}}if(e[31]===109&&e[32]===97&&e[33]===116&&e[34]===114&&e[35]===111&&e[36]===115&&e[37]===107&&e[38]===97){return{ext:"mkv",mime:"video/x-matroska"}}if(e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163){return{ext:"webm",mime:"video/webm"}}if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===20&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112){return{ext:"mov",mime:"video/quicktime"}}if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===65&&e[9]===86&&e[10]===73){return{ext:"avi",mime:"video/x-msvideo"}}if(e[0]===48&&e[1]===38&&e[2]===178&&e[3]===117&&e[4]===142&&e[5]===102&&e[6]===207&&e[7]===17&&e[8]===166&&e[9]===217){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(e[0]===0&&e[1]===0&&e[2]===1&&e[3].toString(16)[0]==="b"){return{ext:"mpg",mime:"video/mpeg"}}if(e[0]===73&&e[1]===68&&e[2]===51||e[0]===255&&e[1]===251){return{ext:"mp3",mime:"audio/mpeg"}}if(e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===65||e[0]===77&&e[1]===52&&e[2]===65&&e[3]===32){return{ext:"m4a",mime:"audio/m4a"}}if(e[28]===79&&e[29]===112&&e[30]===117&&e[31]===115&&e[32]===72&&e[33]===101&&e[34]===97&&e[35]===100){return{ext:"opus",mime:"audio/opus"}}if(e[0]===79&&e[1]===103&&e[2]===103&&e[3]===83){return{ext:"ogg",mime:"audio/ogg"}}if(e[0]===102&&e[1]===76&&e[2]===97&&e[3]===67){return{ext:"flac",mime:"audio/x-flac"}}if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===65&&e[10]===86&&e[11]===69){return{ext:"wav",mime:"audio/x-wav"}}if(e[0]===35&&e[1]===33&&e[2]===65&&e[3]===77&&e[4]===82&&e[5]===10){return{ext:"amr",mime:"audio/amr"}}if(e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70){return{ext:"pdf",mime:"application/pdf"}}if(e[0]===77&&e[1]===90){return{ext:"exe",mime:"application/x-msdownload"}}if((e[0]===67||e[0]===70)&&e[1]===87&&e[2]===83){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(e[0]===123&&e[1]===92&&e[2]===114&&e[3]===116&&e[4]===102){return{ext:"rtf",mime:"application/rtf"}}if(e[0]===119&&e[1]===79&&e[2]===70&&e[3]===70&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)){return{ext:"woff",mime:"application/font-woff"}}if(e[0]===119&&e[1]===79&&e[2]===70&&e[3]===50&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)){return{ext:"woff2",mime:"application/font-woff"}}if(e[34]===76&&e[35]===80&&(e[8]===0&&e[9]===0&&e[10]===1||e[8]===1&&e[9]===0&&e[10]===2||e[8]===2&&e[9]===0&&e[10]===2)){return{ext:"eot",mime:"application/octet-stream"}}if(e[0]===0&&e[1]===1&&e[2]===0&&e[3]===0&&e[4]===0){return{ext:"ttf",mime:"application/font-sfnt"}}if(e[0]===79&&e[1]===84&&e[2]===84&&e[3]===79&&e[4]===0){return{ext:"otf",mime:"application/font-sfnt"}}if(e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0){return{ext:"ico",mime:"image/x-icon"}}if(e[0]===70&&e[1]===76&&e[2]===86&&e[3]===1){return{ext:"flv",mime:"video/x-flv"}}if(e[0]===37&&e[1]===33){return{ext:"ps",mime:"application/postscript"}}if(e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0){return{ext:"xz",mime:"application/x-xz"}}if(e[0]===83&&e[1]===81&&e[2]===76&&e[3]===105){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(e[0]===78&&e[1]===69&&e[2]===83&&e[3]===26){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(e[0]===67&&e[1]===114&&e[2]===50&&e[3]===52){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(e[0]===77&&e[1]===83&&e[2]===67&&e[3]===70||e[0]===73&&e[1]===83&&e[2]===99&&e[3]===40){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62&&e[7]===10&&e[8]===100&&e[9]===101&&e[10]===98&&e[11]===105&&e[12]===97&&e[13]===110&&e[14]===45&&e[15]===98&&e[16]===105&&e[17]===110&&e[18]===97&&e[19]===114&&e[20]===121){return{ext:"deb",mime:"application/x-deb"}}if(e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62){return{ext:"ar",mime:"application/x-unix-archive"}}if(e[0]===237&&e[1]===171&&e[2]===238&&e[3]===219){return{ext:"rpm",mime:"application/x-rpm"}}if(e[0]===31&&e[1]===160||e[0]===31&&e[1]===157){return{ext:"Z",mime:"application/x-compress"}}if(e[0]===76&&e[1]===90&&e[2]===73&&e[3]===80){return{ext:"lz",mime:"application/x-lzip"}}if(e[0]===208&&e[1]===207&&e[2]===17&&e[3]===224&&e[4]===161&&e[5]===177&&e[6]===26&&e[7]===225){return{ext:"msi",mime:"application/x-msi"}}return null}},3186:function(e,t,r){e.exports=r(7147).constants||r(2057)},7356:function(e){"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},7758:function(e,t,r){var i=r(7147);var n=r(263);var o=r(3086);var a=r(7356);var s=r(3837);var u;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,u,{get:function(){return t}})}var c=noop;if(s.debuglog)c=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))c=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!i[u]){var d=global[u]||[];publishQueue(i,d);i.close=function(e){function close(t,r){return e.call(i,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(i.close);i.closeSync=function(e){function closeSync(t){e.apply(i,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(i.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){c(i[u]);r(9491).equal(i[u].length,0)}))}}if(!global[u]){publishQueue(global,i[u])}e.exports=patch(a(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched){e.exports=patch(i);i.__patched=true}function patch(e){n(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,i){if(typeof r==="function")i=r,r=null;return go$readFile(e,r,i);function go$readFile(e,r,i,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,i],t,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,i,n){if(typeof i==="function")n=i,i=null;return go$writeFile(e,t,i,n);function go$writeFile(e,t,i,n,o){return r(e,t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,i,n],r,o||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var i=e.appendFile;if(i)e.appendFile=appendFile;function appendFile(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$appendFile(e,t,r,n);function go$appendFile(e,t,r,n,o){return i(e,t,r,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,n],i,o||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.copyFile;if(a)e.copyFile=copyFile;function copyFile(e,t,r,i){if(typeof r==="function"){i=r;r=0}return go$copyFile(e,t,r,i);function go$copyFile(e,t,r,i,n){return a(e,t,r,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,i],o,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var s=e.readdir;e.readdir=readdir;var u=/^v[0-5]\./;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;var i=u.test(process.version)?function go$readdir(e,t,r,i){return s(e,fs$readdirCallback(e,t,r,i))}:function go$readdir(e,t,r,i){return s(e,t,fs$readdirCallback(e,t,r,i))};return i(e,t,r);function fs$readdirCallback(e,t,r,n){return function(o,a){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([i,[e,t,r],o,n||Date.now(),Date.now()]);else{if(a&&a.sort)a.sort();if(typeof r==="function")r.call(this,o,a)}}}}if(process.version.substr(0,4)==="v0.8"){var l=o(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var c=e.ReadStream;if(c){ReadStream.prototype=Object.create(c.prototype);ReadStream.prototype.open=ReadStream$open}var d=e.WriteStream;if(d){WriteStream.prototype=Object.create(d.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var p=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return c.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return d.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var m=e.open;e.open=open;function open(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$open(e,t,r,i);function go$open(e,t,r,i,n){return m(e,t,r,(function(o,a){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$open,[e,t,r,i],o,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}return e}function enqueue(e){c("ENQUEUE",e[0].name,e[1]);i[u].push(e);retry()}var p;function resetQueue(){var e=Date.now();for(var t=0;t<i[u].length;++t){if(i[u][t].length>2){i[u][t][3]=e;i[u][t][4]=e}}retry()}function retry(){clearTimeout(p);p=undefined;if(i[u].length===0)return;var e=i[u].shift();var t=e[0];var r=e[1];var n=e[2];var o=e[3];var a=e[4];if(o===undefined){c("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-o>=6e4){c("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,n)}else{var l=Date.now()-a;var d=Math.max(a-o,1);var h=Math.min(d*1.2,100);if(l>=h){c("RETRY",t.name,r);t.apply(null,r.concat([o]))}else{i[u].push(e)}}if(p===undefined){p=setTimeout(retry,0)}}},3086:function(e,t,r){var i=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);i.call(this);var n=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var o=Object.keys(r);for(var a=0,s=o.length;a<s;a++){var u=o[a];this[u]=r[u]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){n.emit("error",e);n.readable=false;return}n.fd=t;n.emit("open",t);n._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);i.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var n=Object.keys(r);for(var o=0,a=n.length;o<a;o++){var s=n[o];this[s]=r[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:function(e,t,r){var i=r(2057);var n=process.cwd;var o=null;var a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!o)o=n.call(process);return o};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(e){o=null;s.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}e.exports=patch;function patch(e){if(i.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,r,i){if(i)process.nextTick(i)};e.lchownSync=function(){}}if(a==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(r,i,n){var o=Date.now();var a=0;t(r,i,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM"||s.code==="EBUSY")&&Date.now()-o<6e4){setTimeout((function(){e.stat(i,(function(e,o){if(e&&e.code==="ENOENT")t(r,i,CB);else n(s)}))}),a);if(a<100)a+=10;return}if(n)n(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(r,i,n,o,a,s){var u;if(s&&typeof s==="function"){var l=0;u=function(c,d,p){if(c&&c.code==="EAGAIN"&&l<10){l++;return t.call(e,r,i,n,o,a,u)}s.apply(this,arguments)}}return t.call(e,r,i,n,o,a,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(r,i,n,o,a){var s=0;while(true){try{return t.call(e,r,i,n,o,a)}catch(e){if(e.code==="EAGAIN"&&s<10){s++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,n){e.open(t,i.O_WRONLY|i.O_SYMLINK,r,(function(t,i){if(t){if(n)n(t);return}e.fchmod(i,r,(function(t){e.close(i,(function(e){if(n)n(t||e)}))}))}))};e.lchmodSync=function(t,r){var n=e.openSync(t,i.O_WRONLY|i.O_SYMLINK,r);var o=true;var a;try{a=e.fchmodSync(n,r);o=false}finally{if(o){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return a}}function patchLutimes(e){if(i.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,r,n,o){e.open(t,i.O_SYMLINK,(function(t,i){if(t){if(o)o(t);return}e.futimes(i,r,n,(function(t){e.close(i,(function(e){if(o)o(t||e)}))}))}))};e.lutimesSync=function(t,r,n){var o=e.openSync(t,i.O_SYMLINK);var a;var s=true;try{a=e.futimesSync(o,r,n);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return a}}else if(e.futimes){e.lutimes=function(e,t,r,i){if(i)process.nextTick(i)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,i,n){return t.call(e,r,i,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,i){try{return t.call(e,r,i)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,i,n,o){return t.call(e,r,i,n,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,i,n){try{return t.call(e,r,i,n)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,i,n){if(typeof i==="function"){n=i;i=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(n)n.apply(this,arguments)}return i?t.call(e,r,i,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,i){var n=i?t.call(e,r,i):t.call(e,r);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},4124:function(e,t,r){try{var i=r(3837);if(typeof i.inherits!=="function")throw"";e.exports=i.inherits}catch(t){e.exports=r(8544)}},8544:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},3316:function(e){"use strict";
1
+ (function(){var e={6726:function(e){function allocUnsafe(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}if(e<0){throw new RangeError('"size" argument must not be negative')}if(Buffer.allocUnsafe){return Buffer.allocUnsafe(e)}else{return new Buffer(e)}}e.exports=allocUnsafe},6615:function(e,t,r){var i=r(2852);var n=r(6726);e.exports=function alloc(e,t,r){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}if(e<0){throw new RangeError('"size" argument must not be negative')}if(Buffer.alloc){return Buffer.alloc(e,t,r)}var o=n(e);if(e===0){return o}if(t===undefined){return i(o,0)}if(typeof r!=="string"){r=undefined}return i(o,t,r)}},4794:function(e,t,r){var i=r(4300).Buffer;var n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){n=new Int32Array(n)}function ensureBuffer(e){if(i.isBuffer(e)){return e}var t=typeof i.alloc==="function"&&typeof i.from==="function";if(typeof e==="number"){return t?i.alloc(e):new i(e)}else if(typeof e==="string"){return t?i.from(e):new i(e)}else{throw new Error("input must be buffer, number, or string, received "+typeof e)}}function bufferizeInt(e){var t=ensureBuffer(4);t.writeInt32BE(e,0);return t}function _crc32(e,t){e=ensureBuffer(e);if(i.isBuffer(t)){t=t.readUInt32BE(0)}var r=~~t^-1;for(var o=0;o<e.length;o++){r=n[(r^e[o])&255]^r>>>8}return r^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};e.exports=crc32},2852:function(e){var t=function(){try{if(!Buffer.isEncoding("latin1")){return false}var e=Buffer.alloc?Buffer.alloc(4):new Buffer(4);e.fill("ab","ucs2");return e.toString("hex")==="61006200"}catch(e){return false}}();function isSingleByte(e){return e.length===1&&e.charCodeAt(0)<256}function fillWithNumber(e,t,r,i){if(r<0||i>e.length){throw new RangeError("Out of range index")}r=r>>>0;i=i===undefined?e.length:i>>>0;if(i>r){e.fill(t,r,i)}return e}function fillWithBuffer(e,t,r,i){if(r<0||i>e.length){throw new RangeError("Out of range index")}if(i<=r){return e}r=r>>>0;i=i===undefined?e.length:i>>>0;var n=r;var o=t.length;while(n<=i-o){t.copy(e,n);n+=o}if(n!==i){t.copy(e,n,0,i-n)}return e}function fill(e,r,i,n,o){if(t){return e.fill(r,i,n,o)}if(typeof r==="number"){return fillWithNumber(e,r,i,n)}if(typeof r==="string"){if(typeof i==="string"){o=i;i=0;n=e.length}else if(typeof n==="string"){o=n;n=e.length}if(o!==undefined&&typeof o!=="string"){throw new TypeError("encoding must be a string")}if(o==="latin1"){o="binary"}if(typeof o==="string"&&!Buffer.isEncoding(o)){throw new TypeError("Unknown encoding: "+o)}if(r===""){return fillWithNumber(e,0,i,n)}if(isSingleByte(r)){return fillWithNumber(e,r.charCodeAt(0),i,n)}r=new Buffer(r,o)}if(Buffer.isBuffer(r)){return fillWithBuffer(e,r,i,n)}return fillWithNumber(e,0,i,n)}e.exports=fill},5898:function(e,t,r){function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=r(4300).Buffer.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}},3235:function(e,t,r){"use strict";const i=r(8300);const n=r(1554);const o=r(2283);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!n(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!i(e)||i(e).ext!=="tar")){return Promise.resolve([])}const t=o.extract();const r=[];t.on("entry",((e,t,i)=>{const n=[];t.on("data",(e=>n.push(e)));t.on("end",(()=>{const t={data:Buffer.concat(n),mode:e.mode,mtime:e.mtime,path:e.name,type:e.type};if(e.type==="symlink"||e.type==="link"){t.linkname=e.linkname}r.push(t);i()}))}));const a=new Promise(((i,n)=>{if(!Buffer.isBuffer(e)){e.on("error",n)}t.on("finish",(()=>i(r)));t.on("error",n)}));t.then=a.then.bind(a);t.catch=a.catch.bind(a);if(Buffer.isBuffer(e)){t.end(e)}else{e.pipe(t)}return t}},8300:function(e){"use strict";e.exports=e=>{const t=new Uint8Array(e);if(!(t&&t.length>1)){return null}const check=(e,r)=>{r=Object.assign({offset:0},r);for(let i=0;i<e.length;i++){if(e[i]!==t[i+r.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])&&check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check([80,75,3,4])&&check([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(t[6]===0||t[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([0,0,0])&&(t[3]===24||t[3]===32)&&check([102,116,121,112],{offset:4})||check([51,103,112,53])||check([0,0,0,28,102,116,121,112,109,112,52,50])&&check([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||check([0,0,0,28,102,116,121,112,105,115,111,109])||check([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0])){return{ext:"mp4",mime:"video/mp4"}}if(check([0,0,0,28,102,116,121,112,77,52,86])){return{ext:"m4v",mime:"video/x-m4v"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=t.subarray(4,4+4096);const r=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(r>=0){const t=r+3;const findDocType=r=>Array.from(r).every(((r,i)=>e[t+i]===r.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}if(check([73,68,51])||check([255,251])){return{ext:"mp3",mime:"audio/mpeg"}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((t[0]===67||t[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},2454:function(e,t,r){"use strict";const i=r(3235);const n=r(8688);const o=r(1554);const a=r(9562);const s=r(3467);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!o(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!n(e)||n(e).ext!=="bz2")){return Promise.resolve([])}if(Buffer.isBuffer(e)){return i()(a.decode(e))}return i()(e.pipe(s()))}},8688:function(e){"use strict";const toBytes=e=>Array.from(e).map((e=>e.charCodeAt(0)));const t=toBytes("META-INF/mozilla.rsa");const r=toBytes("[Content_Types].xml");const i=toBytes("_rels/.rels");e.exports=e=>{const n=new Uint8Array(e);if(!(n&&n.length>1)){return null}const check=(e,t)=>{t=Object.assign({offset:0},t);for(let r=0;r<e.length;r++){if(t.mask){if(e[r]!==(t.mask[r]&n[r+t.offset])){return false}}else if(e[r]!==n[r+t.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])){if(check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check(t,{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check(r,{offset:30})||check(i,{offset:30})){const e=n.subarray(4,4+2e3);const nextZipHeaderIndex=e=>e.findIndex(((e,t,r)=>r[t]===80&&r[t+1]===75&&r[t+2]===3&&r[t+3]===4));const t=nextZipHeaderIndex(e);if(t!==-1){const e=n.subarray(t+8,t+8+1e3);const r=nextZipHeaderIndex(e);if(r!==-1){const e=8+t+r+30;if(check(toBytes("word/"),{offset:e})){return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}}if(check(toBytes("ppt/"),{offset:e})){return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}if(check(toBytes("xl/"),{offset:e})){return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}}}if(check([80,75])&&(n[2]===3||n[2]===5||n[2]===7)&&(n[3]===4||n[3]===6||n[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(n[6]===0||n[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([51,103,112,53])||check([0,0,0])&&check([102,116,121,112],{offset:4})&&(check([109,112,52,49],{offset:8})||check([109,112,52,50],{offset:8})||check([105,115,111,109],{offset:8})||check([105,115,111,50],{offset:8})||check([109,109,112,52],{offset:8})||check([77,52,86],{offset:8})||check([100,97,115,104],{offset:8}))){return{ext:"mp4",mime:"video/mp4"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=n.subarray(4,4+4096);const t=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(t!==-1){const r=t+3;const findDocType=t=>Array.from(t).every(((t,i)=>e[r+i]===t.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}for(let e=0;e<2&&e<n.length-16;e++){if(check([73,68,51],{offset:e})||check([255,226],{offset:e,mask:[255,226]})){return{ext:"mp3",mime:"audio/mpeg"}}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((n[0]===67||n[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},7335:function(e,t,r){"use strict";const i=r(9796);const n=r(3235);const o=r(1608);const a=r(1554);e.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!a(e)){return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`))}if(Buffer.isBuffer(e)&&(!o(e)||o(e).ext!=="gz")){return Promise.resolve([])}const t=i.createGunzip();const r=n()(t);if(Buffer.isBuffer(e)){t.end(e)}else{e.pipe(t)}return r}},1608:function(e){"use strict";e.exports=e=>{const t=new Uint8Array(e);if(!(t&&t.length>1)){return null}const check=(e,r)=>{r=Object.assign({offset:0},r);for(let i=0;i<e.length;i++){if(e[i]!==t[i+r.offset]){return false}}return true};if(check([255,216,255])){return{ext:"jpg",mime:"image/jpeg"}}if(check([137,80,78,71,13,10,26,10])){return{ext:"png",mime:"image/png"}}if(check([71,73,70])){return{ext:"gif",mime:"image/gif"}}if(check([87,69,66,80],{offset:8})){return{ext:"webp",mime:"image/webp"}}if(check([70,76,73,70])){return{ext:"flif",mime:"image/flif"}}if((check([73,73,42,0])||check([77,77,0,42]))&&check([67,82],{offset:8})){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(check([73,73,42,0])||check([77,77,0,42])){return{ext:"tif",mime:"image/tiff"}}if(check([66,77])){return{ext:"bmp",mime:"image/bmp"}}if(check([73,73,188])){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(check([56,66,80,83])){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(check([80,75,3,4])&&check([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30})){return{ext:"epub",mime:"application/epub+zip"}}if(check([80,75,3,4])&&check([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30})){return{ext:"xpi",mime:"application/x-xpinstall"}}if(check([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8)){return{ext:"zip",mime:"application/zip"}}if(check([117,115,116,97,114],{offset:257})){return{ext:"tar",mime:"application/x-tar"}}if(check([82,97,114,33,26,7])&&(t[6]===0||t[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(check([31,139,8])){return{ext:"gz",mime:"application/gzip"}}if(check([66,90,104])){return{ext:"bz2",mime:"application/x-bzip2"}}if(check([55,122,188,175,39,28])){return{ext:"7z",mime:"application/x-7z-compressed"}}if(check([120,1])){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(check([0,0,0])&&(t[3]===24||t[3]===32)&&check([102,116,121,112],{offset:4})||check([51,103,112,53])||check([0,0,0,28,102,116,121,112,109,112,52,50])&&check([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||check([0,0,0,28,102,116,121,112,105,115,111,109])||check([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0])){return{ext:"mp4",mime:"video/mp4"}}if(check([0,0,0,28,102,116,121,112,77,52,86])){return{ext:"m4v",mime:"video/x-m4v"}}if(check([77,84,104,100])){return{ext:"mid",mime:"audio/midi"}}if(check([26,69,223,163])){const e=t.subarray(4,4+4096);const r=e.findIndex(((e,t,r)=>r[t]===66&&r[t+1]===130));if(r>=0){const t=r+3;const findDocType=r=>Array.from(r).every(((r,i)=>e[t+i]===r.charCodeAt(0)));if(findDocType("matroska")){return{ext:"mkv",mime:"video/x-matroska"}}if(findDocType("webm")){return{ext:"webm",mime:"video/webm"}}}}if(check([0,0,0,20,102,116,121,112,113,116,32,32])||check([102,114,101,101],{offset:4})||check([102,116,121,112,113,116,32,32],{offset:4})||check([109,100,97,116],{offset:4})||check([119,105,100,101],{offset:4})){return{ext:"mov",mime:"video/quicktime"}}if(check([82,73,70,70])&&check([65,86,73],{offset:8})){return{ext:"avi",mime:"video/x-msvideo"}}if(check([48,38,178,117,142,102,207,17,166,217])){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(check([0,0,1,186])){return{ext:"mpg",mime:"video/mpeg"}}if(check([73,68,51])||check([255,251])){return{ext:"mp3",mime:"audio/mpeg"}}if(check([102,116,121,112,77,52,65],{offset:4})||check([77,52,65,32])){return{ext:"m4a",mime:"audio/m4a"}}if(check([79,112,117,115,72,101,97,100],{offset:28})){return{ext:"opus",mime:"audio/opus"}}if(check([79,103,103,83])){return{ext:"ogg",mime:"audio/ogg"}}if(check([102,76,97,67])){return{ext:"flac",mime:"audio/x-flac"}}if(check([82,73,70,70])&&check([87,65,86,69],{offset:8})){return{ext:"wav",mime:"audio/x-wav"}}if(check([35,33,65,77,82,10])){return{ext:"amr",mime:"audio/amr"}}if(check([37,80,68,70])){return{ext:"pdf",mime:"application/pdf"}}if(check([77,90])){return{ext:"exe",mime:"application/x-msdownload"}}if((t[0]===67||t[0]===70)&&check([87,83],{offset:1})){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(check([123,92,114,116,102])){return{ext:"rtf",mime:"application/rtf"}}if(check([0,97,115,109])){return{ext:"wasm",mime:"application/wasm"}}if(check([119,79,70,70])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff",mime:"font/woff"}}if(check([119,79,70,50])&&(check([0,1,0,0],{offset:4})||check([79,84,84,79],{offset:4}))){return{ext:"woff2",mime:"font/woff2"}}if(check([76,80],{offset:34})&&(check([0,0,1],{offset:8})||check([1,0,2],{offset:8})||check([2,0,2],{offset:8}))){return{ext:"eot",mime:"application/octet-stream"}}if(check([0,1,0,0,0])){return{ext:"ttf",mime:"font/ttf"}}if(check([79,84,84,79,0])){return{ext:"otf",mime:"font/otf"}}if(check([0,0,1,0])){return{ext:"ico",mime:"image/x-icon"}}if(check([70,76,86,1])){return{ext:"flv",mime:"video/x-flv"}}if(check([37,33])){return{ext:"ps",mime:"application/postscript"}}if(check([253,55,122,88,90,0])){return{ext:"xz",mime:"application/x-xz"}}if(check([83,81,76,105])){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(check([78,69,83,26])){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(check([67,114,50,52])){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(check([77,83,67,70])||check([73,83,99,40])){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(check([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])){return{ext:"deb",mime:"application/x-deb"}}if(check([33,60,97,114,99,104,62])){return{ext:"ar",mime:"application/x-unix-archive"}}if(check([237,171,238,219])){return{ext:"rpm",mime:"application/x-rpm"}}if(check([31,160])||check([31,157])){return{ext:"Z",mime:"application/x-compress"}}if(check([76,90,73,80])){return{ext:"lz",mime:"application/x-lzip"}}if(check([208,207,17,224,161,177,26,225])){return{ext:"msi",mime:"application/x-msi"}}if(check([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){return{ext:"mxf",mime:"application/mxf"}}if(check([71],{offset:4})&&(check([71],{offset:192})||check([71],{offset:196}))){return{ext:"mts",mime:"video/mp2t"}}if(check([66,76,69,78,68,69,82])){return{ext:"blend",mime:"application/x-blender"}}if(check([66,80,71,251])){return{ext:"bpg",mime:"image/bpg"}}return null}},8396:function(e,t,r){"use strict";const i=r(7128);const n=r(8771);const o=r(126);const a=r(8781);const getType=(e,t)=>{const r=61440;const i=16384;const n=40960;const o=e.versionMadeBy>>8;if((t&r)===n){return"symlink"}if((t&r)===i||o===0&&e.externalFileAttributes===16){return"directory"}return"file"};const extractEntry=(e,t)=>{const r={mode:e.externalFileAttributes>>16&65535,mtime:e.getLastModDate(),path:e.fileName};r.type=getType(e,r.mode);if(r.mode===0&&r.type==="directory"){r.mode=493}if(r.mode===0){r.mode=420}return o(t.openReadStream.bind(t))(e).then(n.buffer).then((e=>{r.data=e;if(r.type==="symlink"){r.linkname=e.toString()}return r})).catch((e=>{t.close();throw e}))};const extractFile=e=>new Promise(((t,r)=>{const i=[];e.readEntry();e.on("entry",(t=>{extractEntry(t,e).catch(r).then((t=>{i.push(t);e.readEntry()}))}));e.on("error",r);e.on("end",(()=>t(i)))}));e.exports=()=>e=>{if(!Buffer.isBuffer(e)){return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof e}`))}if(!i(e)||i(e).ext!=="zip"){return Promise.resolve([])}return o(a.fromBuffer)(e,{lazyEntries:true}).then(extractFile)}},7420:function(e,t,r){var i=r(2781).PassThrough;var n=r(7426);e.exports=function(e){e=n({},e);var t=e.array;var r=e.encoding;var o=r==="buffer";var a=false;if(t){a=!(r||o)}else{r=r||"utf8"}if(o){r=null}var s=0;var u=[];var l=new i({objectMode:a});if(r){l.setEncoding(r)}l.on("data",(function(e){u.push(e);if(a){s=u.length}else{s+=e.length}}));l.getBufferedValue=function(){if(t){return u}return o?Buffer.concat(u,s):u.join("")};l.getBufferedLength=function(){return s};return l}},8771:function(e,t,r){"use strict";var i=r(5222);var n=r(7426);var o=r(7420);function getStream(e,t){if(!e){return i.reject(new Error("Expected a stream"))}t=n({maxBuffer:Infinity},t);var r=t.maxBuffer;var a;var s;var u=new i((function(i,n){a=o(t);e.once("error",error);e.pipe(a);a.on("data",(function(){if(a.getBufferedLength()>r){n(new Error("maxBuffer exceeded"))}}));a.once("error",error);a.on("end",i);s=function(){if(e.unpipe){e.unpipe(a)}};function error(e){if(e){e.bufferedData=a.getBufferedValue()}n(e)}}));u.then(s,s);return u.then((function(){return a.getBufferedValue()}))}e.exports=getStream;e.exports.buffer=function(e,t){return getStream(e,n({},t,{encoding:"buffer"}))};e.exports.array=function(e,t){return getStream(e,n({},t,{array:true}))}},126:function(e){"use strict";var processFn=function(e,t,r){return function(){var i=this;var n=new Array(arguments.length);for(var o=0;o<arguments.length;o++){n[o]=arguments[o]}return new t((function(t,o){n.push((function(e,i){if(e){o(e)}else if(r.multiArgs){var n=new Array(arguments.length-1);for(var a=1;a<arguments.length;a++){n[a-1]=arguments[a]}t(n)}else{t(i)}}));e.apply(i,n)}))}};var t=e.exports=function(e,t,r){if(typeof t!=="function"){r=t;t=Promise}r=r||{};r.exclude=r.exclude||[/.+Sync$/];var filter=function(e){var match=function(t){return typeof t==="string"?e===t:t.test(e)};return r.include?r.include.some(match):!r.exclude.some(match)};var i=typeof e==="function"?function(){if(r.excludeMain){return e.apply(this,arguments)}return processFn(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce((function(i,n){var o=e[n];i[n]=typeof o==="function"&&filter(n)?processFn(o,t,r):o;return i}),i)};t.all=t},9350:function(e,t,r){"use strict";const i=r(1017);const n=r(7758);const o=r(3235);const a=r(2454);const s=r(7335);const u=r(8396);const l=r(8923);const c=r(9205);const d=r(5723);const p=c(n);const runPlugins=(e,t)=>{if(t.plugins.length===0){return Promise.resolve([])}return Promise.all(t.plugins.map((r=>r(e,t)))).then((e=>e.reduce(((e,t)=>e.concat(t)))))};const safeMakeDir=(e,t)=>p.realpath(e).catch((r=>{const n=i.dirname(e);return safeMakeDir(n,t)})).then((r=>{if(r.indexOf(t)!==0){throw new Error("Refusing to create a directory outside the output path.")}return l(e).then(p.realpath)}));const preventWritingThroughSymlink=(e,t)=>p.readlink(e).catch((e=>null)).then((e=>{if(e){throw new Error("Refusing to write into a symlink")}return t}));const extractFile=(e,t,r)=>runPlugins(e,r).then((e=>{if(r.strip>0){e=e.map((e=>{e.path=d(e.path,r.strip);return e})).filter((e=>e.path!=="."))}if(typeof r.filter==="function"){e=e.filter(r.filter)}if(typeof r.map==="function"){e=e.map(r.map)}if(!t){return e}return Promise.all(e.map((e=>{const r=i.join(t,e.path);const n=e.mode&~process.umask();const o=new Date;if(e.type==="directory"){return l(t).then((e=>p.realpath(e))).then((e=>safeMakeDir(r,e))).then((()=>p.utimes(r,o,e.mtime))).then((()=>e))}return l(t).then((e=>p.realpath(e))).then((e=>safeMakeDir(i.dirname(r),e).then((()=>e)))).then((t=>{if(e.type==="file"){return preventWritingThroughSymlink(r,t)}return t})).then((e=>p.realpath(i.dirname(r)).then((t=>{if(t.indexOf(e)!==0){throw new Error("Refusing to write outside output directory: "+t)}})))).then((()=>{if(e.type==="link"){return p.link(e.linkname,r)}if(e.type==="symlink"&&process.platform==="win32"){return p.link(e.linkname,r)}if(e.type==="symlink"){return p.symlink(e.linkname,r)}return p.writeFile(r,e.data,{mode:n})})).then((()=>e.type==="file"&&p.utimes(r,o,e.mtime))).then((()=>e))})))}));e.exports=(e,t,r)=>{if(typeof e!=="string"&&!Buffer.isBuffer(e)){return Promise.reject(new TypeError("Input file required"))}if(typeof t==="object"){r=t;t=null}r=Object.assign({plugins:[o(),a(),s(),u()]},r);const i=typeof e==="string"?p.readFile(e):Promise.resolve(e);return i.then((e=>extractFile(e,t,r)))}},8923:function(e,t,r){"use strict";const i=r(7147);const n=r(1017);const o=r(17);const a={mode:511&~process.umask(),fs:i};const checkPath=e=>{if(process.platform==="win32"){const t=/[<>:"|?*]/.test(e.replace(n.parse(e).root,""));if(t){const t=new Error(`Path contains invalid characters: ${e}`);t.code="EINVAL";throw t}}};e.exports=(e,t)=>Promise.resolve().then((()=>{checkPath(e);t=Object.assign({},a,t);const r=o(t.fs.mkdir);const i=o(t.fs.stat);const make=e=>r(e,t.mode).then((()=>e)).catch((t=>{if(t.code==="ENOENT"){if(t.message.includes("null bytes")||n.dirname(e)===e){throw t}return make(n.dirname(e)).then((()=>make(e)))}return i(e).then((t=>t.isDirectory()?e:Promise.reject())).catch((()=>{throw t}))}));return make(n.resolve(e))}));e.exports.sync=(e,t)=>{checkPath(e);t=Object.assign({},a,t);const make=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(r){if(r.code==="ENOENT"){if(r.message.includes("null bytes")||n.dirname(e)===e){throw r}make(n.dirname(e));return make(e)}try{if(!t.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw r}}return e};return make(n.resolve(e))}},17:function(e){"use strict";const processFn=(e,t)=>function(){const r=t.promiseModule;const i=new Array(arguments.length);for(let e=0;e<arguments.length;e++){i[e]=arguments[e]}return new r(((r,n)=>{if(t.errorFirst){i.push((function(e,i){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++){t[e-1]=arguments[e]}if(e){t.unshift(e);n(t)}else{r(t)}}else if(e){n(e)}else{r(i)}}))}else{i.push((function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++){e[t]=arguments[t]}r(e)}else{r(e)}}))}e.apply(this,i)}))};e.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:true,promiseModule:Promise},t);const filter=e=>{const match=t=>typeof t==="string"?e===t:t.test(e);return t.include?t.include.some(match):!t.exclude.some(match)};let r;if(typeof e==="function"){r=function(){if(t.excludeMain){return e.apply(this,arguments)}return processFn(e,t).apply(this,arguments)}}else{r=Object.create(Object.getPrototypeOf(e))}for(const i in e){const n=e[i];r[i]=typeof n==="function"&&filter(i)?processFn(n,t):n}return r}},9205:function(e){"use strict";var processFn=function(e,t,r){return function(){var i=this;var n=new Array(arguments.length);for(var o=0;o<arguments.length;o++){n[o]=arguments[o]}return new t((function(t,o){n.push((function(e,i){if(e){o(e)}else if(r.multiArgs){var n=new Array(arguments.length-1);for(var a=1;a<arguments.length;a++){n[a-1]=arguments[a]}t(n)}else{t(i)}}));e.apply(i,n)}))}};var t=e.exports=function(e,t,r){if(typeof t!=="function"){r=t;t=Promise}r=r||{};r.exclude=r.exclude||[/.+Sync$/];var filter=function(e){var match=function(t){return typeof t==="string"?e===t:t.test(e)};return r.include?r.include.some(match):!r.exclude.some(match)};var i=typeof e==="function"?function(){if(r.excludeMain){return e.apply(this,arguments)}return processFn(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce((function(i,n){var o=e[n];i[n]=typeof o==="function"&&filter(n)?processFn(o,t,r):o;return i}),i)};t.all=t},1205:function(e,t,r){var i=r(1223);var noop=function(){};var isRequest=function(e){return e.setHeader&&typeof e.abort==="function"};var isChildProcess=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var eos=function(e,t,r){if(typeof t==="function")return eos(e,null,t);if(!t)t={};r=i(r||noop);var n=e._writableState;var o=e._readableState;var a=t.readable||t.readable!==false&&e.readable;var s=t.writable||t.writable!==false&&e.writable;var u=false;var onlegacyfinish=function(){if(!e.writable)onfinish()};var onfinish=function(){s=false;if(!a)r.call(e)};var onend=function(){a=false;if(!s)r.call(e)};var onexit=function(t){r.call(e,t?new Error("exited with error code: "+t):null)};var onerror=function(t){r.call(e,t)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(u)return;if(a&&!(o&&(o.ended&&!o.destroyed)))return r.call(e,new Error("premature close"));if(s&&!(n&&(n.ended&&!n.destroyed)))return r.call(e,new Error("premature close"))};var onrequest=function(){e.req.on("finish",onfinish)};if(isRequest(e)){e.on("complete",onfinish);e.on("abort",onclose);if(e.req)onrequest();else e.on("request",onrequest)}else if(s&&!n){e.on("end",onlegacyfinish);e.on("close",onlegacyfinish)}if(isChildProcess(e))e.on("exit",onexit);e.on("end",onend);e.on("finish",onfinish);if(t.error!==false)e.on("error",onerror);e.on("close",onclose);return function(){u=true;e.removeListener("complete",onfinish);e.removeListener("abort",onclose);e.removeListener("request",onrequest);if(e.req)e.req.removeListener("finish",onfinish);e.removeListener("end",onlegacyfinish);e.removeListener("close",onlegacyfinish);e.removeListener("finish",onfinish);e.removeListener("exit",onexit);e.removeListener("end",onend);e.removeListener("error",onerror);e.removeListener("close",onclose)}};e.exports=eos},5010:function(e,t,r){var i=r(7147);var n=r(3837);var o=r(2781);var a=o.Readable;var s=o.Writable;var u=o.PassThrough;var l=r(4833);var c=r(2361).EventEmitter;t.createFromBuffer=createFromBuffer;t.createFromFd=createFromFd;t.BufferSlicer=BufferSlicer;t.FdSlicer=FdSlicer;n.inherits(FdSlicer,c);function FdSlicer(e,t){t=t||{};c.call(this);this.fd=e;this.pend=new l;this.pend.max=1;this.refCount=0;this.autoClose=!!t.autoClose}FdSlicer.prototype.read=function(e,t,r,n,o){var a=this;a.pend.go((function(s){i.read(a.fd,e,t,r,n,(function(e,t,r){s();o(e,t,r)}))}))};FdSlicer.prototype.write=function(e,t,r,n,o){var a=this;a.pend.go((function(s){i.write(a.fd,e,t,r,n,(function(e,t,r){s();o(e,t,r)}))}))};FdSlicer.prototype.createReadStream=function(e){return new ReadStream(this,e)};FdSlicer.prototype.createWriteStream=function(e){return new WriteStream(this,e)};FdSlicer.prototype.ref=function(){this.refCount+=1};FdSlicer.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");if(e.autoClose){i.close(e.fd,onCloseDone)}function onCloseDone(t){if(t){e.emit("error",t)}else{e.emit("close")}}};n.inherits(ReadStream,a);function ReadStream(e,t){t=t||{};a.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end;this.pos=this.start;this.destroyed=false}ReadStream.prototype._read=function(e){var t=this;if(t.destroyed)return;var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null){r=Math.min(r,t.endOffset-t.pos)}if(r<=0){t.destroyed=true;t.push(null);t.context.unref();return}t.context.pend.go((function(e){if(t.destroyed)return e();var n=new Buffer(r);i.read(t.context.fd,n,0,r,t.pos,(function(r,i){if(r){t.destroy(r)}else if(i===0){t.destroyed=true;t.push(null);t.context.unref()}else{t.pos+=i;t.push(n.slice(0,i))}e()}))}))};ReadStream.prototype.destroy=function(e){if(this.destroyed)return;e=e||new Error("stream destroyed");this.destroyed=true;this.emit("error",e);this.context.unref()};n.inherits(WriteStream,s);function WriteStream(e,t){t=t||{};s.call(this,t);this.context=e;this.context.ref();this.start=t.start||0;this.endOffset=t.end==null?Infinity:+t.end;this.bytesWritten=0;this.pos=this.start;this.destroyed=false;this.on("finish",this.destroy.bind(this))}WriteStream.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return;if(n.pos+e.length>n.endOffset){var o=new Error("maximum file length exceeded");o.code="ETOOBIG";n.destroy();r(o);return}n.context.pend.go((function(t){if(n.destroyed)return t();i.write(n.context.fd,e,0,e.length,n.pos,(function(e,i){if(e){n.destroy();t();r(e)}else{n.bytesWritten+=i;n.pos+=i;n.emit("progress");t();r()}}))}))};WriteStream.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this.context.unref()};n.inherits(BufferSlicer,c);function BufferSlicer(e,t){c.call(this);t=t||{};this.refCount=0;this.buffer=e;this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}BufferSlicer.prototype.read=function(e,t,r,i,n){var o=i+r;var a=o-this.buffer.length;var s=a>0?a:r;this.buffer.copy(e,t,i,o);setImmediate((function(){n(null,s)}))};BufferSlicer.prototype.write=function(e,t,r,i,n){e.copy(this.buffer,i,t,t+r);setImmediate((function(){n(null,r,e)}))};BufferSlicer.prototype.createReadStream=function(e){e=e||{};var t=new u(e);t.destroyed=false;t.start=e.start||0;t.endOffset=e.end;t.pos=t.endOffset||this.buffer.length;var r=this.buffer.slice(t.start,t.pos);var i=0;while(true){var n=i+this.maxChunkSize;if(n>=r.length){if(i<r.length){t.write(r.slice(i,r.length))}break}t.write(r.slice(i,n));i=n}t.end();t.destroy=function(){t.destroyed=true};return t};BufferSlicer.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new s(e);r.start=e.start||0;r.endOffset=e.end==null?this.buffer.length:+e.end;r.bytesWritten=0;r.pos=r.start;r.destroyed=false;r._write=function(e,i,n){if(r.destroyed)return;var o=r.pos+e.length;if(o>r.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG";r.destroyed=true;n(a);return}e.copy(t.buffer,r.pos,0,e.length);r.bytesWritten+=e.length;r.pos=o;r.emit("progress");n()};r.destroy=function(){r.destroyed=true};return r};BufferSlicer.prototype.ref=function(){this.refCount+=1};BufferSlicer.prototype.unref=function(){this.refCount-=1;if(this.refCount<0){throw new Error("invalid unref")}};function createFromBuffer(e,t){return new BufferSlicer(e,t)}function createFromFd(e,t){return new FdSlicer(e,t)}},7128:function(e){"use strict";e.exports=function(e){if(!(e&&e.length>1)){return null}if(e[0]===255&&e[1]===216&&e[2]===255){return{ext:"jpg",mime:"image/jpeg"}}if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71){return{ext:"png",mime:"image/png"}}if(e[0]===71&&e[1]===73&&e[2]===70){return{ext:"gif",mime:"image/gif"}}if(e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80){return{ext:"webp",mime:"image/webp"}}if(e[0]===70&&e[1]===76&&e[2]===73&&e[3]===70){return{ext:"flif",mime:"image/flif"}}if((e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42)&&e[8]===67&&e[9]===82){return{ext:"cr2",mime:"image/x-canon-cr2"}}if(e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42){return{ext:"tif",mime:"image/tiff"}}if(e[0]===66&&e[1]===77){return{ext:"bmp",mime:"image/bmp"}}if(e[0]===73&&e[1]===73&&e[2]===188){return{ext:"jxr",mime:"image/vnd.ms-photo"}}if(e[0]===56&&e[1]===66&&e[2]===80&&e[3]===83){return{ext:"psd",mime:"image/vnd.adobe.photoshop"}}if(e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===109&&e[31]===105&&e[32]===109&&e[33]===101&&e[34]===116&&e[35]===121&&e[36]===112&&e[37]===101&&e[38]===97&&e[39]===112&&e[40]===112&&e[41]===108&&e[42]===105&&e[43]===99&&e[44]===97&&e[45]===116&&e[46]===105&&e[47]===111&&e[48]===110&&e[49]===47&&e[50]===101&&e[51]===112&&e[52]===117&&e[53]===98&&e[54]===43&&e[55]===122&&e[56]===105&&e[57]===112){return{ext:"epub",mime:"application/epub+zip"}}if(e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===77&&e[31]===69&&e[32]===84&&e[33]===65&&e[34]===45&&e[35]===73&&e[36]===78&&e[37]===70&&e[38]===47&&e[39]===109&&e[40]===111&&e[41]===122&&e[42]===105&&e[43]===108&&e[44]===108&&e[45]===97&&e[46]===46&&e[47]===114&&e[48]===115&&e[49]===97){return{ext:"xpi",mime:"application/x-xpinstall"}}if(e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)){return{ext:"zip",mime:"application/zip"}}if(e[257]===117&&e[258]===115&&e[259]===116&&e[260]===97&&e[261]===114){return{ext:"tar",mime:"application/x-tar"}}if(e[0]===82&&e[1]===97&&e[2]===114&&e[3]===33&&e[4]===26&&e[5]===7&&(e[6]===0||e[6]===1)){return{ext:"rar",mime:"application/x-rar-compressed"}}if(e[0]===31&&e[1]===139&&e[2]===8){return{ext:"gz",mime:"application/gzip"}}if(e[0]===66&&e[1]===90&&e[2]===104){return{ext:"bz2",mime:"application/x-bzip2"}}if(e[0]===55&&e[1]===122&&e[2]===188&&e[3]===175&&e[4]===39&&e[5]===28){return{ext:"7z",mime:"application/x-7z-compressed"}}if(e[0]===120&&e[1]===1){return{ext:"dmg",mime:"application/x-apple-diskimage"}}if(e[0]===0&&e[1]===0&&e[2]===0&&(e[3]===24||e[3]===32)&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112||e[0]===51&&e[1]===103&&e[2]===112&&e[3]===53||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[16]===109&&e[17]===112&&e[18]===52&&e[19]===49&&e[20]===109&&e[21]===112&&e[22]===52&&e[23]===50&&e[24]===105&&e[25]===115&&e[26]===111&&e[27]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===105&&e[9]===115&&e[10]===111&&e[11]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===0){return{ext:"mp4",mime:"video/mp4"}}if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===86){return{ext:"m4v",mime:"video/x-m4v"}}if(e[0]===77&&e[1]===84&&e[2]===104&&e[3]===100){return{ext:"mid",mime:"audio/midi"}}if(e[31]===109&&e[32]===97&&e[33]===116&&e[34]===114&&e[35]===111&&e[36]===115&&e[37]===107&&e[38]===97){return{ext:"mkv",mime:"video/x-matroska"}}if(e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163){return{ext:"webm",mime:"video/webm"}}if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===20&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112){return{ext:"mov",mime:"video/quicktime"}}if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===65&&e[9]===86&&e[10]===73){return{ext:"avi",mime:"video/x-msvideo"}}if(e[0]===48&&e[1]===38&&e[2]===178&&e[3]===117&&e[4]===142&&e[5]===102&&e[6]===207&&e[7]===17&&e[8]===166&&e[9]===217){return{ext:"wmv",mime:"video/x-ms-wmv"}}if(e[0]===0&&e[1]===0&&e[2]===1&&e[3].toString(16)[0]==="b"){return{ext:"mpg",mime:"video/mpeg"}}if(e[0]===73&&e[1]===68&&e[2]===51||e[0]===255&&e[1]===251){return{ext:"mp3",mime:"audio/mpeg"}}if(e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===65||e[0]===77&&e[1]===52&&e[2]===65&&e[3]===32){return{ext:"m4a",mime:"audio/m4a"}}if(e[28]===79&&e[29]===112&&e[30]===117&&e[31]===115&&e[32]===72&&e[33]===101&&e[34]===97&&e[35]===100){return{ext:"opus",mime:"audio/opus"}}if(e[0]===79&&e[1]===103&&e[2]===103&&e[3]===83){return{ext:"ogg",mime:"audio/ogg"}}if(e[0]===102&&e[1]===76&&e[2]===97&&e[3]===67){return{ext:"flac",mime:"audio/x-flac"}}if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===65&&e[10]===86&&e[11]===69){return{ext:"wav",mime:"audio/x-wav"}}if(e[0]===35&&e[1]===33&&e[2]===65&&e[3]===77&&e[4]===82&&e[5]===10){return{ext:"amr",mime:"audio/amr"}}if(e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70){return{ext:"pdf",mime:"application/pdf"}}if(e[0]===77&&e[1]===90){return{ext:"exe",mime:"application/x-msdownload"}}if((e[0]===67||e[0]===70)&&e[1]===87&&e[2]===83){return{ext:"swf",mime:"application/x-shockwave-flash"}}if(e[0]===123&&e[1]===92&&e[2]===114&&e[3]===116&&e[4]===102){return{ext:"rtf",mime:"application/rtf"}}if(e[0]===119&&e[1]===79&&e[2]===70&&e[3]===70&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)){return{ext:"woff",mime:"application/font-woff"}}if(e[0]===119&&e[1]===79&&e[2]===70&&e[3]===50&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)){return{ext:"woff2",mime:"application/font-woff"}}if(e[34]===76&&e[35]===80&&(e[8]===0&&e[9]===0&&e[10]===1||e[8]===1&&e[9]===0&&e[10]===2||e[8]===2&&e[9]===0&&e[10]===2)){return{ext:"eot",mime:"application/octet-stream"}}if(e[0]===0&&e[1]===1&&e[2]===0&&e[3]===0&&e[4]===0){return{ext:"ttf",mime:"application/font-sfnt"}}if(e[0]===79&&e[1]===84&&e[2]===84&&e[3]===79&&e[4]===0){return{ext:"otf",mime:"application/font-sfnt"}}if(e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0){return{ext:"ico",mime:"image/x-icon"}}if(e[0]===70&&e[1]===76&&e[2]===86&&e[3]===1){return{ext:"flv",mime:"video/x-flv"}}if(e[0]===37&&e[1]===33){return{ext:"ps",mime:"application/postscript"}}if(e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0){return{ext:"xz",mime:"application/x-xz"}}if(e[0]===83&&e[1]===81&&e[2]===76&&e[3]===105){return{ext:"sqlite",mime:"application/x-sqlite3"}}if(e[0]===78&&e[1]===69&&e[2]===83&&e[3]===26){return{ext:"nes",mime:"application/x-nintendo-nes-rom"}}if(e[0]===67&&e[1]===114&&e[2]===50&&e[3]===52){return{ext:"crx",mime:"application/x-google-chrome-extension"}}if(e[0]===77&&e[1]===83&&e[2]===67&&e[3]===70||e[0]===73&&e[1]===83&&e[2]===99&&e[3]===40){return{ext:"cab",mime:"application/vnd.ms-cab-compressed"}}if(e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62&&e[7]===10&&e[8]===100&&e[9]===101&&e[10]===98&&e[11]===105&&e[12]===97&&e[13]===110&&e[14]===45&&e[15]===98&&e[16]===105&&e[17]===110&&e[18]===97&&e[19]===114&&e[20]===121){return{ext:"deb",mime:"application/x-deb"}}if(e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62){return{ext:"ar",mime:"application/x-unix-archive"}}if(e[0]===237&&e[1]===171&&e[2]===238&&e[3]===219){return{ext:"rpm",mime:"application/x-rpm"}}if(e[0]===31&&e[1]===160||e[0]===31&&e[1]===157){return{ext:"Z",mime:"application/x-compress"}}if(e[0]===76&&e[1]===90&&e[2]===73&&e[3]===80){return{ext:"lz",mime:"application/x-lzip"}}if(e[0]===208&&e[1]===207&&e[2]===17&&e[3]===224&&e[4]===161&&e[5]===177&&e[6]===26&&e[7]===225){return{ext:"msi",mime:"application/x-msi"}}return null}},3186:function(e,t,r){e.exports=r(7147).constants||r(2057)},7356:function(e){"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},7758:function(e,t,r){var i=r(7147);var n=r(263);var o=r(3086);var a=r(7356);var s=r(3837);var u;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,u,{get:function(){return t}})}var c=noop;if(s.debuglog)c=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))c=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!i[u]){var d=global[u]||[];publishQueue(i,d);i.close=function(e){function close(t,r){return e.call(i,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(i.close);i.closeSync=function(e){function closeSync(t){e.apply(i,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(i.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){c(i[u]);r(9491).equal(i[u].length,0)}))}}if(!global[u]){publishQueue(global,i[u])}e.exports=patch(a(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched){e.exports=patch(i);i.__patched=true}function patch(e){n(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,i){if(typeof r==="function")i=r,r=null;return go$readFile(e,r,i);function go$readFile(e,r,i,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,i],t,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,i,n){if(typeof i==="function")n=i,i=null;return go$writeFile(e,t,i,n);function go$writeFile(e,t,i,n,o){return r(e,t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,i,n],r,o||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var i=e.appendFile;if(i)e.appendFile=appendFile;function appendFile(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$appendFile(e,t,r,n);function go$appendFile(e,t,r,n,o){return i(e,t,r,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,n],i,o||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.copyFile;if(a)e.copyFile=copyFile;function copyFile(e,t,r,i){if(typeof r==="function"){i=r;r=0}return go$copyFile(e,t,r,i);function go$copyFile(e,t,r,i,n){return a(e,t,r,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,i],o,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}var s=e.readdir;e.readdir=readdir;var u=/^v[0-5]\./;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;var i=u.test(process.version)?function go$readdir(e,t,r,i){return s(e,fs$readdirCallback(e,t,r,i))}:function go$readdir(e,t,r,i){return s(e,t,fs$readdirCallback(e,t,r,i))};return i(e,t,r);function fs$readdirCallback(e,t,r,n){return function(o,a){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([i,[e,t,r],o,n||Date.now(),Date.now()]);else{if(a&&a.sort)a.sort();if(typeof r==="function")r.call(this,o,a)}}}}if(process.version.substr(0,4)==="v0.8"){var l=o(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var c=e.ReadStream;if(c){ReadStream.prototype=Object.create(c.prototype);ReadStream.prototype.open=ReadStream$open}var d=e.WriteStream;if(d){WriteStream.prototype=Object.create(d.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var p=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return c.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return d.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var m=e.open;e.open=open;function open(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$open(e,t,r,i);function go$open(e,t,r,i,n){return m(e,t,r,(function(o,a){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$open,[e,t,r,i],o,n||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}}))}}return e}function enqueue(e){c("ENQUEUE",e[0].name,e[1]);i[u].push(e);retry()}var p;function resetQueue(){var e=Date.now();for(var t=0;t<i[u].length;++t){if(i[u][t].length>2){i[u][t][3]=e;i[u][t][4]=e}}retry()}function retry(){clearTimeout(p);p=undefined;if(i[u].length===0)return;var e=i[u].shift();var t=e[0];var r=e[1];var n=e[2];var o=e[3];var a=e[4];if(o===undefined){c("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-o>=6e4){c("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,n)}else{var l=Date.now()-a;var d=Math.max(a-o,1);var h=Math.min(d*1.2,100);if(l>=h){c("RETRY",t.name,r);t.apply(null,r.concat([o]))}else{i[u].push(e)}}if(p===undefined){p=setTimeout(retry,0)}}},3086:function(e,t,r){var i=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);i.call(this);var n=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var o=Object.keys(r);for(var a=0,s=o.length;a<s;a++){var u=o[a];this[u]=r[u]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){n.emit("error",e);n.readable=false;return}n.fd=t;n.emit("open",t);n._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);i.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var n=Object.keys(r);for(var o=0,a=n.length;o<a;o++){var s=n[o];this[s]=r[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:function(e,t,r){var i=r(2057);var n=process.cwd;var o=null;var a=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!o)o=n.call(process);return o};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(e){o=null;s.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}e.exports=patch;function patch(e){if(i.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,r,i){if(i)process.nextTick(i)};e.lchownSync=function(){}}if(a==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(r,i,n){var o=Date.now();var a=0;t(r,i,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM"||s.code==="EBUSY")&&Date.now()-o<6e4){setTimeout((function(){e.stat(i,(function(e,o){if(e&&e.code==="ENOENT")t(r,i,CB);else n(s)}))}),a);if(a<100)a+=10;return}if(n)n(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(r,i,n,o,a,s){var u;if(s&&typeof s==="function"){var l=0;u=function(c,d,p){if(c&&c.code==="EAGAIN"&&l<10){l++;return t.call(e,r,i,n,o,a,u)}s.apply(this,arguments)}}return t.call(e,r,i,n,o,a,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(r,i,n,o,a){var s=0;while(true){try{return t.call(e,r,i,n,o,a)}catch(e){if(e.code==="EAGAIN"&&s<10){s++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,n){e.open(t,i.O_WRONLY|i.O_SYMLINK,r,(function(t,i){if(t){if(n)n(t);return}e.fchmod(i,r,(function(t){e.close(i,(function(e){if(n)n(t||e)}))}))}))};e.lchmodSync=function(t,r){var n=e.openSync(t,i.O_WRONLY|i.O_SYMLINK,r);var o=true;var a;try{a=e.fchmodSync(n,r);o=false}finally{if(o){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return a}}function patchLutimes(e){if(i.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,r,n,o){e.open(t,i.O_SYMLINK,(function(t,i){if(t){if(o)o(t);return}e.futimes(i,r,n,(function(t){e.close(i,(function(e){if(o)o(t||e)}))}))}))};e.lutimesSync=function(t,r,n){var o=e.openSync(t,i.O_SYMLINK);var a;var s=true;try{a=e.futimesSync(o,r,n);s=false}finally{if(s){try{e.closeSync(o)}catch(e){}}else{e.closeSync(o)}}return a}}else if(e.futimes){e.lutimes=function(e,t,r,i){if(i)process.nextTick(i)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,i,n){return t.call(e,r,i,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,i){try{return t.call(e,r,i)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,i,n,o){return t.call(e,r,i,n,(function(e){if(chownErOk(e))e=null;if(o)o.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,i,n){try{return t.call(e,r,i,n)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,i,n){if(typeof i==="function"){n=i;i=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(n)n.apply(this,arguments)}return i?t.call(e,r,i,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,i){var n=i?t.call(e,r,i):t.call(e,r);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},4124:function(e,t,r){try{var i=r(3837);if(typeof i.inherits!=="function")throw"";e.exports=i.inherits}catch(t){e.exports=r(8544)}},8544:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},3316:function(e){"use strict";
2
2
  /*!
3
3
  * is-natural-number.js | MIT (c) Shinnosuke Watanabe
4
4
  * https://github.com/shinnn/is-natural-number.js
5
- */e.exports=function isNaturalNumber(e,t){if(t){if(typeof t!=="object"){throw new TypeError(String(t)+" is not an object. Expected an object that has boolean `includeZero` property.")}if("includeZero"in t){if(typeof t.includeZero!=="boolean"){throw new TypeError(String(t.includeZero)+" is neither true nor false. `includeZero` option must be a Boolean value.")}if(t.includeZero&&e===0){return true}}}return Number.isSafeInteger(e)&&e>=1}},1554:function(e){"use strict";var t=e.exports=function(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"};t.writable=function(e){return t(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"};t.readable=function(e){return t(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"};t.duplex=function(e){return t.writable(e)&&t.readable(e)};t.transform=function(e){return t.duplex(e)&&typeof e._transform==="function"&&typeof e._transformState==="object"}},9126:function(e,t,r){"use strict";const i=r(7147);const n=r(1017);const o=r(6250);const a={mode:511&~process.umask(),fs:i};const checkPath=e=>{if(process.platform==="win32"){const t=/[<>:"|?*]/.test(e.replace(n.parse(e).root,""));if(t){const t=new Error(`Path contains invalid characters: ${e}`);t.code="EINVAL";throw t}}};e.exports=(e,t)=>Promise.resolve().then((()=>{checkPath(e);t=Object.assign({},a,t);const r=o(t.fs.mkdir);const i=o(t.fs.stat);const make=e=>r(e,t.mode).then((()=>e)).catch((t=>{if(t.code==="ENOENT"){if(t.message.includes("null bytes")||n.dirname(e)===e){throw t}return make(n.dirname(e)).then((()=>make(e)))}return i(e).then((t=>t.isDirectory()?e:Promise.reject())).catch((()=>{throw t}))}));return make(n.resolve(e))}));e.exports.sync=(e,t)=>{checkPath(e);t=Object.assign({},a,t);const make=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(r){if(r.code==="ENOENT"){if(r.message.includes("null bytes")||n.dirname(e)===e){throw r}make(n.dirname(e));return make(e)}try{if(!t.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw r}}return e};return make(n.resolve(e))}},6250:function(e){"use strict";const processFn=(e,t)=>function(){const r=t.promiseModule;const i=new Array(arguments.length);for(let e=0;e<arguments.length;e++){i[e]=arguments[e]}return new r(((r,n)=>{if(t.errorFirst){i.push((function(e,i){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++){t[e-1]=arguments[e]}if(e){t.unshift(e);n(t)}else{r(t)}}else if(e){n(e)}else{r(i)}}))}else{i.push((function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++){e[t]=arguments[t]}r(e)}else{r(e)}}))}e.apply(this,i)}))};e.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:true,promiseModule:Promise},t);const filter=e=>{const match=t=>typeof t==="string"?e===t:t.test(e);return t.include?t.include.some(match):!t.exclude.some(match)};let r;if(typeof e==="function"){r=function(){if(t.excludeMain){return e.apply(this,arguments)}return processFn(e,t).apply(this,arguments)}}else{r=Object.create(Object.getPrototypeOf(e))}for(const i in e){const n=e[i];r[i]=typeof n==="function"&&filter(i)?processFn(n,t):n}return r}},7426:function(e){"use strict";
5
+ */e.exports=function isNaturalNumber(e,t){if(t){if(typeof t!=="object"){throw new TypeError(String(t)+" is not an object. Expected an object that has boolean `includeZero` property.")}if("includeZero"in t){if(typeof t.includeZero!=="boolean"){throw new TypeError(String(t.includeZero)+" is neither true nor false. `includeZero` option must be a Boolean value.")}if(t.includeZero&&e===0){return true}}}return Number.isSafeInteger(e)&&e>=1}},1554:function(e){"use strict";var t=e.exports=function(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"};t.writable=function(e){return t(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"};t.readable=function(e){return t(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"};t.duplex=function(e){return t.writable(e)&&t.readable(e)};t.transform=function(e){return t.duplex(e)&&typeof e._transform==="function"&&typeof e._transformState==="object"}},7426:function(e){"use strict";
6
6
  /*
7
7
  object-assign
8
8
  (c) Sindre Sorhus
@@ -13,4 +13,4 @@ var i=r(4300);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}
13
13
  /*!
14
14
  * strip-dirs | MIT (c) Shinnosuke Watanabe
15
15
  * https://github.com/shinnn/node-strip-dirs
16
- */const i=r(1017);const n=r(3837);const o=r(3316);e.exports=function stripDirs(e,t,r){if(typeof e!=="string"){throw new TypeError(n.inspect(e)+" is not a string. First argument to strip-dirs must be a path string.")}if(i.posix.isAbsolute(e)||i.win32.isAbsolute(e)){throw new Error(`${e} is an absolute path. strip-dirs requires a relative path.`)}if(!o(t,{includeZero:true})){throw new Error("The Second argument of strip-dirs must be a natural number or 0, but received "+n.inspect(t)+".")}if(r){if(typeof r!=="object"){throw new TypeError(n.inspect(r)+" is not an object. Expected an object with a boolean `disallowOverflow` property.")}if(Array.isArray(r)){throw new TypeError(n.inspect(r)+" is an array. Expected an object with a boolean `disallowOverflow` property.")}if("disallowOverflow"in r&&typeof r.disallowOverflow!=="boolean"){throw new TypeError(n.inspect(r.disallowOverflow)+" is neither true nor false. `disallowOverflow` option must be a Boolean value.")}}else{r={disallowOverflow:false}}const a=i.normalize(e).split(i.sep);if(a.length>1&&a[0]==="."){a.shift()}if(t>a.length-1){if(r.disallowOverflow){throw new RangeError("Cannot strip more directories than there are.")}t=a.length-1}return i.join.apply(null,a.slice(t))}},7882:function(e,t,r){var i=r(3837);var n=r(2730);var o=r(1208);var a=r(8860);var s=r(1642).Writable;var u=r(1642).PassThrough;var noop=function(){};var overflow=function(e){e&=511;return e&&512-e};var emptyStream=function(e,t){var r=new Source(e,t);r.end();return r};var mixinPax=function(e,t){if(t.path)e.name=t.path;if(t.linkpath)e.linkname=t.linkpath;if(t.size)e.size=parseInt(t.size,10);e.pax=t;return e};var Source=function(e,t){this._parent=e;this.offset=t;u.call(this)};i.inherits(Source,u);Source.prototype.destroy=function(e){this._parent.destroy(e)};var Extract=function(e){if(!(this instanceof Extract))return new Extract(e);s.call(this,e);e=e||{};this._offset=0;this._buffer=n();this._missing=0;this._partial=false;this._onparse=noop;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var t=this;var r=t._buffer;var oncontinue=function(){t._continue()};var onunlock=function(e){t._locked=false;if(e)return t.destroy(e);if(!t._stream)oncontinue()};var onstreamend=function(){t._stream=null;var e=overflow(t._header.size);if(e)t._parse(e,ondrain);else t._parse(512,onheader);if(!t._locked)oncontinue()};var ondrain=function(){t._buffer.consume(overflow(t._header.size));t._parse(512,onheader);oncontinue()};var onpaxglobalheader=function(){var e=t._header.size;t._paxGlobal=a.decodePax(r.slice(0,e));r.consume(e);onstreamend()};var onpaxheader=function(){var e=t._header.size;t._pax=a.decodePax(r.slice(0,e));if(t._paxGlobal)t._pax=o(t._paxGlobal,t._pax);r.consume(e);onstreamend()};var ongnulongpath=function(){var i=t._header.size;this._gnuLongPath=a.decodeLongPath(r.slice(0,i),e.filenameEncoding);r.consume(i);onstreamend()};var ongnulonglinkpath=function(){var i=t._header.size;this._gnuLongLinkPath=a.decodeLongPath(r.slice(0,i),e.filenameEncoding);r.consume(i);onstreamend()};var onheader=function(){var i=t._offset;var n;try{n=t._header=a.decode(r.slice(0,512),e.filenameEncoding)}catch(e){t.emit("error",e)}r.consume(512);if(!n){t._parse(512,onheader);oncontinue();return}if(n.type==="gnu-long-path"){t._parse(n.size,ongnulongpath);oncontinue();return}if(n.type==="gnu-long-link-path"){t._parse(n.size,ongnulonglinkpath);oncontinue();return}if(n.type==="pax-global-header"){t._parse(n.size,onpaxglobalheader);oncontinue();return}if(n.type==="pax-header"){t._parse(n.size,onpaxheader);oncontinue();return}if(t._gnuLongPath){n.name=t._gnuLongPath;t._gnuLongPath=null}if(t._gnuLongLinkPath){n.linkname=t._gnuLongLinkPath;t._gnuLongLinkPath=null}if(t._pax){t._header=n=mixinPax(n,t._pax);t._pax=null}t._locked=true;if(!n.size||n.type==="directory"){t._parse(512,onheader);t.emit("entry",n,emptyStream(t,i),onunlock);return}t._stream=new Source(t,i);t.emit("entry",n,t._stream,onunlock);t._parse(n.size,onstreamend);oncontinue()};this._onheader=onheader;this._parse(512,onheader)};i.inherits(Extract,s);Extract.prototype.destroy=function(e){if(this._destroyed)return;this._destroyed=true;if(e)this.emit("error",e);this.emit("close");if(this._stream)this._stream.emit("close")};Extract.prototype._parse=function(e,t){if(this._destroyed)return;this._offset+=e;this._missing=e;if(t===this._onheader)this._partial=false;this._onparse=t};Extract.prototype._continue=function(){if(this._destroyed)return;var e=this._cb;this._cb=noop;if(this._overflow)this._write(this._overflow,undefined,e);else e()};Extract.prototype._write=function(e,t,r){if(this._destroyed)return;var i=this._stream;var n=this._buffer;var o=this._missing;if(e.length)this._partial=true;if(e.length<o){this._missing-=e.length;this._overflow=null;if(i)return i.write(e,r);n.append(e);return r()}this._cb=r;this._missing=0;var a=null;if(e.length>o){a=e.slice(o);e=e.slice(0,o)}if(i)i.end(e);else n.append(e);this._overflow=a;this._onparse()};Extract.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};e.exports=Extract},8860:function(e,t,r){var i=r(1259);var n=r(6615);var o="0000000000000000000";var a="7777777777777777777";var s="0".charCodeAt(0);var u="ustar\x0000";var l=parseInt("7777",8);var clamp=function(e,t,r){if(typeof e!=="number")return r;e=~~e;if(e>=t)return t;if(e>=0)return e;e+=t;if(e>=0)return e;return 0};var toType=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null};var toTypeflag=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0};var indexOf=function(e,t,r,i){for(;r<i;r++){if(e[r]===t)return r}return i};var cksum=function(e){var t=8*32;for(var r=0;r<148;r++)t+=e[r];for(var i=156;i<512;i++)t+=e[i];return t};var encodeOct=function(e,t){e=e.toString(8);if(e.length>t)return a.slice(0,t)+" ";else return o.slice(0,t-e.length)+e+" "};function parse256(e){var t;if(e[0]===128)t=true;else if(e[0]===255)t=false;else return null;var r=false;var i=[];for(var n=e.length-1;n>0;n--){var o=e[n];if(t)i.push(o);else if(r&&o===0)i.push(0);else if(r){r=false;i.push(256-o)}else i.push(255-o)}var a=0;var s=i.length;for(n=0;n<s;n++){a+=i[n]*Math.pow(256,n)}return t?a:-1*a}var decodeOct=function(e,t,r){e=e.slice(t,t+r);t=0;if(e[t]&128){return parse256(e)}else{while(t<e.length&&e[t]===32)t++;var i=clamp(indexOf(e,32,t,e.length),e.length,e.length);while(t<i&&e[t]===0)t++;if(i===t)return 0;return parseInt(e.slice(t,i).toString(),8)}};var decodeStr=function(e,t,r,i){return e.slice(t,indexOf(e,0,t,t+r)).toString(i)};var addLength=function(e){var t=Buffer.byteLength(e);var r=Math.floor(Math.log(t)/Math.log(10))+1;if(t+r>=Math.pow(10,r))r++;return t+r+e};t.decodeLongPath=function(e,t){return decodeStr(e,0,e.length,t)};t.encodePax=function(e){var t="";if(e.name)t+=addLength(" path="+e.name+"\n");if(e.linkname)t+=addLength(" linkpath="+e.linkname+"\n");var r=e.pax;if(r){for(var n in r){t+=addLength(" "+n+"="+r[n]+"\n")}}return i(t)};t.decodePax=function(e){var t={};while(e.length){var r=0;while(r<e.length&&e[r]!==32)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString();var o=n.indexOf("=");if(o===-1)return t;t[n.slice(0,o)]=n.slice(o+1);e=e.slice(i)}return t};t.encode=function(e){var t=n(512);var r=e.name;var i="";if(e.typeflag===5&&r[r.length-1]!=="/")r+="/";if(Buffer.byteLength(r)!==r.length)return null;while(Buffer.byteLength(r)>100){var o=r.indexOf("/");if(o===-1)return null;i+=i?"/"+r.slice(0,o):r.slice(0,o);r=r.slice(o+1)}if(Buffer.byteLength(r)>100||Buffer.byteLength(i)>155)return null;if(e.linkname&&Buffer.byteLength(e.linkname)>100)return null;t.write(r);t.write(encodeOct(e.mode&l,6),100);t.write(encodeOct(e.uid,6),108);t.write(encodeOct(e.gid,6),116);t.write(encodeOct(e.size,11),124);t.write(encodeOct(e.mtime.getTime()/1e3|0,11),136);t[156]=s+toTypeflag(e.type);if(e.linkname)t.write(e.linkname,157);t.write(u,257);if(e.uname)t.write(e.uname,265);if(e.gname)t.write(e.gname,297);t.write(encodeOct(e.devmajor||0,6),329);t.write(encodeOct(e.devminor||0,6),337);if(i)t.write(i,345);t.write(encodeOct(cksum(t),6),148);return t};t.decode=function(e,t){var r=e[156]===0?0:e[156]-s;var i=decodeStr(e,0,100,t);var n=decodeOct(e,100,8);var o=decodeOct(e,108,8);var a=decodeOct(e,116,8);var u=decodeOct(e,124,12);var l=decodeOct(e,136,12);var c=toType(r);var d=e[157]===0?null:decodeStr(e,157,100,t);var p=decodeStr(e,265,32);var h=decodeStr(e,297,32);var m=decodeOct(e,329,8);var y=decodeOct(e,337,8);if(e[345])i=decodeStr(e,345,155,t)+"/"+i;if(r===0&&i&&i[i.length-1]==="/")r=5;var v=cksum(e);if(v===8*32)return null;if(v!==decodeOct(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:i,mode:n,uid:o,gid:a,size:u,mtime:new Date(1e3*l),type:c,linkname:d,uname:p,gname:h,devmajor:m,devminor:y}}},2283:function(e,t,r){t.extract=r(7882);t.pack=r(4930)},2730:function(e,t,r){var i=r(3874),n=r(3837),o=r(1867).Buffer;function BufferList(e){if(!(this instanceof BufferList))return new BufferList(e);this._bufs=[];this.length=0;if(typeof e=="function"){this._callback=e;var t=function piper(e){if(this._callback){this._callback(e);this._callback=null}}.bind(this);this.on("pipe",(function onPipe(e){e.on("error",t)}));this.on("unpipe",(function onUnpipe(e){e.removeListener("error",t)}))}else{this.append(e)}i.call(this)}n.inherits(BufferList,i);BufferList.prototype._offset=function _offset(e){var t=0,r=0,i;if(e===0)return[0,0];for(;r<this._bufs.length;r++){i=t+this._bufs[r].length;if(e<i||r==this._bufs.length-1)return[r,e-t];t=i}};BufferList.prototype.append=function append(e){var t=0;if(o.isBuffer(e)){this._appendBuffer(e)}else if(Array.isArray(e)){for(;t<e.length;t++)this.append(e[t])}else if(e instanceof BufferList){for(;t<e._bufs.length;t++)this.append(e._bufs[t])}else if(e!=null){if(typeof e=="number")e=e.toString();this._appendBuffer(o.from(e))}return this};BufferList.prototype._appendBuffer=function appendBuffer(e){this._bufs.push(e);this.length+=e.length};BufferList.prototype._write=function _write(e,t,r){this._appendBuffer(e);if(typeof r=="function")r()};BufferList.prototype._read=function _read(e){if(!this.length)return this.push(null);e=Math.min(e,this.length);this.push(this.slice(0,e));this.consume(e)};BufferList.prototype.end=function end(e){i.prototype.end.call(this,e);if(this._callback){this._callback(null,this.slice());this._callback=null}};BufferList.prototype.get=function get(e){return this.slice(e,e+1)[0]};BufferList.prototype.slice=function slice(e,t){if(typeof e=="number"&&e<0)e+=this.length;if(typeof t=="number"&&t<0)t+=this.length;return this.copy(null,0,e,t)};BufferList.prototype.copy=function copy(e,t,r,i){if(typeof r!="number"||r<0)r=0;if(typeof i!="number"||i>this.length)i=this.length;if(r>=this.length)return e||o.alloc(0);if(i<=0)return e||o.alloc(0);var copy=!!e,n=this._offset(r),a=i-r,s=a,u=copy&&t||0,l=n[1],c,d;if(r===0&&i==this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:o.concat(this._bufs,this.length)}for(d=0;d<this._bufs.length;d++){this._bufs[d].copy(e,u);u+=this._bufs[d].length}return e}if(s<=this._bufs[n[0]].length-l){return copy?this._bufs[n[0]].copy(e,t,l,l+s):this._bufs[n[0]].slice(l,l+s)}if(!copy)e=o.allocUnsafe(a);for(d=n[0];d<this._bufs.length;d++){c=this._bufs[d].length-l;if(s>c){this._bufs[d].copy(e,u,l);u+=c}else{this._bufs[d].copy(e,u,l,l+s);u+=c;break}s-=c;if(l)l=0}if(e.length>u)return e.slice(0,u);return e};BufferList.prototype.shallowSlice=function shallowSlice(e,t){e=e||0;t=t||this.length;if(e<0)e+=this.length;if(t<0)t+=this.length;var r=this._offset(e),i=this._offset(t),n=this._bufs.slice(r[0],i[0]+1);if(i[1]==0)n.pop();else n[n.length-1]=n[n.length-1].slice(0,i[1]);if(r[1]!=0)n[0]=n[0].slice(r[1]);return new BufferList(n)};BufferList.prototype.toString=function toString(e,t,r){return this.slice(t,r).toString(e)};BufferList.prototype.consume=function consume(e){e=Math.trunc(e);if(Number.isNaN(e)||e<=0)return this;while(this._bufs.length){if(e>=this._bufs[0].length){e-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(e);this.length-=e;break}}return this};BufferList.prototype.duplicate=function duplicate(){var e=0,t=new BufferList;for(;e<this._bufs.length;e++)t.append(this._bufs[e]);return t};BufferList.prototype.destroy=function destroy(){this._bufs.length=0;this.length=0;this.push(null)};(function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e){(function(t){BufferList.prototype[t]=function(r){return this.slice(r,r+e[t])[t](0)}})(t)}})();e.exports=BufferList},4930:function(e,t,r){var i=r(3186);var n=r(1205);var o=r(3837);var a=r(6615);var s=r(1259);var u=r(1642).Readable;var l=r(1642).Writable;var c=r(1576).StringDecoder;var d=r(8860);var p=parseInt("755",8);var h=parseInt("644",8);var m=a(1024);var noop=function(){};var overflow=function(e,t){t&=511;if(t)e.push(m.slice(0,512-t))};function modeToType(e){switch(e&i.S_IFMT){case i.S_IFBLK:return"block-device";case i.S_IFCHR:return"character-device";case i.S_IFDIR:return"directory";case i.S_IFIFO:return"fifo";case i.S_IFLNK:return"symlink"}return"file"}var Sink=function(e){l.call(this);this.written=0;this._to=e;this._destroyed=false};o.inherits(Sink,l);Sink.prototype._write=function(e,t,r){this.written+=e.length;if(this._to.push(e))return r();this._to._drain=r};Sink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var LinkSink=function(){l.call(this);this.linkname="";this._decoder=new c("utf-8");this._destroyed=false};o.inherits(LinkSink,l);LinkSink.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e);r()};LinkSink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Void=function(){l.call(this);this._destroyed=false};o.inherits(Void,l);Void.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Pack=function(e){if(!(this instanceof Pack))return new Pack(e);u.call(this,e);this._drain=noop;this._finalized=false;this._finalizing=false;this._destroyed=false;this._stream=null};o.inherits(Pack,u);Pack.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(this._finalized||this._destroyed)return;if(typeof t==="function"){r=t;t=null}if(!r)r=noop;var i=this;if(!e.size||e.type==="symlink")e.size=0;if(!e.type)e.type=modeToType(e.mode);if(!e.mode)e.mode=e.type==="directory"?p:h;if(!e.uid)e.uid=0;if(!e.gid)e.gid=0;if(!e.mtime)e.mtime=new Date;if(typeof t==="string")t=s(t);if(Buffer.isBuffer(t)){e.size=t.length;this._encode(e);this.push(t);overflow(i,e.size);process.nextTick(r);return new Void}if(e.type==="symlink"&&!e.linkname){var o=new LinkSink;n(o,(function(t){if(t){i.destroy();return r(t)}e.linkname=o.linkname;i._encode(e);r()}));return o}this._encode(e);if(e.type!=="file"&&e.type!=="contiguous-file"){process.nextTick(r);return new Void}var a=new Sink(this);this._stream=a;n(a,(function(t){i._stream=null;if(t){i.destroy();return r(t)}if(a.written!==e.size){i.destroy();return r(new Error("size mismatch"))}overflow(i,e.size);if(i._finalizing)i.finalize();r()}));return a};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(m);this.push(null)};Pack.prototype.destroy=function(e){if(this._destroyed)return;this._destroyed=true;if(e)this.emit("error",e);this.emit("close");if(this._stream&&this._stream.destroy)this._stream.destroy()};Pack.prototype._encode=function(e){if(!e.pax){var t=d.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Pack.prototype._encodePax=function(e){var t=d.encodePax({name:e.name,linkname:e.linkname,pax:e.pax});var r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(d.encode(r));this.push(t);overflow(this,t.length);r.size=e.size;r.type=e.type;this.push(d.encode(r))};Pack.prototype._read=function(e){var t=this._drain;this._drain=noop;t()};e.exports=Pack},421:function(e,t,r){var i=r(2781);t=e.exports=through;through.through=through;function through(e,t,r){e=e||function(e){this.queue(e)};t=t||function(){this.queue(null)};var n=false,o=false,a=[],s=false;var u=new i;u.readable=u.writable=true;u.paused=false;u.autoDestroy=!(r&&r.autoDestroy===false);u.write=function(t){e.call(this,t);return!u.paused};function drain(){while(a.length&&!u.paused){var e=a.shift();if(null===e)return u.emit("end");else u.emit("data",e)}}u.queue=u.push=function(e){if(s)return u;if(e===null)s=true;a.push(e);drain();return u};u.on("end",(function(){u.readable=false;if(!u.writable&&u.autoDestroy)process.nextTick((function(){u.destroy()}))}));function _end(){u.writable=false;t.call(u);if(!u.readable&&u.autoDestroy)u.destroy()}u.end=function(e){if(n)return;n=true;if(arguments.length)u.write(e);_end();return u};u.destroy=function(){if(o)return;o=true;n=true;a.length=0;u.writable=u.readable=false;u.emit("close");return u};u.pause=function(){if(u.paused)return;u.paused=true;return u};u.resume=function(){if(u.paused){u.paused=false;u.emit("resume")}drain();if(!u.paused)u.emit("drain");return u};return u}},1259:function(e){e.exports=toBuffer;var t=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from:bufferFrom;function bufferFrom(e,t){return new Buffer(e,t)}function toBuffer(e,r){if(Buffer.isBuffer(e))return e;if(typeof e==="string")return t(e,r);if(Array.isArray(e))return t(e);throw new Error("Input should be a buffer or a string")}},3467:function(e,t,r){var i=r(421);var n=r(2589);var o=r(7877);e.exports=unbzip2Stream;function unbzip2Stream(){var e=[];var t=0;var r=0;var a=false;var s=false;var u=null;var l=null;function decompressBlock(e){if(!r){r=n.header(u);l=0;return true}else{var t=1e5*r;var i=new Int32Array(t);var o=[];var f=function(e){o.push(e)};l=n.decompress(u,f,i,t,l);if(l===null){r=0;return false}else{e(Buffer.from(o));return true}}}var c=0;function decompressAndQueue(e){if(a)return;try{return decompressBlock((function(t){e.queue(t);if(t!==null){c+=t.length}else{}}))}catch(t){e.emit("error",t);a=true;return false}}return i((function write(i){e.push(i);t+=i.length;if(u===null){u=o((function(){return e.shift()}))}while(!a&&t-u.bytesRead+1>=(25e3+1e5*r||4)){decompressAndQueue(this)}}),(function end(e){while(!a&&u&&t>u.bytesRead){decompressAndQueue(this)}if(!a){if(l!==null)this.emit("error",new Error("input stream ended prematurely"));this.queue(null)}}))}},7877:function(e){var t=[0,1,3,7,15,31,63,127,255];e.exports=function bitIterator(e){var r=0,i=0;var n=e();var f=function(o){if(o===null&&r!=0){r=0;i++;return}var a=0;while(o>0){if(i>=n.length){i=0;n=e()}var s=8-r;if(r===0&&o>0)f.bytesRead++;if(o>=s){a<<=s;a|=t[s]&n[i++];r=0;o-=s}else{a<<=o;a|=(n[i]&t[o]<<8-o-r)>>8-o-r;r+=o;o=0}}return a};f.bytesRead=0;return f}},2589:function(e){function Bzip2Error(e){this.name="Bzip2Error";this.message=e;this.stack=(new Error).stack}Bzip2Error.prototype=new Error;var t={Error:function(e){throw new Bzip2Error(e)}};var r={};r.Bzip2Error=Bzip2Error;r.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];r.array=function(e){var t=0,r=0;var i=[0,1,3,7,15,31,63,127,255];return function(n){var o=0;while(n>0){var a=8-t;if(n>=a){o<<=a;o|=i[a]&e[r++];t=0;n-=a}else{o<<=n;o|=(e[r]&i[n]<<8-n-t)>>8-n-t;t+=n;n=0}}return o}};r.simple=function(e,t){var i=r.array(e);var n=r.header(i);var o=false;var a=1e5*n;var s=new Int32Array(a);do{o=r.decompress(i,t,s,a)}while(!o)};r.header=function(e){this.byteCount=new Int32Array(256);this.symToByte=new Uint8Array(256);this.mtfSymbol=new Int32Array(256);this.selectors=new Uint8Array(32768);if(e(8*3)!=4348520)t.Error("No magic number found");var r=e(8)-48;if(r<1||r>9)t.Error("Not a BZIP archive");return r};r.decompress=function(e,r,i,n,o){var a=20;var s=258;var u=0;var l=1;var c=50;var d=0^-1;for(var p="",h=0;h<6;h++)p+=e(8).toString(16);if(p=="177245385090"){var m=e(32)|0;if(m!==o)t.Error("Error in bzip2: crc32 do not match");e(null);return null}if(p!="314159265359")t.Error("eek not valid bzip data");var y=e(32)|0;if(e(1))t.Error("unsupported obsolete version");var v=e(24);if(v>n)t.Error("Initial position larger than buffer size");var g=e(16);var b=0;for(h=0;h<16;h++){if(g&1<<15-h){var w=e(16);for(E=0;E<16;E++){if(w&1<<15-E){this.symToByte[b++]=16*h+E}}}}var x=e(3);if(x<2||x>6)t.Error("another error");var _=e(15);if(_==0)t.Error("meh");for(var h=0;h<x;h++)this.mtfSymbol[h]=h;for(var h=0;h<_;h++){for(var E=0;e(1);E++)if(E>=x)t.Error("whoops another error");var S=this.mtfSymbol[E];for(var w=E-1;w>=0;w--){this.mtfSymbol[w+1]=this.mtfSymbol[w]}this.mtfSymbol[0]=S;this.selectors[h]=S}var k=b+2;var B=[];var R=new Uint8Array(s),C=new Uint16Array(a+1);var T;for(var E=0;E<x;E++){g=e(5);for(var h=0;h<k;h++){while(true){if(g<1||g>a)t.Error("I gave up a while ago on writing error messages");if(!e(1))break;if(!e(1))g++;else g--}R[h]=g}var O,A;O=A=R[0];for(var h=1;h<k;h++){if(R[h]>A)A=R[h];else if(R[h]<O)O=R[h]}T=B[E]={};T.permute=new Int32Array(s);T.limit=new Int32Array(a+1);T.base=new Int32Array(a+1);T.minLen=O;T.maxLen=A;var L=T.base;var z=T.limit;var F=0;for(var h=O;h<=A;h++)for(var g=0;g<k;g++)if(R[g]==h)T.permute[F++]=g;for(h=O;h<=A;h++)C[h]=z[h]=0;for(h=0;h<k;h++)C[R[h]]++;F=g=0;for(h=O;h<A;h++){F+=C[h];z[h]=F-1;F<<=1;L[h+1]=F-(g+=C[h])}z[A]=F+C[A]-1;L[O]=0}for(var h=0;h<256;h++){this.mtfSymbol[h]=h;this.byteCount[h]=0}var j,P,k,N;j=P=k=N=0;while(true){if(!k--){k=c-1;if(N>=_)t.Error("meow i'm a kitty, that's an error");T=B[this.selectors[N++]];L=T.base;z=T.limit}h=T.minLen;E=e(h);while(true){if(h>T.maxLen)t.Error("rawr i'm a dinosaur");if(E<=z[h])break;h++;E=E<<1|e(1)}E-=L[h];if(E<0||E>=s)t.Error("moo i'm a cow");var I=T.permute[E];if(I==u||I==l){if(!j){j=1;g=0}if(I==u)g+=j;else g+=2*j;j<<=1;continue}if(j){j=0;if(P+g>n)t.Error("Boom.");S=this.symToByte[this.mtfSymbol[0]];this.byteCount[S]+=g;while(g--)i[P++]=S}if(I>b)break;if(P>=n)t.Error("I can't think of anything. Error");h=I-1;S=this.mtfSymbol[h];for(var w=h-1;w>=0;w--){this.mtfSymbol[w+1]=this.mtfSymbol[w]}this.mtfSymbol[0]=S;S=this.symToByte[S];this.byteCount[S]++;i[P++]=S}if(v<0||v>=P)t.Error("I'm a monkey and I'm throwing something at someone, namely you");var E=0;for(var h=0;h<256;h++){w=E+this.byteCount[h];this.byteCount[h]=E;E=w}for(var h=0;h<P;h++){S=i[h]&255;i[this.byteCount[S]]|=h<<8;this.byteCount[S]++}var M=0,U=0,D=0;if(P){M=i[v];U=M&255;M>>=8;D=-1}P=P;var W,q,$;while(P){P--;q=U;M=i[M];U=M&255;M>>=8;if(D++==3){W=U;$=q;U=-1}else{W=1;$=U}while(W--){d=(d<<8^this.crcTable[(d>>24^$)&255])&4294967295;r($)}if(U!=q)D=0}d=(d^-1)>>>0;if((d|0)!=(y|0))t.Error("Error in bzip2: crc32 do not match");o=(d^(o<<1|o>>>31))&4294967295;return o};e.exports=r},5278:function(e,t,r){e.exports=r(3837).deprecate},2940:function(e){e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var i=e.apply(this,t);var n=t[t.length-1];if(typeof i==="function"&&i!==n){Object.keys(n).forEach((function(e){i[e]=n[e]}))}return i}}},1208:function(e){e.exports=extend;var t=Object.prototype.hasOwnProperty;function extend(){var e={};for(var r=0;r<arguments.length;r++){var i=arguments[r];for(var n in i){if(t.call(i,n)){e[n]=i[n]}}}return e}},8781:function(e,t,r){var i=r(7147);var n=r(9796);var o=r(5010);var a=r(4794);var s=r(3837);var u=r(2361).EventEmitter;var l=r(2781).Transform;var c=r(2781).PassThrough;var d=r(2781).Writable;t.open=open;t.fromFd=fromFd;t.fromBuffer=fromBuffer;t.fromRandomAccessReader=fromRandomAccessReader;t.dosDateTimeToDate=dosDateTimeToDate;t.validateFileName=validateFileName;t.ZipFile=ZipFile;t.Entry=Entry;t.RandomAccessReader=RandomAccessReader;function open(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=true;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;i.open(e,"r",(function(e,n){if(e)return r(e);fromFd(n,t,(function(e,t){if(e)i.close(n,defaultCallback);r(e,t)}))}))}function fromFd(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;i.fstat(e,(function(i,n){if(i)return r(i);var a=o.createFromFd(e,{autoClose:true});fromRandomAccessReader(a,n.size,t,r)}))}function fromBuffer(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;var i=o.createFromBuffer(e,{maxChunkSize:65536});fromRandomAccessReader(i,e.length,t,r)}function fromRandomAccessReader(e,t,r,i){if(typeof r==="function"){i=r;r=null}if(r==null)r={};if(r.autoClose==null)r.autoClose=true;if(r.lazyEntries==null)r.lazyEntries=false;if(r.decodeStrings==null)r.decodeStrings=true;var n=!!r.decodeStrings;if(r.validateEntrySizes==null)r.validateEntrySizes=true;if(r.strictFileNames==null)r.strictFileNames=false;if(i==null)i=defaultCallback;if(typeof t!=="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}e.ref();var o=22;var a=65535;var s=Math.min(o+a,t);var u=h(s);var l=t-u.length;readAndAssertNoEof(e,u,0,s,l,(function(a){if(a)return i(a);for(var c=s-o;c>=0;c-=1){if(u.readUInt32LE(c)!==101010256)continue;var d=u.slice(c);var p=d.readUInt16LE(4);if(p!==0){return i(new Error("multi-disk zip files are not supported: found disk number: "+p))}var m=d.readUInt16LE(10);var y=d.readUInt32LE(16);var v=d.readUInt16LE(20);var g=d.length-o;if(v!==g){return i(new Error("invalid comment length. expected: "+g+". found: "+v))}var b=n?decodeBuffer(d,22,d.length,false):d.slice(22);if(!(m===65535||y===4294967295)){return i(null,new ZipFile(e,y,t,m,b,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames))}var w=h(20);var x=l+c-w.length;readAndAssertNoEof(e,w,0,w.length,x,(function(o){if(o)return i(o);if(w.readUInt32LE(0)!==117853008){return i(new Error("invalid zip64 end of central directory locator signature"))}var a=readUInt64LE(w,8);var s=h(56);readAndAssertNoEof(e,s,0,s.length,a,(function(o){if(o)return i(o);if(s.readUInt32LE(0)!==101075792){return i(new Error("invalid zip64 end of central directory record signature"))}m=readUInt64LE(s,32);y=readUInt64LE(s,48);return i(null,new ZipFile(e,y,t,m,b,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames))}))}));return}i(new Error("end of central directory record signature not found"))}))}s.inherits(ZipFile,u);function ZipFile(e,t,r,i,n,o,a,s,l,c){var d=this;u.call(d);d.reader=e;d.reader.on("error",(function(e){emitError(d,e)}));d.reader.once("close",(function(){d.emit("close")}));d.readEntryCursor=t;d.fileSize=r;d.entryCount=i;d.comment=n;d.entriesRead=0;d.autoClose=!!o;d.lazyEntries=!!a;d.decodeStrings=!!s;d.validateEntrySizes=!!l;d.strictFileNames=!!c;d.isOpen=true;d.emittedError=false;if(!d.lazyEntries)d._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(e,t){if(e.autoClose)e.close();emitError(e,t)}function emitError(e,t){if(e.emittedError)return;e.emittedError=true;e.emit("error",t)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate((function(){if(e.autoClose)e.close();if(e.emittedError)return;e.emit("end")}));return}if(e.emittedError)return;var t=h(46);readAndAssertNoEof(e.reader,t,0,t.length,e.readEntryCursor,(function(r){if(r)return emitErrorAndAutoClose(e,r);if(e.emittedError)return;var i=new Entry;var n=t.readUInt32LE(0);if(n!==33639248)return emitErrorAndAutoClose(e,new Error("invalid central directory file header signature: 0x"+n.toString(16)));i.versionMadeBy=t.readUInt16LE(4);i.versionNeededToExtract=t.readUInt16LE(6);i.generalPurposeBitFlag=t.readUInt16LE(8);i.compressionMethod=t.readUInt16LE(10);i.lastModFileTime=t.readUInt16LE(12);i.lastModFileDate=t.readUInt16LE(14);i.crc32=t.readUInt32LE(16);i.compressedSize=t.readUInt32LE(20);i.uncompressedSize=t.readUInt32LE(24);i.fileNameLength=t.readUInt16LE(28);i.extraFieldLength=t.readUInt16LE(30);i.fileCommentLength=t.readUInt16LE(32);i.internalFileAttributes=t.readUInt16LE(36);i.externalFileAttributes=t.readUInt32LE(38);i.relativeOffsetOfLocalHeader=t.readUInt32LE(42);if(i.generalPurposeBitFlag&64)return emitErrorAndAutoClose(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46;t=h(i.fileNameLength+i.extraFieldLength+i.fileCommentLength);readAndAssertNoEof(e.reader,t,0,t.length,e.readEntryCursor,(function(r){if(r)return emitErrorAndAutoClose(e,r);if(e.emittedError)return;var n=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?decodeBuffer(t,0,i.fileNameLength,n):t.slice(0,i.fileNameLength);var o=i.fileNameLength+i.extraFieldLength;var s=t.slice(i.fileNameLength,o);i.extraFields=[];var u=0;while(u<s.length-3){var l=s.readUInt16LE(u+0);var c=s.readUInt16LE(u+2);var d=u+4;var p=d+c;if(p>s.length)return emitErrorAndAutoClose(e,new Error("extra field length exceeds extra field buffer size"));var m=h(c);s.copy(m,0,d,p);i.extraFields.push({id:l,data:m});u=p}i.fileComment=e.decodeStrings?decodeBuffer(t,o,o+i.fileCommentLength,n):t.slice(o,o+i.fileCommentLength);i.comment=i.fileComment;e.readEntryCursor+=t.length;e.entriesRead+=1;if(i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){var y=null;for(var u=0;u<i.extraFields.length;u++){var v=i.extraFields[u];if(v.id===1){y=v.data;break}}if(y==null){return emitErrorAndAutoClose(e,new Error("expected zip64 extended information extra field"))}var g=0;if(i.uncompressedSize===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include uncompressed size"))}i.uncompressedSize=readUInt64LE(y,g);g+=8}if(i.compressedSize===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include compressed size"))}i.compressedSize=readUInt64LE(y,g);g+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include relative header offset"))}i.relativeOffsetOfLocalHeader=readUInt64LE(y,g);g+=8}}if(e.decodeStrings){for(var u=0;u<i.extraFields.length;u++){var v=i.extraFields[u];if(v.id===28789){if(v.data.length<6){continue}if(v.data.readUInt8(0)!==1){continue}var b=v.data.readUInt32LE(1);if(a.unsigned(t.slice(0,i.fileNameLength))!==b){continue}i.fileName=decodeBuffer(v.data,5,v.data.length,true);break}}}if(e.validateEntrySizes&&i.compressionMethod===0){var w=i.uncompressedSize;if(i.isEncrypted()){w+=12}if(i.compressedSize!==w){var x="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return emitErrorAndAutoClose(e,new Error(x))}}if(e.decodeStrings){if(!e.strictFileNames){i.fileName=i.fileName.replace(/\\/g,"/")}var _=validateFileName(i.fileName,e.validateFileNameOptions);if(_!=null)return emitErrorAndAutoClose(e,new Error(_))}e.emit("entry",i);if(!e.lazyEntries)e._readEntry()}))}))};ZipFile.prototype.openReadStream=function(e,t,r){var i=this;var o=0;var a=e.compressedSize;if(r==null){r=t;t={}}else{if(t.decrypt!=null){if(!e.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(t.decrypt!==false)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()){if(t.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(t.decompress!=null){if(!e.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(t.decompress===false||t.decompress===true)){throw new Error("invalid options.decompress value: "+t.decompress)}}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(e.isEncrypted()&&t.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(t.start!=null){o=t.start;if(o<0)throw new Error("options.start < 0");if(o>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){a=t.end;if(a<0)throw new Error("options.end < 0");if(a>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(a<o)throw new Error("options.end < options.start")}}if(!i.isOpen)return r(new Error("closed"));if(e.isEncrypted()){if(t.decrypt!==false)return r(new Error("entry is encrypted, and options.decrypt !== false"))}i.reader.ref();var s=h(30);readAndAssertNoEof(i.reader,s,0,s.length,e.relativeOffsetOfLocalHeader,(function(u){try{if(u)return r(u);var l=s.readUInt32LE(0);if(l!==67324752){return r(new Error("invalid local file header signature: 0x"+l.toString(16)))}var c=s.readUInt16LE(26);var d=s.readUInt16LE(28);var p=e.relativeOffsetOfLocalHeader+s.length+c+d;var h;if(e.compressionMethod===0){h=false}else if(e.compressionMethod===8){h=t.decompress!=null?t.decompress:true}else{return r(new Error("unsupported compression method: "+e.compressionMethod))}var m=p;var y=m+e.compressedSize;if(e.compressedSize!==0){if(y>i.fileSize){return r(new Error("file data overflows file bounds: "+m+" + "+e.compressedSize+" > "+i.fileSize))}}var v=i.reader.createReadStream({start:m+o,end:m+a});var g=v;if(h){var b=false;var w=n.createInflateRaw();v.on("error",(function(e){setImmediate((function(){if(!b)w.emit("error",e)}))}));v.pipe(w);if(i.validateEntrySizes){g=new AssertByteCountStream(e.uncompressedSize);w.on("error",(function(e){setImmediate((function(){if(!b)g.emit("error",e)}))}));w.pipe(g)}else{g=w}g.destroy=function(){b=true;if(w!==g)w.unpipe(g);v.unpipe(w);v.destroy()}}r(null,g)}finally{i.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(e,t){var r=e&31;var i=(e>>5&15)-1;var n=(e>>9&127)+1980;var o=0;var a=(t&31)*2;var s=t>>5&63;var u=t>>11&31;return new Date(n,i,r,u,s,a,o)}function validateFileName(e){if(e.indexOf("\\")!==-1){return"invalid characters in fileName: "+e}if(/^[a-zA-Z]:/.test(e)||/^\//.test(e)){return"absolute path: "+e}if(e.split("/").indexOf("..")!==-1){return"invalid relative path: "+e}return null}function readAndAssertNoEof(e,t,r,i,n,o){if(i===0){return setImmediate((function(){o(null,h(0))}))}e.read(t,r,i,n,(function(e,t){if(e)return o(e);if(t<i){return o(new Error("unexpected EOF"))}o()}))}s.inherits(AssertByteCountStream,l);function AssertByteCountStream(e){l.call(this);this.actualByteCount=0;this.expectedByteCount=e}AssertByteCountStream.prototype._transform=function(e,t,r){this.actualByteCount+=e.length;if(this.actualByteCount>this.expectedByteCount){var i="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(i))}r(null,e)};AssertByteCountStream.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};s.inherits(RandomAccessReader,u);function RandomAccessReader(){u.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(onCloseDone);function onCloseDone(t){if(t)return e.emit("error",t);e.emit("close")}};RandomAccessReader.prototype.createReadStream=function(e){var t=e.start;var r=e.end;if(t===r){var i=new c;setImmediate((function(){i.end()}));return i}var n=this._readStreamForRange(t,r);var o=false;var a=new RefUnrefFilter(this);n.on("error",(function(e){setImmediate((function(){if(!o)a.emit("error",e)}))}));a.destroy=function(){n.unpipe(a);a.unref();n.destroy()};var s=new AssertByteCountStream(r-t);a.on("error",(function(e){setImmediate((function(){if(!o)s.emit("error",e)}))}));s.destroy=function(){o=true;a.unpipe(s);a.destroy()};return n.pipe(a).pipe(s)};RandomAccessReader.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(e,t,r,i,n){var o=this.createReadStream({start:i,end:i+r});var a=new d;var s=0;a._write=function(r,i,n){r.copy(e,t+s,0,r.length);s+=r.length;n()};a.on("finish",n);o.on("error",(function(e){n(e)}));o.pipe(a)};RandomAccessReader.prototype.close=function(e){setImmediate(e)};s.inherits(RefUnrefFilter,c);function RefUnrefFilter(e){c.call(this);this.context=e;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(e){this.unref();e()};RefUnrefFilter.prototype.unref=function(e){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var p="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(e,t,r,i){if(i){return e.toString("utf8",t,r)}else{var n="";for(var o=t;o<r;o++){n+=p[e[o]]}return n}}function readUInt64LE(e,t){var r=e.readUInt32LE(t);var i=e.readUInt32LE(t+4);return i*4294967296+r}var h;if(typeof Buffer.allocUnsafe==="function"){h=function(e){return Buffer.allocUnsafe(e)}}else{h=function(e){return new Buffer(e)}}function defaultCallback(e){if(e)throw e}},9491:function(e){"use strict";e.exports=require("assert")},4300:function(e){"use strict";e.exports=require("buffer")},2057:function(e){"use strict";e.exports=require("constants")},2361:function(e){"use strict";e.exports=require("events")},7147:function(e){"use strict";e.exports=require("fs")},1017:function(e){"use strict";e.exports=require("path")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")},6507:function(e){"use strict";e.exports=JSON.parse('{"name":"seek-bzip","version":"1.0.6","contributors":["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],"description":"a pure-JavaScript Node.JS module for random-access decoding bzip2 data","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/cscott/seek-bzip.git"},"license":"MIT","bin":{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},"directories":{"test":"test"},"dependencies":{"commander":"^2.8.1"},"devDependencies":{"fibers":"~1.0.6","mocha":"~2.2.5"},"scripts":{"test":"mocha"}}')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={exports:{}};var o=true;try{e[r](n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(9350);module.exports=r})();
16
+ */const i=r(1017);const n=r(3837);const o=r(3316);e.exports=function stripDirs(e,t,r){if(typeof e!=="string"){throw new TypeError(n.inspect(e)+" is not a string. First argument to strip-dirs must be a path string.")}if(i.posix.isAbsolute(e)||i.win32.isAbsolute(e)){throw new Error(`${e} is an absolute path. strip-dirs requires a relative path.`)}if(!o(t,{includeZero:true})){throw new Error("The Second argument of strip-dirs must be a natural number or 0, but received "+n.inspect(t)+".")}if(r){if(typeof r!=="object"){throw new TypeError(n.inspect(r)+" is not an object. Expected an object with a boolean `disallowOverflow` property.")}if(Array.isArray(r)){throw new TypeError(n.inspect(r)+" is an array. Expected an object with a boolean `disallowOverflow` property.")}if("disallowOverflow"in r&&typeof r.disallowOverflow!=="boolean"){throw new TypeError(n.inspect(r.disallowOverflow)+" is neither true nor false. `disallowOverflow` option must be a Boolean value.")}}else{r={disallowOverflow:false}}const a=i.normalize(e).split(i.sep);if(a.length>1&&a[0]==="."){a.shift()}if(t>a.length-1){if(r.disallowOverflow){throw new RangeError("Cannot strip more directories than there are.")}t=a.length-1}return i.join.apply(null,a.slice(t))}},7882:function(e,t,r){var i=r(3837);var n=r(2730);var o=r(1208);var a=r(8860);var s=r(1642).Writable;var u=r(1642).PassThrough;var noop=function(){};var overflow=function(e){e&=511;return e&&512-e};var emptyStream=function(e,t){var r=new Source(e,t);r.end();return r};var mixinPax=function(e,t){if(t.path)e.name=t.path;if(t.linkpath)e.linkname=t.linkpath;if(t.size)e.size=parseInt(t.size,10);e.pax=t;return e};var Source=function(e,t){this._parent=e;this.offset=t;u.call(this)};i.inherits(Source,u);Source.prototype.destroy=function(e){this._parent.destroy(e)};var Extract=function(e){if(!(this instanceof Extract))return new Extract(e);s.call(this,e);e=e||{};this._offset=0;this._buffer=n();this._missing=0;this._partial=false;this._onparse=noop;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var t=this;var r=t._buffer;var oncontinue=function(){t._continue()};var onunlock=function(e){t._locked=false;if(e)return t.destroy(e);if(!t._stream)oncontinue()};var onstreamend=function(){t._stream=null;var e=overflow(t._header.size);if(e)t._parse(e,ondrain);else t._parse(512,onheader);if(!t._locked)oncontinue()};var ondrain=function(){t._buffer.consume(overflow(t._header.size));t._parse(512,onheader);oncontinue()};var onpaxglobalheader=function(){var e=t._header.size;t._paxGlobal=a.decodePax(r.slice(0,e));r.consume(e);onstreamend()};var onpaxheader=function(){var e=t._header.size;t._pax=a.decodePax(r.slice(0,e));if(t._paxGlobal)t._pax=o(t._paxGlobal,t._pax);r.consume(e);onstreamend()};var ongnulongpath=function(){var i=t._header.size;this._gnuLongPath=a.decodeLongPath(r.slice(0,i),e.filenameEncoding);r.consume(i);onstreamend()};var ongnulonglinkpath=function(){var i=t._header.size;this._gnuLongLinkPath=a.decodeLongPath(r.slice(0,i),e.filenameEncoding);r.consume(i);onstreamend()};var onheader=function(){var i=t._offset;var n;try{n=t._header=a.decode(r.slice(0,512),e.filenameEncoding)}catch(e){t.emit("error",e)}r.consume(512);if(!n){t._parse(512,onheader);oncontinue();return}if(n.type==="gnu-long-path"){t._parse(n.size,ongnulongpath);oncontinue();return}if(n.type==="gnu-long-link-path"){t._parse(n.size,ongnulonglinkpath);oncontinue();return}if(n.type==="pax-global-header"){t._parse(n.size,onpaxglobalheader);oncontinue();return}if(n.type==="pax-header"){t._parse(n.size,onpaxheader);oncontinue();return}if(t._gnuLongPath){n.name=t._gnuLongPath;t._gnuLongPath=null}if(t._gnuLongLinkPath){n.linkname=t._gnuLongLinkPath;t._gnuLongLinkPath=null}if(t._pax){t._header=n=mixinPax(n,t._pax);t._pax=null}t._locked=true;if(!n.size||n.type==="directory"){t._parse(512,onheader);t.emit("entry",n,emptyStream(t,i),onunlock);return}t._stream=new Source(t,i);t.emit("entry",n,t._stream,onunlock);t._parse(n.size,onstreamend);oncontinue()};this._onheader=onheader;this._parse(512,onheader)};i.inherits(Extract,s);Extract.prototype.destroy=function(e){if(this._destroyed)return;this._destroyed=true;if(e)this.emit("error",e);this.emit("close");if(this._stream)this._stream.emit("close")};Extract.prototype._parse=function(e,t){if(this._destroyed)return;this._offset+=e;this._missing=e;if(t===this._onheader)this._partial=false;this._onparse=t};Extract.prototype._continue=function(){if(this._destroyed)return;var e=this._cb;this._cb=noop;if(this._overflow)this._write(this._overflow,undefined,e);else e()};Extract.prototype._write=function(e,t,r){if(this._destroyed)return;var i=this._stream;var n=this._buffer;var o=this._missing;if(e.length)this._partial=true;if(e.length<o){this._missing-=e.length;this._overflow=null;if(i)return i.write(e,r);n.append(e);return r()}this._cb=r;this._missing=0;var a=null;if(e.length>o){a=e.slice(o);e=e.slice(0,o)}if(i)i.end(e);else n.append(e);this._overflow=a;this._onparse()};Extract.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};e.exports=Extract},8860:function(e,t,r){var i=r(7287);var n=r(6615);var o="0000000000000000000";var a="7777777777777777777";var s="0".charCodeAt(0);var u="ustar\x0000";var l=parseInt("7777",8);var clamp=function(e,t,r){if(typeof e!=="number")return r;e=~~e;if(e>=t)return t;if(e>=0)return e;e+=t;if(e>=0)return e;return 0};var toType=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null};var toTypeflag=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0};var indexOf=function(e,t,r,i){for(;r<i;r++){if(e[r]===t)return r}return i};var cksum=function(e){var t=8*32;for(var r=0;r<148;r++)t+=e[r];for(var i=156;i<512;i++)t+=e[i];return t};var encodeOct=function(e,t){e=e.toString(8);if(e.length>t)return a.slice(0,t)+" ";else return o.slice(0,t-e.length)+e+" "};function parse256(e){var t;if(e[0]===128)t=true;else if(e[0]===255)t=false;else return null;var r=false;var i=[];for(var n=e.length-1;n>0;n--){var o=e[n];if(t)i.push(o);else if(r&&o===0)i.push(0);else if(r){r=false;i.push(256-o)}else i.push(255-o)}var a=0;var s=i.length;for(n=0;n<s;n++){a+=i[n]*Math.pow(256,n)}return t?a:-1*a}var decodeOct=function(e,t,r){e=e.slice(t,t+r);t=0;if(e[t]&128){return parse256(e)}else{while(t<e.length&&e[t]===32)t++;var i=clamp(indexOf(e,32,t,e.length),e.length,e.length);while(t<i&&e[t]===0)t++;if(i===t)return 0;return parseInt(e.slice(t,i).toString(),8)}};var decodeStr=function(e,t,r,i){return e.slice(t,indexOf(e,0,t,t+r)).toString(i)};var addLength=function(e){var t=Buffer.byteLength(e);var r=Math.floor(Math.log(t)/Math.log(10))+1;if(t+r>=Math.pow(10,r))r++;return t+r+e};t.decodeLongPath=function(e,t){return decodeStr(e,0,e.length,t)};t.encodePax=function(e){var t="";if(e.name)t+=addLength(" path="+e.name+"\n");if(e.linkname)t+=addLength(" linkpath="+e.linkname+"\n");var r=e.pax;if(r){for(var n in r){t+=addLength(" "+n+"="+r[n]+"\n")}}return i(t)};t.decodePax=function(e){var t={};while(e.length){var r=0;while(r<e.length&&e[r]!==32)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString();var o=n.indexOf("=");if(o===-1)return t;t[n.slice(0,o)]=n.slice(o+1);e=e.slice(i)}return t};t.encode=function(e){var t=n(512);var r=e.name;var i="";if(e.typeflag===5&&r[r.length-1]!=="/")r+="/";if(Buffer.byteLength(r)!==r.length)return null;while(Buffer.byteLength(r)>100){var o=r.indexOf("/");if(o===-1)return null;i+=i?"/"+r.slice(0,o):r.slice(0,o);r=r.slice(o+1)}if(Buffer.byteLength(r)>100||Buffer.byteLength(i)>155)return null;if(e.linkname&&Buffer.byteLength(e.linkname)>100)return null;t.write(r);t.write(encodeOct(e.mode&l,6),100);t.write(encodeOct(e.uid,6),108);t.write(encodeOct(e.gid,6),116);t.write(encodeOct(e.size,11),124);t.write(encodeOct(e.mtime.getTime()/1e3|0,11),136);t[156]=s+toTypeflag(e.type);if(e.linkname)t.write(e.linkname,157);t.write(u,257);if(e.uname)t.write(e.uname,265);if(e.gname)t.write(e.gname,297);t.write(encodeOct(e.devmajor||0,6),329);t.write(encodeOct(e.devminor||0,6),337);if(i)t.write(i,345);t.write(encodeOct(cksum(t),6),148);return t};t.decode=function(e,t){var r=e[156]===0?0:e[156]-s;var i=decodeStr(e,0,100,t);var n=decodeOct(e,100,8);var o=decodeOct(e,108,8);var a=decodeOct(e,116,8);var u=decodeOct(e,124,12);var l=decodeOct(e,136,12);var c=toType(r);var d=e[157]===0?null:decodeStr(e,157,100,t);var p=decodeStr(e,265,32);var h=decodeStr(e,297,32);var m=decodeOct(e,329,8);var y=decodeOct(e,337,8);if(e[345])i=decodeStr(e,345,155,t)+"/"+i;if(r===0&&i&&i[i.length-1]==="/")r=5;var v=cksum(e);if(v===8*32)return null;if(v!==decodeOct(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:i,mode:n,uid:o,gid:a,size:u,mtime:new Date(1e3*l),type:c,linkname:d,uname:p,gname:h,devmajor:m,devminor:y}}},2283:function(e,t,r){t.extract=r(7882);t.pack=r(4930)},2730:function(e,t,r){var i=r(3874),n=r(3837),o=r(1867).Buffer;function BufferList(e){if(!(this instanceof BufferList))return new BufferList(e);this._bufs=[];this.length=0;if(typeof e=="function"){this._callback=e;var t=function piper(e){if(this._callback){this._callback(e);this._callback=null}}.bind(this);this.on("pipe",(function onPipe(e){e.on("error",t)}));this.on("unpipe",(function onUnpipe(e){e.removeListener("error",t)}))}else{this.append(e)}i.call(this)}n.inherits(BufferList,i);BufferList.prototype._offset=function _offset(e){var t=0,r=0,i;if(e===0)return[0,0];for(;r<this._bufs.length;r++){i=t+this._bufs[r].length;if(e<i||r==this._bufs.length-1)return[r,e-t];t=i}};BufferList.prototype.append=function append(e){var t=0;if(o.isBuffer(e)){this._appendBuffer(e)}else if(Array.isArray(e)){for(;t<e.length;t++)this.append(e[t])}else if(e instanceof BufferList){for(;t<e._bufs.length;t++)this.append(e._bufs[t])}else if(e!=null){if(typeof e=="number")e=e.toString();this._appendBuffer(o.from(e))}return this};BufferList.prototype._appendBuffer=function appendBuffer(e){this._bufs.push(e);this.length+=e.length};BufferList.prototype._write=function _write(e,t,r){this._appendBuffer(e);if(typeof r=="function")r()};BufferList.prototype._read=function _read(e){if(!this.length)return this.push(null);e=Math.min(e,this.length);this.push(this.slice(0,e));this.consume(e)};BufferList.prototype.end=function end(e){i.prototype.end.call(this,e);if(this._callback){this._callback(null,this.slice());this._callback=null}};BufferList.prototype.get=function get(e){return this.slice(e,e+1)[0]};BufferList.prototype.slice=function slice(e,t){if(typeof e=="number"&&e<0)e+=this.length;if(typeof t=="number"&&t<0)t+=this.length;return this.copy(null,0,e,t)};BufferList.prototype.copy=function copy(e,t,r,i){if(typeof r!="number"||r<0)r=0;if(typeof i!="number"||i>this.length)i=this.length;if(r>=this.length)return e||o.alloc(0);if(i<=0)return e||o.alloc(0);var copy=!!e,n=this._offset(r),a=i-r,s=a,u=copy&&t||0,l=n[1],c,d;if(r===0&&i==this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:o.concat(this._bufs,this.length)}for(d=0;d<this._bufs.length;d++){this._bufs[d].copy(e,u);u+=this._bufs[d].length}return e}if(s<=this._bufs[n[0]].length-l){return copy?this._bufs[n[0]].copy(e,t,l,l+s):this._bufs[n[0]].slice(l,l+s)}if(!copy)e=o.allocUnsafe(a);for(d=n[0];d<this._bufs.length;d++){c=this._bufs[d].length-l;if(s>c){this._bufs[d].copy(e,u,l);u+=c}else{this._bufs[d].copy(e,u,l,l+s);u+=c;break}s-=c;if(l)l=0}if(e.length>u)return e.slice(0,u);return e};BufferList.prototype.shallowSlice=function shallowSlice(e,t){e=e||0;t=t||this.length;if(e<0)e+=this.length;if(t<0)t+=this.length;var r=this._offset(e),i=this._offset(t),n=this._bufs.slice(r[0],i[0]+1);if(i[1]==0)n.pop();else n[n.length-1]=n[n.length-1].slice(0,i[1]);if(r[1]!=0)n[0]=n[0].slice(r[1]);return new BufferList(n)};BufferList.prototype.toString=function toString(e,t,r){return this.slice(t,r).toString(e)};BufferList.prototype.consume=function consume(e){e=Math.trunc(e);if(Number.isNaN(e)||e<=0)return this;while(this._bufs.length){if(e>=this._bufs[0].length){e-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(e);this.length-=e;break}}return this};BufferList.prototype.duplicate=function duplicate(){var e=0,t=new BufferList;for(;e<this._bufs.length;e++)t.append(this._bufs[e]);return t};BufferList.prototype.destroy=function destroy(){this._bufs.length=0;this.length=0;this.push(null)};(function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e){(function(t){BufferList.prototype[t]=function(r){return this.slice(r,r+e[t])[t](0)}})(t)}})();e.exports=BufferList},7287:function(e){e.exports=toBuffer;var t=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from:bufferFrom;function bufferFrom(e,t){return new Buffer(e,t)}function toBuffer(e,r){if(Buffer.isBuffer(e))return e;if(typeof e==="string")return t(e,r);if(Array.isArray(e))return t(e);throw new Error("Input should be a buffer or a string")}},4930:function(e,t,r){var i=r(3186);var n=r(1205);var o=r(3837);var a=r(6615);var s=r(7287);var u=r(1642).Readable;var l=r(1642).Writable;var c=r(1576).StringDecoder;var d=r(8860);var p=parseInt("755",8);var h=parseInt("644",8);var m=a(1024);var noop=function(){};var overflow=function(e,t){t&=511;if(t)e.push(m.slice(0,512-t))};function modeToType(e){switch(e&i.S_IFMT){case i.S_IFBLK:return"block-device";case i.S_IFCHR:return"character-device";case i.S_IFDIR:return"directory";case i.S_IFIFO:return"fifo";case i.S_IFLNK:return"symlink"}return"file"}var Sink=function(e){l.call(this);this.written=0;this._to=e;this._destroyed=false};o.inherits(Sink,l);Sink.prototype._write=function(e,t,r){this.written+=e.length;if(this._to.push(e))return r();this._to._drain=r};Sink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var LinkSink=function(){l.call(this);this.linkname="";this._decoder=new c("utf-8");this._destroyed=false};o.inherits(LinkSink,l);LinkSink.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e);r()};LinkSink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Void=function(){l.call(this);this._destroyed=false};o.inherits(Void,l);Void.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Pack=function(e){if(!(this instanceof Pack))return new Pack(e);u.call(this,e);this._drain=noop;this._finalized=false;this._finalizing=false;this._destroyed=false;this._stream=null};o.inherits(Pack,u);Pack.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(this._finalized||this._destroyed)return;if(typeof t==="function"){r=t;t=null}if(!r)r=noop;var i=this;if(!e.size||e.type==="symlink")e.size=0;if(!e.type)e.type=modeToType(e.mode);if(!e.mode)e.mode=e.type==="directory"?p:h;if(!e.uid)e.uid=0;if(!e.gid)e.gid=0;if(!e.mtime)e.mtime=new Date;if(typeof t==="string")t=s(t);if(Buffer.isBuffer(t)){e.size=t.length;this._encode(e);this.push(t);overflow(i,e.size);process.nextTick(r);return new Void}if(e.type==="symlink"&&!e.linkname){var o=new LinkSink;n(o,(function(t){if(t){i.destroy();return r(t)}e.linkname=o.linkname;i._encode(e);r()}));return o}this._encode(e);if(e.type!=="file"&&e.type!=="contiguous-file"){process.nextTick(r);return new Void}var a=new Sink(this);this._stream=a;n(a,(function(t){i._stream=null;if(t){i.destroy();return r(t)}if(a.written!==e.size){i.destroy();return r(new Error("size mismatch"))}overflow(i,e.size);if(i._finalizing)i.finalize();r()}));return a};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(m);this.push(null)};Pack.prototype.destroy=function(e){if(this._destroyed)return;this._destroyed=true;if(e)this.emit("error",e);this.emit("close");if(this._stream&&this._stream.destroy)this._stream.destroy()};Pack.prototype._encode=function(e){if(!e.pax){var t=d.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Pack.prototype._encodePax=function(e){var t=d.encodePax({name:e.name,linkname:e.linkname,pax:e.pax});var r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(d.encode(r));this.push(t);overflow(this,t.length);r.size=e.size;r.type=e.type;this.push(d.encode(r))};Pack.prototype._read=function(e){var t=this._drain;this._drain=noop;t()};e.exports=Pack},421:function(e,t,r){var i=r(2781);t=e.exports=through;through.through=through;function through(e,t,r){e=e||function(e){this.queue(e)};t=t||function(){this.queue(null)};var n=false,o=false,a=[],s=false;var u=new i;u.readable=u.writable=true;u.paused=false;u.autoDestroy=!(r&&r.autoDestroy===false);u.write=function(t){e.call(this,t);return!u.paused};function drain(){while(a.length&&!u.paused){var e=a.shift();if(null===e)return u.emit("end");else u.emit("data",e)}}u.queue=u.push=function(e){if(s)return u;if(e===null)s=true;a.push(e);drain();return u};u.on("end",(function(){u.readable=false;if(!u.writable&&u.autoDestroy)process.nextTick((function(){u.destroy()}))}));function _end(){u.writable=false;t.call(u);if(!u.readable&&u.autoDestroy)u.destroy()}u.end=function(e){if(n)return;n=true;if(arguments.length)u.write(e);_end();return u};u.destroy=function(){if(o)return;o=true;n=true;a.length=0;u.writable=u.readable=false;u.emit("close");return u};u.pause=function(){if(u.paused)return;u.paused=true;return u};u.resume=function(){if(u.paused){u.paused=false;u.emit("resume")}drain();if(!u.paused)u.emit("drain");return u};return u}},3467:function(e,t,r){var i=r(421);var n=r(2589);var o=r(7877);e.exports=unbzip2Stream;function unbzip2Stream(){var e=[];var t=0;var r=0;var a=false;var s=false;var u=null;var l=null;function decompressBlock(e){if(!r){r=n.header(u);l=0;return true}else{var t=1e5*r;var i=new Int32Array(t);var o=[];var f=function(e){o.push(e)};l=n.decompress(u,f,i,t,l);if(l===null){r=0;return false}else{e(Buffer.from(o));return true}}}var c=0;function decompressAndQueue(e){if(a)return;try{return decompressBlock((function(t){e.queue(t);if(t!==null){c+=t.length}else{}}))}catch(t){e.emit("error",t);a=true;return false}}return i((function write(i){e.push(i);t+=i.length;if(u===null){u=o((function(){return e.shift()}))}while(!a&&t-u.bytesRead+1>=(25e3+1e5*r||4)){decompressAndQueue(this)}}),(function end(e){while(!a&&u&&t>u.bytesRead){decompressAndQueue(this)}if(!a){if(l!==null)this.emit("error",new Error("input stream ended prematurely"));this.queue(null)}}))}},7877:function(e){var t=[0,1,3,7,15,31,63,127,255];e.exports=function bitIterator(e){var r=0,i=0;var n=e();var f=function(o){if(o===null&&r!=0){r=0;i++;return}var a=0;while(o>0){if(i>=n.length){i=0;n=e()}var s=8-r;if(r===0&&o>0)f.bytesRead++;if(o>=s){a<<=s;a|=t[s]&n[i++];r=0;o-=s}else{a<<=o;a|=(n[i]&t[o]<<8-o-r)>>8-o-r;r+=o;o=0}}return a};f.bytesRead=0;return f}},2589:function(e){function Bzip2Error(e){this.name="Bzip2Error";this.message=e;this.stack=(new Error).stack}Bzip2Error.prototype=new Error;var t={Error:function(e){throw new Bzip2Error(e)}};var r={};r.Bzip2Error=Bzip2Error;r.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];r.array=function(e){var t=0,r=0;var i=[0,1,3,7,15,31,63,127,255];return function(n){var o=0;while(n>0){var a=8-t;if(n>=a){o<<=a;o|=i[a]&e[r++];t=0;n-=a}else{o<<=n;o|=(e[r]&i[n]<<8-n-t)>>8-n-t;t+=n;n=0}}return o}};r.simple=function(e,t){var i=r.array(e);var n=r.header(i);var o=false;var a=1e5*n;var s=new Int32Array(a);do{o=r.decompress(i,t,s,a)}while(!o)};r.header=function(e){this.byteCount=new Int32Array(256);this.symToByte=new Uint8Array(256);this.mtfSymbol=new Int32Array(256);this.selectors=new Uint8Array(32768);if(e(8*3)!=4348520)t.Error("No magic number found");var r=e(8)-48;if(r<1||r>9)t.Error("Not a BZIP archive");return r};r.decompress=function(e,r,i,n,o){var a=20;var s=258;var u=0;var l=1;var c=50;var d=0^-1;for(var p="",h=0;h<6;h++)p+=e(8).toString(16);if(p=="177245385090"){var m=e(32)|0;if(m!==o)t.Error("Error in bzip2: crc32 do not match");e(null);return null}if(p!="314159265359")t.Error("eek not valid bzip data");var y=e(32)|0;if(e(1))t.Error("unsupported obsolete version");var v=e(24);if(v>n)t.Error("Initial position larger than buffer size");var g=e(16);var b=0;for(h=0;h<16;h++){if(g&1<<15-h){var w=e(16);for(E=0;E<16;E++){if(w&1<<15-E){this.symToByte[b++]=16*h+E}}}}var x=e(3);if(x<2||x>6)t.Error("another error");var _=e(15);if(_==0)t.Error("meh");for(var h=0;h<x;h++)this.mtfSymbol[h]=h;for(var h=0;h<_;h++){for(var E=0;e(1);E++)if(E>=x)t.Error("whoops another error");var S=this.mtfSymbol[E];for(var w=E-1;w>=0;w--){this.mtfSymbol[w+1]=this.mtfSymbol[w]}this.mtfSymbol[0]=S;this.selectors[h]=S}var k=b+2;var B=[];var R=new Uint8Array(s),C=new Uint16Array(a+1);var T;for(var E=0;E<x;E++){g=e(5);for(var h=0;h<k;h++){while(true){if(g<1||g>a)t.Error("I gave up a while ago on writing error messages");if(!e(1))break;if(!e(1))g++;else g--}R[h]=g}var O,A;O=A=R[0];for(var h=1;h<k;h++){if(R[h]>A)A=R[h];else if(R[h]<O)O=R[h]}T=B[E]={};T.permute=new Int32Array(s);T.limit=new Int32Array(a+1);T.base=new Int32Array(a+1);T.minLen=O;T.maxLen=A;var L=T.base;var z=T.limit;var F=0;for(var h=O;h<=A;h++)for(var g=0;g<k;g++)if(R[g]==h)T.permute[F++]=g;for(h=O;h<=A;h++)C[h]=z[h]=0;for(h=0;h<k;h++)C[R[h]]++;F=g=0;for(h=O;h<A;h++){F+=C[h];z[h]=F-1;F<<=1;L[h+1]=F-(g+=C[h])}z[A]=F+C[A]-1;L[O]=0}for(var h=0;h<256;h++){this.mtfSymbol[h]=h;this.byteCount[h]=0}var j,P,k,N;j=P=k=N=0;while(true){if(!k--){k=c-1;if(N>=_)t.Error("meow i'm a kitty, that's an error");T=B[this.selectors[N++]];L=T.base;z=T.limit}h=T.minLen;E=e(h);while(true){if(h>T.maxLen)t.Error("rawr i'm a dinosaur");if(E<=z[h])break;h++;E=E<<1|e(1)}E-=L[h];if(E<0||E>=s)t.Error("moo i'm a cow");var I=T.permute[E];if(I==u||I==l){if(!j){j=1;g=0}if(I==u)g+=j;else g+=2*j;j<<=1;continue}if(j){j=0;if(P+g>n)t.Error("Boom.");S=this.symToByte[this.mtfSymbol[0]];this.byteCount[S]+=g;while(g--)i[P++]=S}if(I>b)break;if(P>=n)t.Error("I can't think of anything. Error");h=I-1;S=this.mtfSymbol[h];for(var w=h-1;w>=0;w--){this.mtfSymbol[w+1]=this.mtfSymbol[w]}this.mtfSymbol[0]=S;S=this.symToByte[S];this.byteCount[S]++;i[P++]=S}if(v<0||v>=P)t.Error("I'm a monkey and I'm throwing something at someone, namely you");var E=0;for(var h=0;h<256;h++){w=E+this.byteCount[h];this.byteCount[h]=E;E=w}for(var h=0;h<P;h++){S=i[h]&255;i[this.byteCount[S]]|=h<<8;this.byteCount[S]++}var M=0,U=0,D=0;if(P){M=i[v];U=M&255;M>>=8;D=-1}P=P;var W,q,$;while(P){P--;q=U;M=i[M];U=M&255;M>>=8;if(D++==3){W=U;$=q;U=-1}else{W=1;$=U}while(W--){d=(d<<8^this.crcTable[(d>>24^$)&255])&4294967295;r($)}if(U!=q)D=0}d=(d^-1)>>>0;if((d|0)!=(y|0))t.Error("Error in bzip2: crc32 do not match");o=(d^(o<<1|o>>>31))&4294967295;return o};e.exports=r},5278:function(e,t,r){e.exports=r(3837).deprecate},2940:function(e){e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var i=e.apply(this,t);var n=t[t.length-1];if(typeof i==="function"&&i!==n){Object.keys(n).forEach((function(e){i[e]=n[e]}))}return i}}},1208:function(e){e.exports=extend;var t=Object.prototype.hasOwnProperty;function extend(){var e={};for(var r=0;r<arguments.length;r++){var i=arguments[r];for(var n in i){if(t.call(i,n)){e[n]=i[n]}}}return e}},8781:function(e,t,r){var i=r(7147);var n=r(9796);var o=r(5010);var a=r(4794);var s=r(3837);var u=r(2361).EventEmitter;var l=r(2781).Transform;var c=r(2781).PassThrough;var d=r(2781).Writable;t.open=open;t.fromFd=fromFd;t.fromBuffer=fromBuffer;t.fromRandomAccessReader=fromRandomAccessReader;t.dosDateTimeToDate=dosDateTimeToDate;t.validateFileName=validateFileName;t.ZipFile=ZipFile;t.Entry=Entry;t.RandomAccessReader=RandomAccessReader;function open(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=true;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;i.open(e,"r",(function(e,n){if(e)return r(e);fromFd(n,t,(function(e,t){if(e)i.close(n,defaultCallback);r(e,t)}))}))}function fromFd(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};if(t.autoClose==null)t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;if(r==null)r=defaultCallback;i.fstat(e,(function(i,n){if(i)return r(i);var a=o.createFromFd(e,{autoClose:true});fromRandomAccessReader(a,n.size,t,r)}))}function fromBuffer(e,t,r){if(typeof t==="function"){r=t;t=null}if(t==null)t={};t.autoClose=false;if(t.lazyEntries==null)t.lazyEntries=false;if(t.decodeStrings==null)t.decodeStrings=true;if(t.validateEntrySizes==null)t.validateEntrySizes=true;if(t.strictFileNames==null)t.strictFileNames=false;var i=o.createFromBuffer(e,{maxChunkSize:65536});fromRandomAccessReader(i,e.length,t,r)}function fromRandomAccessReader(e,t,r,i){if(typeof r==="function"){i=r;r=null}if(r==null)r={};if(r.autoClose==null)r.autoClose=true;if(r.lazyEntries==null)r.lazyEntries=false;if(r.decodeStrings==null)r.decodeStrings=true;var n=!!r.decodeStrings;if(r.validateEntrySizes==null)r.validateEntrySizes=true;if(r.strictFileNames==null)r.strictFileNames=false;if(i==null)i=defaultCallback;if(typeof t!=="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER){throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.")}e.ref();var o=22;var a=65535;var s=Math.min(o+a,t);var u=h(s);var l=t-u.length;readAndAssertNoEof(e,u,0,s,l,(function(a){if(a)return i(a);for(var c=s-o;c>=0;c-=1){if(u.readUInt32LE(c)!==101010256)continue;var d=u.slice(c);var p=d.readUInt16LE(4);if(p!==0){return i(new Error("multi-disk zip files are not supported: found disk number: "+p))}var m=d.readUInt16LE(10);var y=d.readUInt32LE(16);var v=d.readUInt16LE(20);var g=d.length-o;if(v!==g){return i(new Error("invalid comment length. expected: "+g+". found: "+v))}var b=n?decodeBuffer(d,22,d.length,false):d.slice(22);if(!(m===65535||y===4294967295)){return i(null,new ZipFile(e,y,t,m,b,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames))}var w=h(20);var x=l+c-w.length;readAndAssertNoEof(e,w,0,w.length,x,(function(o){if(o)return i(o);if(w.readUInt32LE(0)!==117853008){return i(new Error("invalid zip64 end of central directory locator signature"))}var a=readUInt64LE(w,8);var s=h(56);readAndAssertNoEof(e,s,0,s.length,a,(function(o){if(o)return i(o);if(s.readUInt32LE(0)!==101075792){return i(new Error("invalid zip64 end of central directory record signature"))}m=readUInt64LE(s,32);y=readUInt64LE(s,48);return i(null,new ZipFile(e,y,t,m,b,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames))}))}));return}i(new Error("end of central directory record signature not found"))}))}s.inherits(ZipFile,u);function ZipFile(e,t,r,i,n,o,a,s,l,c){var d=this;u.call(d);d.reader=e;d.reader.on("error",(function(e){emitError(d,e)}));d.reader.once("close",(function(){d.emit("close")}));d.readEntryCursor=t;d.fileSize=r;d.entryCount=i;d.comment=n;d.entriesRead=0;d.autoClose=!!o;d.lazyEntries=!!a;d.decodeStrings=!!s;d.validateEntrySizes=!!l;d.strictFileNames=!!c;d.isOpen=true;d.emittedError=false;if(!d.lazyEntries)d._readEntry()}ZipFile.prototype.close=function(){if(!this.isOpen)return;this.isOpen=false;this.reader.unref()};function emitErrorAndAutoClose(e,t){if(e.autoClose)e.close();emitError(e,t)}function emitError(e,t){if(e.emittedError)return;e.emittedError=true;e.emit("error",t)}ZipFile.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ZipFile.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate((function(){if(e.autoClose)e.close();if(e.emittedError)return;e.emit("end")}));return}if(e.emittedError)return;var t=h(46);readAndAssertNoEof(e.reader,t,0,t.length,e.readEntryCursor,(function(r){if(r)return emitErrorAndAutoClose(e,r);if(e.emittedError)return;var i=new Entry;var n=t.readUInt32LE(0);if(n!==33639248)return emitErrorAndAutoClose(e,new Error("invalid central directory file header signature: 0x"+n.toString(16)));i.versionMadeBy=t.readUInt16LE(4);i.versionNeededToExtract=t.readUInt16LE(6);i.generalPurposeBitFlag=t.readUInt16LE(8);i.compressionMethod=t.readUInt16LE(10);i.lastModFileTime=t.readUInt16LE(12);i.lastModFileDate=t.readUInt16LE(14);i.crc32=t.readUInt32LE(16);i.compressedSize=t.readUInt32LE(20);i.uncompressedSize=t.readUInt32LE(24);i.fileNameLength=t.readUInt16LE(28);i.extraFieldLength=t.readUInt16LE(30);i.fileCommentLength=t.readUInt16LE(32);i.internalFileAttributes=t.readUInt16LE(36);i.externalFileAttributes=t.readUInt32LE(38);i.relativeOffsetOfLocalHeader=t.readUInt32LE(42);if(i.generalPurposeBitFlag&64)return emitErrorAndAutoClose(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46;t=h(i.fileNameLength+i.extraFieldLength+i.fileCommentLength);readAndAssertNoEof(e.reader,t,0,t.length,e.readEntryCursor,(function(r){if(r)return emitErrorAndAutoClose(e,r);if(e.emittedError)return;var n=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?decodeBuffer(t,0,i.fileNameLength,n):t.slice(0,i.fileNameLength);var o=i.fileNameLength+i.extraFieldLength;var s=t.slice(i.fileNameLength,o);i.extraFields=[];var u=0;while(u<s.length-3){var l=s.readUInt16LE(u+0);var c=s.readUInt16LE(u+2);var d=u+4;var p=d+c;if(p>s.length)return emitErrorAndAutoClose(e,new Error("extra field length exceeds extra field buffer size"));var m=h(c);s.copy(m,0,d,p);i.extraFields.push({id:l,data:m});u=p}i.fileComment=e.decodeStrings?decodeBuffer(t,o,o+i.fileCommentLength,n):t.slice(o,o+i.fileCommentLength);i.comment=i.fileComment;e.readEntryCursor+=t.length;e.entriesRead+=1;if(i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){var y=null;for(var u=0;u<i.extraFields.length;u++){var v=i.extraFields[u];if(v.id===1){y=v.data;break}}if(y==null){return emitErrorAndAutoClose(e,new Error("expected zip64 extended information extra field"))}var g=0;if(i.uncompressedSize===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include uncompressed size"))}i.uncompressedSize=readUInt64LE(y,g);g+=8}if(i.compressedSize===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include compressed size"))}i.compressedSize=readUInt64LE(y,g);g+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(g+8>y.length){return emitErrorAndAutoClose(e,new Error("zip64 extended information extra field does not include relative header offset"))}i.relativeOffsetOfLocalHeader=readUInt64LE(y,g);g+=8}}if(e.decodeStrings){for(var u=0;u<i.extraFields.length;u++){var v=i.extraFields[u];if(v.id===28789){if(v.data.length<6){continue}if(v.data.readUInt8(0)!==1){continue}var b=v.data.readUInt32LE(1);if(a.unsigned(t.slice(0,i.fileNameLength))!==b){continue}i.fileName=decodeBuffer(v.data,5,v.data.length,true);break}}}if(e.validateEntrySizes&&i.compressionMethod===0){var w=i.uncompressedSize;if(i.isEncrypted()){w+=12}if(i.compressedSize!==w){var x="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return emitErrorAndAutoClose(e,new Error(x))}}if(e.decodeStrings){if(!e.strictFileNames){i.fileName=i.fileName.replace(/\\/g,"/")}var _=validateFileName(i.fileName,e.validateFileNameOptions);if(_!=null)return emitErrorAndAutoClose(e,new Error(_))}e.emit("entry",i);if(!e.lazyEntries)e._readEntry()}))}))};ZipFile.prototype.openReadStream=function(e,t,r){var i=this;var o=0;var a=e.compressedSize;if(r==null){r=t;t={}}else{if(t.decrypt!=null){if(!e.isEncrypted()){throw new Error("options.decrypt can only be specified for encrypted entries")}if(t.decrypt!==false)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()){if(t.decompress!==false)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(t.decompress!=null){if(!e.isCompressed()){throw new Error("options.decompress can only be specified for compressed entries")}if(!(t.decompress===false||t.decompress===true)){throw new Error("invalid options.decompress value: "+t.decompress)}}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==false){throw new Error("start/end range not allowed for compressed entry without options.decompress === false")}if(e.isEncrypted()&&t.decrypt!==false){throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}}if(t.start!=null){o=t.start;if(o<0)throw new Error("options.start < 0");if(o>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){a=t.end;if(a<0)throw new Error("options.end < 0");if(a>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(a<o)throw new Error("options.end < options.start")}}if(!i.isOpen)return r(new Error("closed"));if(e.isEncrypted()){if(t.decrypt!==false)return r(new Error("entry is encrypted, and options.decrypt !== false"))}i.reader.ref();var s=h(30);readAndAssertNoEof(i.reader,s,0,s.length,e.relativeOffsetOfLocalHeader,(function(u){try{if(u)return r(u);var l=s.readUInt32LE(0);if(l!==67324752){return r(new Error("invalid local file header signature: 0x"+l.toString(16)))}var c=s.readUInt16LE(26);var d=s.readUInt16LE(28);var p=e.relativeOffsetOfLocalHeader+s.length+c+d;var h;if(e.compressionMethod===0){h=false}else if(e.compressionMethod===8){h=t.decompress!=null?t.decompress:true}else{return r(new Error("unsupported compression method: "+e.compressionMethod))}var m=p;var y=m+e.compressedSize;if(e.compressedSize!==0){if(y>i.fileSize){return r(new Error("file data overflows file bounds: "+m+" + "+e.compressedSize+" > "+i.fileSize))}}var v=i.reader.createReadStream({start:m+o,end:m+a});var g=v;if(h){var b=false;var w=n.createInflateRaw();v.on("error",(function(e){setImmediate((function(){if(!b)w.emit("error",e)}))}));v.pipe(w);if(i.validateEntrySizes){g=new AssertByteCountStream(e.uncompressedSize);w.on("error",(function(e){setImmediate((function(){if(!b)g.emit("error",e)}))}));w.pipe(g)}else{g=w}g.destroy=function(){b=true;if(w!==g)w.unpipe(g);v.unpipe(w);v.destroy()}}r(null,g)}finally{i.reader.unref()}}))};function Entry(){}Entry.prototype.getLastModDate=function(){return dosDateTimeToDate(this.lastModFileDate,this.lastModFileTime)};Entry.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Entry.prototype.isCompressed=function(){return this.compressionMethod===8};function dosDateTimeToDate(e,t){var r=e&31;var i=(e>>5&15)-1;var n=(e>>9&127)+1980;var o=0;var a=(t&31)*2;var s=t>>5&63;var u=t>>11&31;return new Date(n,i,r,u,s,a,o)}function validateFileName(e){if(e.indexOf("\\")!==-1){return"invalid characters in fileName: "+e}if(/^[a-zA-Z]:/.test(e)||/^\//.test(e)){return"absolute path: "+e}if(e.split("/").indexOf("..")!==-1){return"invalid relative path: "+e}return null}function readAndAssertNoEof(e,t,r,i,n,o){if(i===0){return setImmediate((function(){o(null,h(0))}))}e.read(t,r,i,n,(function(e,t){if(e)return o(e);if(t<i){return o(new Error("unexpected EOF"))}o()}))}s.inherits(AssertByteCountStream,l);function AssertByteCountStream(e){l.call(this);this.actualByteCount=0;this.expectedByteCount=e}AssertByteCountStream.prototype._transform=function(e,t,r){this.actualByteCount+=e.length;if(this.actualByteCount>this.expectedByteCount){var i="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(i))}r(null,e)};AssertByteCountStream.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};s.inherits(RandomAccessReader,u);function RandomAccessReader(){u.call(this);this.refCount=0}RandomAccessReader.prototype.ref=function(){this.refCount+=1};RandomAccessReader.prototype.unref=function(){var e=this;e.refCount-=1;if(e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(onCloseDone);function onCloseDone(t){if(t)return e.emit("error",t);e.emit("close")}};RandomAccessReader.prototype.createReadStream=function(e){var t=e.start;var r=e.end;if(t===r){var i=new c;setImmediate((function(){i.end()}));return i}var n=this._readStreamForRange(t,r);var o=false;var a=new RefUnrefFilter(this);n.on("error",(function(e){setImmediate((function(){if(!o)a.emit("error",e)}))}));a.destroy=function(){n.unpipe(a);a.unref();n.destroy()};var s=new AssertByteCountStream(r-t);a.on("error",(function(e){setImmediate((function(){if(!o)s.emit("error",e)}))}));s.destroy=function(){o=true;a.unpipe(s);a.destroy()};return n.pipe(a).pipe(s)};RandomAccessReader.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};RandomAccessReader.prototype.read=function(e,t,r,i,n){var o=this.createReadStream({start:i,end:i+r});var a=new d;var s=0;a._write=function(r,i,n){r.copy(e,t+s,0,r.length);s+=r.length;n()};a.on("finish",n);o.on("error",(function(e){n(e)}));o.pipe(a)};RandomAccessReader.prototype.close=function(e){setImmediate(e)};s.inherits(RefUnrefFilter,c);function RefUnrefFilter(e){c.call(this);this.context=e;this.context.ref();this.unreffedYet=false}RefUnrefFilter.prototype._flush=function(e){this.unref();e()};RefUnrefFilter.prototype.unref=function(e){if(this.unreffedYet)return;this.unreffedYet=true;this.context.unref()};var p="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function decodeBuffer(e,t,r,i){if(i){return e.toString("utf8",t,r)}else{var n="";for(var o=t;o<r;o++){n+=p[e[o]]}return n}}function readUInt64LE(e,t){var r=e.readUInt32LE(t);var i=e.readUInt32LE(t+4);return i*4294967296+r}var h;if(typeof Buffer.allocUnsafe==="function"){h=function(e){return Buffer.allocUnsafe(e)}}else{h=function(e){return new Buffer(e)}}function defaultCallback(e){if(e)throw e}},9491:function(e){"use strict";e.exports=require("assert")},4300:function(e){"use strict";e.exports=require("buffer")},2057:function(e){"use strict";e.exports=require("constants")},2361:function(e){"use strict";e.exports=require("events")},7147:function(e){"use strict";e.exports=require("fs")},1017:function(e){"use strict";e.exports=require("path")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")},6507:function(e){"use strict";e.exports=JSON.parse('{"name":"seek-bzip","version":"1.0.6","contributors":["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],"description":"a pure-JavaScript Node.JS module for random-access decoding bzip2 data","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/cscott/seek-bzip.git"},"license":"MIT","bin":{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},"directories":{"test":"test"},"dependencies":{"commander":"^2.8.1"},"devDependencies":{"fibers":"~1.0.6","mocha":"~2.2.5"},"scripts":{"test":"mocha"}}')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={exports:{}};var o=true;try{e[r](n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(9350);module.exports=r})();
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const pify = require('pify');
5
+
6
+ const defaults = {
7
+ mode: 0o777 & (~process.umask()),
8
+ fs
9
+ };
10
+
11
+ // https://github.com/nodejs/node/issues/8987
12
+ // https://github.com/libuv/libuv/pull/1088
13
+ const checkPath = pth => {
14
+ if (process.platform === 'win32') {
15
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
16
+
17
+ if (pathHasInvalidWinCharacters) {
18
+ const err = new Error(`Path contains invalid characters: ${pth}`);
19
+ err.code = 'EINVAL';
20
+ throw err;
21
+ }
22
+ }
23
+ };
24
+
25
+ module.exports = (input, opts) => Promise.resolve().then(() => {
26
+ checkPath(input);
27
+ opts = Object.assign({}, defaults, opts);
28
+
29
+ const mkdir = pify(opts.fs.mkdir);
30
+ const stat = pify(opts.fs.stat);
31
+
32
+ const make = pth => {
33
+ return mkdir(pth, opts.mode)
34
+ .then(() => pth)
35
+ .catch(err => {
36
+ if (err.code === 'ENOENT') {
37
+ if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
38
+ throw err;
39
+ }
40
+
41
+ return make(path.dirname(pth)).then(() => make(pth));
42
+ }
43
+
44
+ return stat(pth)
45
+ .then(stats => stats.isDirectory() ? pth : Promise.reject())
46
+ .catch(() => {
47
+ throw err;
48
+ });
49
+ });
50
+ };
51
+
52
+ return make(path.resolve(input));
53
+ });
54
+
55
+ module.exports.sync = (input, opts) => {
56
+ checkPath(input);
57
+ opts = Object.assign({}, defaults, opts);
58
+
59
+ const make = pth => {
60
+ try {
61
+ opts.fs.mkdirSync(pth, opts.mode);
62
+ } catch (err) {
63
+ if (err.code === 'ENOENT') {
64
+ if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
65
+ throw err;
66
+ }
67
+
68
+ make(path.dirname(pth));
69
+ return make(pth);
70
+ }
71
+
72
+ try {
73
+ if (!opts.fs.statSync(pth).isDirectory()) {
74
+ throw new Error('The path is not a directory');
75
+ }
76
+ } catch (_) {
77
+ throw err;
78
+ }
79
+ }
80
+
81
+ return pth;
82
+ };
83
+
84
+ return make(path.resolve(input));
85
+ };
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ const processFn = (fn, opts) => function () {
4
+ const P = opts.promiseModule;
5
+ const args = new Array(arguments.length);
6
+
7
+ for (let i = 0; i < arguments.length; i++) {
8
+ args[i] = arguments[i];
9
+ }
10
+
11
+ return new P((resolve, reject) => {
12
+ if (opts.errorFirst) {
13
+ args.push(function (err, result) {
14
+ if (opts.multiArgs) {
15
+ const results = new Array(arguments.length - 1);
16
+
17
+ for (let i = 1; i < arguments.length; i++) {
18
+ results[i - 1] = arguments[i];
19
+ }
20
+
21
+ if (err) {
22
+ results.unshift(err);
23
+ reject(results);
24
+ } else {
25
+ resolve(results);
26
+ }
27
+ } else if (err) {
28
+ reject(err);
29
+ } else {
30
+ resolve(result);
31
+ }
32
+ });
33
+ } else {
34
+ args.push(function (result) {
35
+ if (opts.multiArgs) {
36
+ const results = new Array(arguments.length - 1);
37
+
38
+ for (let i = 0; i < arguments.length; i++) {
39
+ results[i] = arguments[i];
40
+ }
41
+
42
+ resolve(results);
43
+ } else {
44
+ resolve(result);
45
+ }
46
+ });
47
+ }
48
+
49
+ fn.apply(this, args);
50
+ });
51
+ };
52
+
53
+ module.exports = (obj, opts) => {
54
+ opts = Object.assign({
55
+ exclude: [/.+(Sync|Stream)$/],
56
+ errorFirst: true,
57
+ promiseModule: Promise
58
+ }, opts);
59
+
60
+ const filter = key => {
61
+ const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
62
+ return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
63
+ };
64
+
65
+ let ret;
66
+ if (typeof obj === 'function') {
67
+ ret = function () {
68
+ if (opts.excludeMain) {
69
+ return obj.apply(this, arguments);
70
+ }
71
+
72
+ return processFn(obj, opts).apply(this, arguments);
73
+ };
74
+ } else {
75
+ ret = Object.create(Object.getPrototypeOf(obj));
76
+ }
77
+
78
+ for (const key in obj) { // eslint-disable-line guard-for-in
79
+ const x = obj[key];
80
+ ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
81
+ }
82
+
83
+ return ret;
84
+ };
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "pify",
3
+ "version": "3.0.0",
4
+ "description": "Promisify a callback-style function",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/pify",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=4"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && npm run optimization-test",
17
+ "optimization-test": "node --allow-natives-syntax optimization-test.js"
18
+ },
19
+ "files": [
20
+ "index.js"
21
+ ],
22
+ "keywords": [
23
+ "promise",
24
+ "promises",
25
+ "promisify",
26
+ "all",
27
+ "denodify",
28
+ "denodeify",
29
+ "callback",
30
+ "cb",
31
+ "node",
32
+ "then",
33
+ "thenify",
34
+ "convert",
35
+ "transform",
36
+ "wrap",
37
+ "wrapper",
38
+ "bind",
39
+ "to",
40
+ "async",
41
+ "await",
42
+ "es2015",
43
+ "bluebird"
44
+ ],
45
+ "devDependencies": {
46
+ "ava": "*",
47
+ "pinkie-promise": "^2.0.0",
48
+ "v8-natives": "^1.0.0",
49
+ "xo": "*"
50
+ }
51
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "make-dir",
3
+ "version": "1.3.0",
4
+ "description": "Make a directory and its parents if needed - Think `mkdir -p`",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/make-dir",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=4"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && nyc ava"
17
+ },
18
+ "files": [
19
+ "index.js"
20
+ ],
21
+ "keywords": [
22
+ "mkdir",
23
+ "mkdirp",
24
+ "make",
25
+ "directories",
26
+ "dir",
27
+ "dirs",
28
+ "folders",
29
+ "directory",
30
+ "folder",
31
+ "path",
32
+ "parent",
33
+ "parents",
34
+ "intermediate",
35
+ "recursively",
36
+ "recursive",
37
+ "create",
38
+ "fs",
39
+ "filesystem",
40
+ "file-system"
41
+ ],
42
+ "dependencies": {
43
+ "pify": "^3.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "ava": "*",
47
+ "codecov": "^3.0.0",
48
+ "graceful-fs": "^4.1.11",
49
+ "nyc": "^11.3.0",
50
+ "path-type": "^3.0.0",
51
+ "tempy": "^0.2.1",
52
+ "xo": "^0.20.0"
53
+ }
54
+ }
@@ -1 +1 @@
1
- {"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-03-20T04:46:26.613Z"}
1
+ {"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-03-20T09:02:44.555Z"}
@@ -1 +1 @@
1
- {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-03-20T04:46:25.320Z"}
1
+ {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-03-20T09:02:43.290Z"}
@@ -1 +1 @@
1
- {"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-03-20T04:46:25.858Z"}
1
+ {"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-03-20T09:02:43.820Z"}
@@ -1 +1 @@
1
- {"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-03-20T04:46:27.125Z"}
1
+ {"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-03-20T09:02:45.038Z"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
7
7
  "description.ru-RU": "Резервное копирование и восстановление приложений для задач репликации, миграции и обновления.",
8
8
  "description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
9
- "version": "2.0.22",
9
+ "version": "2.1.0-alpha.10",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/backup-restore",
@@ -47,5 +47,5 @@
47
47
  "keywords": [
48
48
  "System management"
49
49
  ],
50
- "gitHead": "7b703580c4bb60f1e5e44c8fd685141bb8b3a47c"
50
+ "gitHead": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8"
51
51
  }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).push([["611"],{95:function(e,t,n){n.r(t),n.d(t,{BackupAndRestoreList:function(){return C}});var r=n(482),l=n(632),a=n(772),o=n(721),i=n(346),u=n(156),c=n.n(u),s=n(551);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,l,a,o){try{var i=e[a](o),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,l)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var a=e.apply(t,n);function o(e){p(a,r,l,o,i,"next",e)}function i(e){p(a,r,l,o,i,"throw",e)}o(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],o=!0,i=!1;try{for(l=l.call(e);!(o=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){var n,r,l,a,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){var u=[a,i];if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var g=o.Upload.Dragger,v=function(e){var t,n=e.collectionsData,r=(0,s.lV)().t,l=y((0,u.useState)(!1),2),i=l[0],f=l[1],p=y((0,u.useState)(n),2),m=p[0],b=p[1];(0,u.useEffect)(function(){b(n)},[n]);var g=(0,a.useAPIClient)(),v=(0,a.useCompile)(),k=(0,u.useMemo)(function(){return g.resource("backupFiles")},[g]),E=(t=d(function(){var t;return h(this,function(n){switch(n.label){case 0:if(!e.isBackup)return[3,2];return[4,k.dumpableCollections()];case 1:b(null==(t=n.sent())?void 0:t.data),f(!0),n.label=2;case 2:return f(!0),[2]}})}),function(){return t.apply(this,arguments)}),w=[{title:r("Collection"),dataIndex:"collection",key:"collection",render:function(e,t){var n=v(t.title);return t.name===n?n:c().createElement("div",null,t.name," ",c().createElement("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"}},"(",v(t.title),")"))}},{title:r("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],C=Object.keys(m||{}).map(function(e){return{key:e,label:r("".concat(e,".title")),children:c().createElement(c().Fragment,null,c().createElement(o.Alert,{style:{marginBottom:16},message:r("".concat(e,".description"))}),c().createElement(o.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:m[e],columns:w,scroll:{y:400}}))}});return c().createElement(c().Fragment,null,c().createElement("a",{onClick:E},r("Learn more")),c().createElement(o.Modal,{title:r("Backup instructions"),width:"80vw",open:i,footer:null,onOk:function(){f(!1)},onCancel:function(){f(!1)}},c().createElement(o.Tabs,{defaultActiveKey:"required",items:C})))},k=function(e){var t,n=e.ButtonComponent,r=void 0===n?o.Button:n,i=e.title,f=e.upload,p=void 0!==f&&f,m=e.fileData,b=(0,s.lV)().t,g=y((0,u.useState)(["required"]),2),k=g[0],E=g[1],C=y((0,u.useState)(!1),2),S=C[0],O=C[1],P=y((0,u.useState)(null),2),B=P[0],x=P[1],j=y((0,u.useState)(!1),2),D=j[0],A=j[1],F=(0,a.useAPIClient)(),I=(0,u.useMemo)(function(){return F.resource("backupFiles")},[F]),T=y((0,u.useState)([]),2),q=T[0],R=T[1];(0,u.useEffect)(function(){R(Object.keys((null==B?void 0:B.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:b("".concat(e,".title")),disabled:["required","skipped"].includes(e)}}))},[B]);var G=(t=d(function(){var e,t,n,r;return h(this,function(l){switch(l.label){case 0:if(O(!0),p)return[3,2];return A(!0),[4,I.get({filterByTk:m.name})];case 1:R(Object.keys((null==(r=l.sent().data)||null==(t=r.data)||null==(e=t.meta)?void 0:e.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:b("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),x(null==r||null==(n=r.data)?void 0:n.meta),A(!1),l.label=2;case 2:return[2]}})}),function(){return t.apply(this,arguments)});return c().createElement(c().Fragment,null,c().createElement(r,{onClick:G},i),c().createElement(o.Modal,{title:b("Restore"),width:800,footer:p&&!B?null:void 0,open:S,onOk:function(){I.restore({values:{dataTypes:k,filterByTk:null==m?void 0:m.name,key:null==B?void 0:B.key}}),O(!1)},onCancel:function(){O(!1),x(null),E(["required"])}},c().createElement(o.Spin,{spinning:D},p&&!B&&c().createElement(w,{setRestoreData:x}),(!p||B)&&[c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},key:"info"},b("Select the data to be restored")," (",c().createElement(v,{collectionsData:null==B?void 0:B.dumpableCollectionsGroupByGroup}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8},key:"dataType"},c().createElement(l.FormItem,null,c().createElement(a.Checkbox.Group,{options:q,style:{flexDirection:"column"},value:k,onChange:function(e){return E(e)}})))])))},E=function(e){var t,n=e.ButtonComponent,l=void 0===n?o.Button:n,i=e.refresh,f=(0,s.lV)().t,p=y((0,u.useState)(!1),2),m=p[0],b=p[1],g=y((0,u.useState)(["required"]),2),k=g[0],E=g[1],w=(0,a.useAPIClient)(),C=y((0,u.useState)([]),2),S=C[0],O=C[1],P=(t=d(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.resource("backupFiles").dumpableCollections()];case 1:return O(Object.keys(e.sent().data||[]).map(function(e){return{value:e,label:f("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),b(!0),[2]}})}),function(){return t.apply(this,arguments)});return c().createElement(c().Fragment,null,c().createElement(l,{icon:c().createElement(r.PlusOutlined,null),type:"primary",onClick:P},f("New backup")),c().createElement(o.Modal,{title:f("New backup"),width:800,open:m,onOk:function(){w.request({url:"backupFiles:create",method:"post",data:{dataTypes:k}}),b(!1),E(["required"]),setTimeout(function(){i()},500)},onCancel:function(){b(!1),E(["required"])}},c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"}},f("Select the data to be backed up")," (",c().createElement(v,{isBackup:!0}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8}},c().createElement(a.Checkbox.Group,{options:S,style:{flexDirection:"column"},onChange:function(e){return E(e)},value:k}))))},w=function(e){var t,n,l=(0,s.lV)().t;return c().createElement(g,(t={multiple:!1,action:"/backupFiles:upload",onChange:function(t){t.fileList.length>1&&t.fileList.splice(0,t.fileList.length-1);var n,r,a,i=t.file.status;"done"===i?(o.message.success("".concat(t.file.name," ")+l("file uploaded successfully")),e.setRestoreData(b(m({},null==(r=t.file.response)||null==(n=r.data)?void 0:n.meta),{key:null==(a=t.file.response)?void 0:a.data.key}))):"error"===i&&o.message.error("".concat(t.file.name," ")+l("file upload failed"))},onDrop:function(e){console.log("Dropped files",e.dataTransfer.files)}},n=(0,a.useAPIClient)(),b(m({},t),{customRequest:function(e){var t=e.action,r=e.data,l=e.file,a=e.filename,o=e.headers,i=e.onError,u=e.onProgress,c=e.onSuccess,s=e.withCredentials,f=new FormData;return r&&Object.keys(r).forEach(function(e){f.append(e,r[e])}),f.append(a,l),n.axios.post(t,f,{withCredentials:s,headers:o,onUploadProgress:function(e){var t=e.total;u({percent:Math.round(e.loaded/t*100).toFixed(2)},l)}}).then(function(e){c(e.data,l)}).catch(i).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}},onChange:function(e){var n;null==(n=t.onChange)||n.call(t,e)}})),c().createElement("p",{className:"ant-upload-drag-icon"},c().createElement(r.InboxOutlined,null)),c().createElement("p",{className:"ant-upload-text"}," ",l("Click or drag file to this area to upload")))},C=function(){var e,t,n,l=(0,s.lV)().t,f=(0,a.useAPIClient)(),p=y((0,u.useState)([]),2),m=p[0],b=p[1],g=y((0,u.useState)(!1),2),v=g[0],w=g[1],C=y((0,u.useState)(!1),2),S=(C[0],C[1]),O=o.App.useApp().modal,P=(0,u.useMemo)(function(){return f.resource("backupFiles")},[f]);(0,u.useEffect)(function(){B()},[]);var B=(e=d(function(){return h(this,function(e){switch(e.label){case 0:return w(!0),[4,P.list()];case 1:return b(e.sent().data.data),w(!1),[2]}})}),function(){return e.apply(this,arguments)}),x=(t=d(function(e){var t,n;return h(this,function(r){switch(r.label){case 0:return S(e.name),[4,f.request({url:"backupFiles:download",method:"get",params:{filterByTk:e.name},responseType:"blob"})];case 1:return t=r.sent(),S(!1),n=new Blob([t.data]),(0,i.saveAs)(n,e.name),[2]}})}),function(e){return t.apply(this,arguments)}),j=(n=d(function(){return h(this,function(e){switch(e.label){case 0:return[4,B()];case 1:return e.sent(),[2]}})}),function(){return n.apply(this,arguments)}),D=function(e){O.confirm({title:l("Delete record",{ns:"client"}),content:l("Are you sure you want to delete it?",{ns:"client"}),onOk:d(function(){return h(this,function(t){switch(t.label){case 0:return[4,P.destroy({filterByTk:e.name})];case 1:return t.sent(),[4,B()];case 2:return t.sent(),o.message.success(l("Deleted successfully")),[2]}})})})};return c().createElement("div",null,c().createElement(o.Card,{bordered:!1},c().createElement(o.Space,{style:{float:"right",marginBottom:16}},c().createElement(o.Button,{onClick:j,icon:c().createElement(r.ReloadOutlined,null)},l("Refresh")),c().createElement(k,{upload:!0,title:c().createElement(c().Fragment,null,c().createElement(r.UploadOutlined,null)," ",l("Restore backup from local"))}),c().createElement(E,{refresh:j})),c().createElement(o.Table,{dataSource:m,loading:v,columns:[{title:l("Backup file"),dataIndex:"name",width:400,onCell:function(e){return e.inProgress?{colSpan:4}:{}},render:function(e,t){return t.inProgress?c().createElement("div",{style:{color:"rgba(0, 0, 0, 0.88)"}},e,"(",l("Backing up"),"...)"):c().createElement("div",null,e)}},{title:l("File size"),dataIndex:"fileSize",onCell:function(e){return e.inProgress?{colSpan:0}:{}}},{title:l("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e){return c().createElement(a.DatePicker.ReadPretty,{value:e,showTime:!0})}},{title:l("Actions",{ns:"client"}),dataIndex:"actions",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e,t){return c().createElement(o.Space,{split:c().createElement(o.Divider,{type:"vertical"})},c().createElement(k,{ButtonComponent:"a",title:l("Restore"),fileData:t}),c().createElement("a",{type:"link",onClick:function(){return x(t)}},l("Download")),c().createElement("a",{onClick:function(){return D(t)}},l("Delete")))}}]})))}}}]);