jwt-license-verifier 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("crypto"),require("os"),require("fs"),require("path"),require("child_process"),require("util"),require("net"),require("buffer"),require("stream")):"function"==typeof define&&define.amd?define(["exports","crypto","os","fs","path","child_process","util","net","buffer","stream"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["jwt-license-verifier"]={},e.require$$2$1,e.require$$0$1,e.require$$1$1,e.require$$2,e.require$$1,e.require$$4,e.require$$0$2,e.require$$0$3,e.require$$3)}(this,(function(e,t,r,n,i,s,a,o,l,c){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=u(t),d=p(t),m=u(r),h=u(n),g=u(i),y=u(s),v=u(a),S=u(o),w=u(l),x=u(c);function C(){C=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var s=t&&t.prototype instanceof y?t:y,a=Object.create(s.prototype),o=new V(n||[]);return i(a,"_invoke",{value:L(e,r,o)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",d="suspendedYield",m="executing",h="completed",g={};function y(){}function v(){}function S(){}var w={};c(w,a,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var I=S.prototype=y.prototype=Object.create(w);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,s,a,o){var l=p(e[i],e,s);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(l.arg)}var s;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return s=s?s.then(i,i):i()}})}function L(t,r,n){var i=f;return function(s,a){if(i===m)throw new Error("Generator is already running");if(i===h){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var o=n.delegate;if(o){var l=_(o,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?h:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=h,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var s=p(i,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,g;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=S,i(I,"constructor",{value:S,configurable:!0}),i(S,"constructor",{value:v,configurable:!0}),v.displayName=c(S,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,c(e,l,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},b(E.prototype),c(E.prototype,o,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var a=new E(u(e,r,n,i),s);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(I),c(I,l,"Generator"),c(I,a,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,V.prototype={constructor:V,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return o.type="throw",o.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function O(e,t,r,n,i,s,a){try{var o=e[s](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,i)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function a(e){O(s,n,i,a,o,"next",e)}function o(e){O(s,n,i,a,o,"throw",e)}a(void 0)}))}}var b={},E="5.21.20",L={};const _=m.default,P=h.default,T=g.default,V=y.default.spawn,A=y.default.exec,N=y.default.execSync,D=v.default;let k=process.platform;const M="linux"===k||"android"===k,R="darwin"===k,B="win32"===k,F="freebsd"===k,G="openbsd"===k,W="netbsd"===k;let U=0,$="",j="",H=null,X=null;const z=process.env.WINDIR||"C:\\Windows";let K,Y="",q=[],J=!1;const Q="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",Z="--###START###--",ee="--ERROR--",te="--###ENDCMD###--",re="--##ID##--",ne={windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})};const ie=(new String).replace,se=(new String).toLowerCase,ae=(new String).toString,oe=(new String).substr,le=(new String).trim,ce=(new String).startsWith,ue=Math.min;function pe(e,t,r,n,i){r=r||":",t=t.toLowerCase(),n=n||!1,i=i||!1;let s="";return e.some((e=>{let a=e.toLowerCase().replace(/\t/g,"");if(n&&(a=a.trim()),a.startsWith(t)&&(!i||(a.match(t+r)||a.match(t+" "+r)))){const t=n?e.trim().split(r):e.split(r);if(t.length>=2)return t.shift(),s=t.join(r).trim(),!0}})),s}function fe(){if("Windows_NT"===_.type()&&!$&&($=z+"\\system32\\wbem\\wmic.exe",!P.existsSync($)))try{const e=N("WHERE WMIC",ne).toString().split("\r\n");$=e&&e.length?e[0]:"wmic"}catch(e){$="wmic"}return $}function de(e){let t,r="",n="";if(e.indexOf(Z)>=0){t=e.split(Z);const n=t[1].split(re);r=n[0],n.length>1&&(e=n.slice(1).join(re))}e.indexOf(te)>=0&&(t=e.split(te),n=t[0]);let i=-1;for(let e=0;e<q.length;e++)q[e].id===r&&(i=e,q[e].callback(n));i>=0&&q.splice(i,1)}function me(e){if(J){const t=Math.random().toString(36).substring(2,12);return new Promise((r=>{process.nextTick((()=>{q.push({id:t,cmd:e,callback:function(e){r(e)},start:new Date});try{K&&K.pid&&K.stdin.write(Q+"echo "+Z+t+re+"; "+_.EOL+e+_.EOL+"echo "+te+_.EOL)}catch(e){r("")}}))}))}{let t="";return new Promise((r=>{process.nextTick((()=>{try{const n=V("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-ExecutionPolicy","Unrestricted","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})});if(n&&!n.pid&&n.on("error",(function(){r(t)})),n&&n.pid){n.stdout.on("data",(function(e){t+=e.toString("utf8")})),n.stderr.on("data",(function(){n.kill(),r(t)})),n.on("close",(function(){n.kill(),r(t)})),n.on("error",(function(){n.kill(),r(t)}));try{n.stdin.write(Q+e+_.EOL),n.stdin.write("exit"+_.EOL),n.stdin.end()}catch(e){n.kill(),r(t)}}else r(t)}catch(e){r(t)}}))}))}}function he(e){null===X&&(X=e);const t={"0002":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0003":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0004":{type:"B",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0005":{type:"B",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"0006":{type:"B",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0007":{type:"A",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0008":{type:"A",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0009":{type:"A",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"000d":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"000e":{type:"B",revision:"2.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"000f":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"0010":{type:"B+",revision:"1.2",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0011":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0012":{type:"A+",revision:"1.1",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0013":{type:"B+",revision:"1.2",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0014":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0015":{type:"A+",revision:"1.1",memory:256,manufacturer:"512MB\tEmbest",processor:"BCM2835"}},r=["BCM2835","BCM2836","BCM2837","BCM2711","BCM2712"],n=["Sony UK","Egoman","Embest","Sony Japan","Embest","Stadium"],i={"00":"A","01":"B","02":"A+","03":"B+","04":"2B","05":"Alpha (early prototype)","06":"CM1","08":"3B","09":"Zero","0a":"CM3","0c":"Zero W","0d":"3B+","0e":"3A+","0f":"Internal use only",10:"CM3+",11:"4B",12:"Zero 2 W",13:"400",14:"CM4",15:"CM4S",17:"5"},s=pe(e,"revision",":",!0),a=pe(e,"model:",":",!0),o=pe(e,"serial",":",!0);let l={};if({}.hasOwnProperty.call(t,s))l={model:a,serial:o,revisionCode:s,memory:t[s].memory,manufacturer:t[s].manufacturer,processor:t[s].processor,type:t[s].type,revision:t[s].revision};else{const t=("00000000"+pe(e,"revision",":",!0).toLowerCase()).substr(-8),u=parseInt((c=t.substr(2,1),("00000000"+parseInt(c,16).toString(2)).substr(-8)).substr(5,3),2)||0,p=n[parseInt(t.substr(3,1),10)],f=r[parseInt(t.substr(4,1),10)],d=t.substr(5,2);l={model:a,serial:o,revisionCode:s,memory:256*Math.pow(2,u),manufacturer:p,processor:f,type:{}.hasOwnProperty.call(i,d)?i[d]:"",revision:"1."+t.substr(7,1)}}var c;return l}function ge(e){return"string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))}L.toInt=function(e){let t=parseInt(e,10);return isNaN(t)&&(t=0),t},L.execOptsWin=ne,L.getCodepage=function(){if(B){if(!j)try{const e=N("chcp",ne),t=e.toString().split("\r\n")[0].split(":");j=t.length>1?t[1].replace(".","").trim():""}catch(e){j="437"}return j}if(M||R||F||G||W){if(!j)try{const e=N("echo $LANG"),t=e.toString().split("\r\n")[0].split(".");j=t.length>1?t[1].trim():"",j||(j="UTF-8")}catch(e){j="UTF-8"}return j}},L.execWin=function(e,t,r){r||(r=t,t=ne),A("chcp 65001 > nul && cmd /C "+e+" && chcp "+j+" > nul",t,(function(e,t){r(e,t)}))},L.isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},L.unique=function(e){let t=[],r={};for(let n=0;n<e.length;n++){let i=Object.keys(e[n]);i.sort((function(e,t){return e-t}));let s="";for(let t=0;t<i.length;t++)s+=JSON.stringify(i[t]),s+=JSON.stringify(e[n][i[t]]);({}).hasOwnProperty.call(r,s)||(t.push(e[n]),r[s]=!0)}return t},L.sortByKey=function(e,t){return e.sort((function(e,r){let n="",i="";return t.forEach((function(t){n+=e[t],i+=r[t]})),n<i?-1:n>i?1:0}))},L.cores=function(){return 0===U&&(U=_.cpus().length),U},L.getValue=pe,L.decodeEscapeSequence=function(e,t){return t=t||16,e.replace(/\\x([0-9A-Fa-f]{2})/g,(function(){return String.fromCharCode(parseInt(arguments[1],t))}))},L.parseDateTime=function(e,t){const r={date:"",time:""};let n=((t=t||{}).dateFormat||"").toLowerCase(),i=t.pmDesignator||"";const s=e.split(" ");if(s[0]){if(s[0].indexOf("/")>=0){const t=s[0].split("/");if(3===t.length)if(4===t[0].length)r.date=t[0]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[2]).substr(-2);else if(2===t[2].length)n.indexOf("/d/")>-1||n.indexOf("/dd/"),r.date="20"+t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2);else{(e.toLowerCase().indexOf("pm")>-1||e.toLowerCase().indexOf("p.m.")>-1||e.toLowerCase().indexOf("p. m.")>-1||e.toLowerCase().indexOf("am")>-1||e.toLowerCase().indexOf("a.m.")>-1||e.toLowerCase().indexOf("a. m.")>-1||n.indexOf("/d/")>-1||n.indexOf("/dd/")>-1)&&0!==n.indexOf("dd/")?r.date=t[2]+"-"+("0"+t[0]).substr(-2)+"-"+("0"+t[1]).substr(-2):r.date=t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2)}}if(s[0].indexOf(".")>=0){const e=s[0].split(".");3===e.length&&(n.indexOf(".d.")>-1||n.indexOf(".dd.")>-1?r.date=e[2]+"-"+("0"+e[0]).substr(-2)+"-"+("0"+e[1]).substr(-2):r.date=e[2]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[0]).substr(-2))}if(s[0].indexOf("-")>=0){const e=s[0].split("-");3===e.length&&(r.date=e[0]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[2]).substr(-2))}}if(s[1]){s.shift();let e=s.join(" ");r.time=function(e,t){t=t||"";let r=0,n=0,i=function(e){let t="",r=0;return e.split("").forEach((e=>{e>="0"&&e<="9"?1===r&&r++:(0===r&&r++,1===r&&(t+=e))})),t}(e=e.toUpperCase()),s=e.split(i);if(s.length>=2){s[2]&&(s[1]+=s[2]);let e=s[1]&&s[1].toLowerCase().indexOf("pm")>-1||s[1].toLowerCase().indexOf("p.m.")>-1||s[1].toLowerCase().indexOf("p. m.")>-1||s[1].toLowerCase().indexOf("n")>-1||s[1].toLowerCase().indexOf("ch")>-1||s[1].toLowerCase().indexOf("ös")>-1||t&&s[1].toLowerCase().indexOf(t)>-1;return r=parseInt(s[0],10),n=parseInt(s[1],10),r=e&&r<12?r+12:r,("0"+r).substr(-2)+":"+("0"+n).substr(-2)}}(e,i)}return r},L.parseHead=function(e,t){let r=t>0,n=1,i=0,s=0,a=[];for(let o=0;o<e.length;o++)n<=t?(/\s/.test(e[o])&&!r&&(s=o-1,a.push({from:i,to:s+1,cap:e.substring(i,s+1)}),i=s+2,n++),r=" "===e[o]):(!/\s/.test(e[o])&&r&&(s=o-1,i<s&&a.push({from:i,to:s,cap:e.substring(i,s)}),i=s+1,n++),r=" "===e[o]);s=5e3,a.push({from:i,to:s,cap:e.substring(i,s)});let o=a.length;for(let e=0;e<o;e++)0===a[e].cap.replace(/\s/g,"").length&&e+1<o&&(a[e].to=a[e+1].to,a[e].cap=a[e].cap+a[e+1].cap,a.splice(e+1,1),o-=1);return a},L.findObjectByKey=function(e,t,r){for(let n=0;n<e.length;n++)if(e[n][t]===r)return n;return-1},L.getWmic=fe,L.wmic=function(e){return new Promise((t=>{process.nextTick((()=>{try{me(fe()+" "+e).then((e=>{t(e,"")}))}catch(e){t("",e)}}))}))},L.darwinXcodeExists=function(){const e=P.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),t=P.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),r=P.existsSync("/Library/Developer/Xcode/");return e||r||t},L.getVboxmanage=function(){return B?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"},L.powerShell=me,L.powerShellStart=function(){K||(K=V("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})}),K&&K.pid&&(J=!0,K.stdout.on("data",(function(e){Y+=e.toString("utf8"),e.indexOf(te)>=0&&(de(Y),Y="")})),K.stderr.on("data",(function(){de(Y+ee)})),K.on("error",(function(){de(Y+ee)})),K.on("close",(function(){K.kill()}))))},L.powerShellRelease=function(){try{K&&(K.stdin.write("exit"+_.EOL),K.stdin.end(),J=!1)}catch(e){K&&K.kill()}K=null},L.execSafe=function(e,t,r){let n="";return r=r||{},new Promise((i=>{process.nextTick((()=>{try{const s=V(e,t,r);s&&!s.pid&&s.on("error",(function(){i(n)})),s&&s.pid?(s.stdout.on("data",(function(e){n+=e.toString()})),s.on("close",(function(){s.kill(),i(n)})),s.on("error",(function(){s.kill(),i(n)}))):i(n)}catch(e){i(n)}}))}))},L.nanoSeconds=function(){const e=process.hrtime();return Array.isArray(e)&&2===e.length?1e9*+e[0]+ +e[1]:0},L.countUniqueLines=function(e,t){t=t||"";const r=[];return e.forEach((e=>{e.startsWith(t)&&-1===r.indexOf(e)&&r.push(e)})),r.length},L.countLines=function(e,t){t=t||"";const r=[];return e.forEach((e=>{e.startsWith(t)&&r.push(e)})),r.length},L.noop=function(){},L.isRaspberry=function(){let e=[];if(null!==X)e=X;else try{e=P.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),X=e}catch(e){return!1}const t=pe(e,"hardware");return t&&["BCM2708","BCM2709","BCM2710","BCM2711","BCM2712","BCM2835","BCM2836","BCM2837","BCM2837B0"].indexOf(t)>-1},L.isRaspbian=function(){let e=[];try{e=P.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split("\n")}catch(e){return!1}const t=pe(e,"id","=");return t&&t.indexOf("raspbian")>-1},L.sanitizeShellString=function(e,t){void 0===t&&(t=!1);const r=e||"";let n="";const i=ue(r.length,2e3);for(let e=0;e<=i;e++)void 0===r[e]||">"===r[e]||"<"===r[e]||"*"===r[e]||"?"===r[e]||"["===r[e]||"]"===r[e]||"|"===r[e]||"˚"===r[e]||"$"===r[e]||";"===r[e]||"&"===r[e]||"]"===r[e]||"#"===r[e]||"\\"===r[e]||"\t"===r[e]||"\n"===r[e]||"\r"===r[e]||"'"===r[e]||"`"===r[e]||'"'===r[e]||r[e].length>1||t&&"("===r[e]||t&&")"===r[e]||t&&"@"===r[e]||t&&" "===r[e]||t&&"{"==r[e]||t&&";"==r[e]||t&&"}"==r[e]||(n+=r[e]);return n},L.isPrototypePolluted=function(){const e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let t=!0,r="";r.__proto__.replace=ie,r.__proto__.toLowerCase=se,r.__proto__.toString=ae,r.__proto__.substr=oe,t=t||!1;const n=Date.now();if("number"==typeof n&&n>16e11){const i=n%100+15;for(let n=0;n<i;n++){const n=61.99999999*Math.random()+1,i=parseInt(Math.floor(n).toString(),10),s=parseInt(n.toString().split(".")[0],10),a=61.99999999*Math.random()+1,o=parseInt(Math.floor(a).toString(),10),l=parseInt(a.toString().split(".")[0],10);t=t&&n!==a,t=t&&i===s&&o===l,r+=e[i-1]}t=t&&r.length===i;let s=Math.random()*i*.9999999999,a=r.substr(0,s)+" "+r.substr(s,2e3);a.__proto__.replace=ie;let o=a.replace(/ /g,"");t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"{"+r.substr(s,2e3),o=a.replace(/{/g,""),t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"*"+r.substr(s,2e3),o=a.replace(/\*/g,""),t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"$"+r.substr(s,2e3),o=a.replace(/\$/g,""),t=t&&r===o;const l=r.toLowerCase();t=t&&l.length===i&&l[i-1]&&!l[i];for(let e=0;e<i;e++){const n=r[e];n.__proto__.toLowerCase=se;const i=l?l[e]:"",s=n.toLowerCase();t=t&&s[0]===i&&s[0]&&!s[1]}}return!t},L.decodePiCpuinfo=he,L.getRpiGpu=function(){let e=null;if(null!==X)e=X;else try{e=P.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),X=e}catch(e){return!1}const t=he(e);return"4B"===t.type||"CM4"===t.type||"CM4S"===t.type||"400"===t.type?"VideoCore VI":"5"===t.type?"VideoCore VII":"VideoCore IV"},L.promiseAll=function(e){const t=e.map((function(e){return new Promise((function(t){let r=new Array(2);e.then((function(e){r[0]=e})).catch((function(e){r[1]=e})).then((function(){t(r)}))}))})),r=[],n=[];return Promise.all(t).then((function(e){return e.forEach((function(e){e[1]?(r.push(e[1]),n.push(null)):(r.push(null),n.push(e[0]))})),{errors:r,results:n}}))},L.promisify=function(e){return function(){const t=Array.prototype.slice.call(arguments);return new Promise((function(r,n){t.push((function(e,t){e?n(e):r(t)})),e.apply(null,t)}))}},L.promisifySave=function(e){return function(){const t=Array.prototype.slice.call(arguments);return new Promise((function(r){t.push((function(e,t){r(t)})),e.apply(null,t)}))}},L.smartMonToolsInstalled=function(){if(null!==H)return H;if(H=!1,B)try{const e=N("WHERE smartctl 2>nul",ne).toString().split("\r\n");H=!(!e||!e.length)&&e[0].indexOf(":\\")>=0}catch(e){H=!1}if(M||R||F||G||W)try{const e=N("which smartctl 2>/dev/null",ne).toString().split("\r\n");H=e.length>0}catch(e){D.noop()}return H},L.linuxVersion=function(){let e="";if(M)try{e=N("uname -v").toString()}catch(t){e=""}return e},L.plistParser=function(e){const t=["array","dict","key","string","integer","date","real","data","boolean","arrayEmpty"];let r=e.indexOf("<plist version"),n=e.length;for(;">"!==e[r]&&r<n;)r++;let i=0,s=!1,a=!1,o=!1,l=[{tagStart:"",tagEnd:"",tagContent:"",key:"",data:null}],c="",u=e[r];for(;r<n;)c=u,r+1<n&&(u=e[r+1]),"<"===c?(a=!1,"/"===u?o=!0:l[i].tagStart?(l[i].tagContent="",l[i].data||(l[i].data="array"===l[i].tagStart?[]:{}),i++,l.push({tagStart:"",tagEnd:"",tagContent:"",key:null,data:null}),s=!0,a=!1):s||(s=!0)):">"===c?("true/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/boolean",l[i].data=!0),"false/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/boolean",l[i].data=!1),"array/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/arrayEmpty",l[i].data=[]),a&&(a=!1),s&&(s=!1,a=!0,"array"===l[i].tagStart&&(l[i].data=[]),"dict"===l[i].tagStart&&(l[i].data={})),o&&(o=!1,l[i].tagEnd&&t.indexOf(l[i].tagEnd.substr(1))>=0&&("/dict"===l[i].tagEnd||"/array"===l[i].tagEnd?(i>1&&"array"===l[i-2].tagStart&&l[i-2].data.push(l[i-1].data),i>1&&"dict"===l[i-2].tagStart&&(l[i-2].data[l[i-1].key]=l[i-1].data),i--,l.pop(),l[i].tagContent="",l[i].tagStart="",l[i].tagEnd=""):("/key"===l[i].tagEnd&&l[i].tagContent?l[i].key=l[i].tagContent:("/real"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=parseFloat(l[i].tagContent)||0),"/integer"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=parseInt(l[i].tagContent)||0),"/string"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=l[i].tagContent||""),"/boolean"===l[i].tagEnd&&(l[i].data=l[i].tagContent||!1),"/arrayEmpty"===l[i].tagEnd&&(l[i].data=l[i].tagContent||[]),i>0&&"array"===l[i-1].tagStart&&l[i-1].data.push(l[i].data),i>0&&"dict"===l[i-1].tagStart&&(l[i-1].data[l[i].key]=l[i].data)),l[i].tagContent="",l[i].tagStart="",l[i].tagEnd="")),l[i].tagEnd="",s=!1,a=!1)):(s&&(l[i].tagStart+=c),o&&(l[i].tagEnd+=c),a&&(l[i].tagContent+=c)),r++;return l[0].data},L.plistReader=function(e){const t=e.split("\n");for(let e=0;e<t.length;e++){if(t[e].indexOf(" = ")>=0){const r=t[e].split(" = ");if(r[0]=r[0].trim(),r[0].startsWith('"')||(r[0]='"'+r[0]+'"'),r[1]=r[1].trim(),-1===r[1].indexOf('"')&&r[1].endsWith(";")){const e=r[1].substring(0,r[1].length-1);ge(e)||(r[1]=`"${e}";`)}if(r[1].indexOf('"')>=0&&r[1].endsWith(";")){const e=r[1].substring(0,r[1].length-1).replace(/"/g,"");ge(e)&&(r[1]=`${e};`)}t[e]=r.join(" : ")}t[e]=t[e].replace(/\(/g,"[").replace(/\)/g,"]").replace(/;/g,",").trim(),t[e].startsWith("}")&&t[e-1]&&t[e-1].endsWith(",")&&(t[e-1]=t[e-1].substring(0,t[e-1].length-1))}e=t.join("");let r={};try{r=JSON.parse(e)}catch(e){}return r},L.stringReplace=ie,L.stringToLower=se,L.stringToString=ae,L.stringSubstr=oe,L.stringTrim=le,L.stringStartWith=ce,L.mathMin=ue,L.WINDIR=z,L.getFilesInPath=function(e){const t=P.lstatSync,r=P.readdirSync,n=T.join;function i(e){return t(e).isDirectory()}function s(e){return t(e).isFile()}return P.existsSync(e)?function e(t){try{let a=function(e){return r(e).map((function(t){return n(e,t)})).filter(i)}(t);return a.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)}),[]).concat(function(e){return r(e).map((function(t){return n(e,t)})).filter(s)}(t))}catch(e){return[]}}(e):[]},L.semverCompare=function(e,t){let r=0;const n=e.split("."),i=t.split(".");return n[0]<i[0]?r=1:n[0]>i[0]?r=-1:n[0]===i[0]&&n.length>=2&&i.length>=2&&(n[1]<i[1]?r=1:n[1]>i[1]?r=-1:n[1]===i[1]&&(n.length>=3&&i.length>=3?n[2]<i[2]?r=1:n[2]>i[2]&&(r=-1):i.length>=3&&(r=1))),r};var ye={};const ve=h.default,Se=m.default,we=L,xe=y.default.exec,Ce=y.default.execSync,Oe=we.promisify(y.default.exec);let Ie=process.platform;const be="linux"===Ie||"android"===Ie,Ee="darwin"===Ie,Le="win32"===Ie,_e="freebsd"===Ie,Pe="openbsd"===Ie,Te="netbsd"===Ie,Ve="sunos"===Ie;function Ae(e){const t=e.toLowerCase();return-1===t.indexOf("o.e.m.")&&-1===t.indexOf("default string")&&"default"!==t&&e||""}ye.system=function(e){return new Promise((t=>{process.nextTick((()=>{let r={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((be||_e||Pe||Te)&&xe("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",(function(n,i){let s=i.toString().split("\n");r.manufacturer=we.getValue(s,"manufacturer"),r.model=we.getValue(s,"product name"),r.version=we.getValue(s,"version"),r.serial=we.getValue(s,"serial number"),r.uuid=we.getValue(s,"uuid").toLowerCase(),r.sku=we.getValue(s,"sku number");try{s=Ce('echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;\n echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;\n echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;\n echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;\n echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;').toString().split("\n"),r.manufacturer=""===r.manufacturer?we.getValue(s,"sys_vendor"):r.manufacturer,r.model=""===r.model?we.getValue(s,"product_name"):r.model,r.version=""===r.version?we.getValue(s,"product_version"):r.version,r.serial=""===r.serial?we.getValue(s,"product_serial"):r.serial,r.uuid=""===r.uuid?we.getValue(s,"product_uuid").toLowerCase():r.uuid}catch(e){we.noop()}if(r.serial&&-1===r.serial.toLowerCase().indexOf("o.e.m.")||(r.serial="-"),r.manufacturer&&-1===r.manufacturer.toLowerCase().indexOf("o.e.m.")||(r.manufacturer=""),r.model&&-1===r.model.toLowerCase().indexOf("o.e.m.")||(r.model="Computer"),r.version&&-1===r.version.toLowerCase().indexOf("o.e.m.")||(r.version=""),r.sku&&-1===r.sku.toLowerCase().indexOf("o.e.m.")||(r.sku="-"),"virtualbox"===r.model.toLowerCase()||"kvm"===r.model.toLowerCase()||"virtual machine"===r.model.toLowerCase()||"bochs"===r.model.toLowerCase()||r.model.toLowerCase().startsWith("vmware")||r.model.toLowerCase().startsWith("droplet"))switch(r.virtual=!0,r.model.toLowerCase()){case"virtualbox":r.virtualHost="VirtualBox";break;case"vmware":r.virtualHost="VMware";break;case"kvm":r.virtualHost="KVM";break;case"bochs":r.virtualHost="bochs"}if(r.manufacturer.toLowerCase().startsWith("vmware")||"xen"===r.manufacturer.toLowerCase())switch(r.virtual=!0,r.manufacturer.toLowerCase()){case"vmware":r.virtualHost="VMware";break;case"xen":r.virtualHost="Xen"}if(!r.virtual)try{const e=Ce("ls -1 /dev/disk/by-id/ 2>/dev/null").toString();e.indexOf("_QEMU_")>=0&&(r.virtual=!0,r.virtualHost="QEMU"),e.indexOf("_VBOX_")>=0&&(r.virtual=!0,r.virtualHost="VirtualBox")}catch(e){we.noop()}if(!r.virtual&&(Se.release().toLowerCase().indexOf("microsoft")>=0||Se.release().toLowerCase().endsWith("wsl2"))){const e=parseFloat(Se.release().toLowerCase());r.virtual=!0,r.manufacturer="Microsoft",r.model="WSL",r.version=e<4.19?"1":"2"}if((_e||Pe||Te)&&!r.virtualHost)try{const e=Ce("dmidecode -t 4").toString().split("\n");switch(we.getValue(e,"manufacturer",":",!0).toLowerCase()){case"virtualbox":r.virtualHost="VirtualBox";break;case"vmware":r.virtualHost="VMware";break;case"kvm":r.virtualHost="KVM";break;case"bochs":r.virtualHost="bochs"}}catch(e){we.noop()}(ve.existsSync("/.dockerenv")||ve.existsSync("/.dockerinit"))&&(r.model="Docker Container");try{const e=Ce('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');e.toString().split("\n").length>0&&("Computer"===r.model&&(r.model="Virtual machine"),r.virtual=!0,e.toString().toLowerCase().indexOf("vmware")>=0&&!r.virtualHost&&(r.virtualHost="VMware"),e.toString().toLowerCase().indexOf("qemu")>=0&&!r.virtualHost&&(r.virtualHost="QEMU"),e.toString().toLowerCase().indexOf("xen")>=0&&!r.virtualHost&&(r.virtualHost="Xen"),e.toString().toLowerCase().indexOf("kvm")>=0&&!r.virtualHost&&(r.virtualHost="KVM"))}catch(e){we.noop()}""===r.manufacturer&&"Computer"===r.model&&""===r.version?ve.readFile("/proc/cpuinfo",(function(n,i){if(!n){let e=i.toString().split("\n");r.model=we.getValue(e,"hardware",":",!0).toUpperCase(),r.version=we.getValue(e,"revision",":",!0).toLowerCase(),r.serial=we.getValue(e,"serial",":",!0);const t=we.getValue(e,"model:",":",!0);if(("BCM2835"===r.model||"BCM2708"===r.model||"BCM2709"===r.model||"BCM2710"===r.model||"BCM2711"===r.model||"BCM2836"===r.model||"BCM2837"===r.model)&&t.toLowerCase().indexOf("raspberry")>=0){const t=we.decodePiCpuinfo(e);r.model=t.model,r.version=t.revisionCode,r.manufacturer="Raspberry Pi Foundation",r.raspberry={manufacturer:t.manufacturer,processor:t.processor,type:t.type,revision:t.revision}}}e&&e(r),t(r)})):(e&&e(r),t(r))})),Ee&&xe("ioreg -c IOPlatformExpertDevice -d 2",(function(n,i){if(!n){let e=i.toString().replace(/[<>"]/g,"").split("\n");r.manufacturer=we.getValue(e,"manufacturer","=",!0),r.model=we.getValue(e,"model","=",!0,!0),r.version=we.getValue(e,"version","=",!0),r.serial=we.getValue(e,"ioplatformserialnumber","=",!0),r.uuid=we.getValue(e,"ioplatformuuid","=",!0).toLowerCase(),r.sku=we.getValue(e,"board-id","=",!0)}e&&e(r),t(r)})),Ve&&(e&&e(r),t(r)),Le)try{we.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then(((n,i)=>{if(i)e&&e(r),t(r);else{let i=n.split("\r\n");r.manufacturer=we.getValue(i,"vendor",":"),r.model=we.getValue(i,"name",":"),r.version=we.getValue(i,"version",":"),r.serial=we.getValue(i,"identifyingnumber",":"),r.uuid=we.getValue(i,"uuid",":").toLowerCase();const s=r.model.toLowerCase();("virtualbox"===s||"kvm"===s||"virtual machine"===s||"bochs"===s||s.startsWith("vmware")||s.startsWith("qemu")||s.startsWith("parallels"))&&(r.virtual=!0,s.startsWith("virtualbox")&&(r.virtualHost="VirtualBox"),s.startsWith("vmware")&&(r.virtualHost="VMware"),s.startsWith("kvm")&&(r.virtualHost="KVM"),s.startsWith("bochs")&&(r.virtualHost="bochs"),s.startsWith("qemu")&&(r.virtualHost="KVM"),s.startsWith("parallels")&&(r.virtualHost="Parallels"));const a=r.manufacturer.toLowerCase();(a.startsWith("vmware")||a.startsWith("qemu")||"xen"===a||a.startsWith("parallels"))&&(r.virtual=!0,a.startsWith("vmware")&&(r.virtualHost="VMware"),a.startsWith("xen")&&(r.virtualHost="Xen"),a.startsWith("qemu")&&(r.virtualHost="KVM"),a.startsWith("parallels")&&(r.virtualHost="Parallels")),we.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then(((n,i)=>{if(!i){let e=n.split("\r\n");r.sku=we.getValue(e,"systemsku",":")}r.virtual?(e&&e(r),t(r)):we.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then(((n,i)=>{if(i)e&&e(r),t(r);else{let i=n.toString();(i.indexOf("VRTUAL")>=0||i.indexOf("A M I ")>=0||i.indexOf("VirtualBox")>=0||i.indexOf("VMWare")>=0||i.indexOf("Xen")>=0||i.indexOf("Parallels")>=0)&&(r.virtual=!0,i.indexOf("VirtualBox")>=0&&!r.virtualHost&&(r.virtualHost="VirtualBox"),i.indexOf("VMware")>=0&&!r.virtualHost&&(r.virtualHost="VMware"),i.indexOf("Xen")>=0&&!r.virtualHost&&(r.virtualHost="Xen"),i.indexOf("VRTUAL")>=0&&!r.virtualHost&&(r.virtualHost="Hyper-V"),i.indexOf("A M I")>=0&&!r.virtualHost&&(r.virtualHost="Virtual PC"),i.indexOf("Parallels")>=0&&!r.virtualHost&&(r.virtualHost="Parallels")),e&&e(r),t(r)}}))}))}}))}catch(n){e&&e(r),t(r)}}))}))},ye.bios=function(e){return new Promise((t=>{process.nextTick((()=>{let r={vendor:"",version:"",releaseDate:"",revision:""},n="";if((be||_e||Pe||Te)&&(n="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL",xe(n,(function(n,i){let s=i.toString().split("\n");r.vendor=we.getValue(s,"Vendor"),r.version=we.getValue(s,"Version");let a=we.getValue(s,"Release Date");r.releaseDate=we.parseDateTime(a).date,r.revision=we.getValue(s,"BIOS Revision"),r.serial=we.getValue(s,"SerialNumber");let o=we.getValue(s,"Currently Installed Language").split("|")[0];if(o&&(r.language=o),s.length&&i.toString().indexOf("Characteristics:")>=0){const e=[];s.forEach((t=>{if(t.indexOf(" is supported")>=0){const r=t.split(" is supported")[0].trim();e.push(r)}})),r.features=e}try{s=Ce('echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;\n echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;\n echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;').toString().split("\n"),r.vendor=r.vendor?r.vendor:we.getValue(s,"bios_vendor"),r.version=r.version?r.version:we.getValue(s,"bios_version"),a=we.getValue(s,"bios_date"),r.releaseDate=r.releaseDate?r.releaseDate:we.parseDateTime(a).date}catch(e){we.noop()}e&&e(r),t(r)}))),Ee&&(r.vendor="Apple Inc.",xe("system_profiler SPHardwareDataType -json",(function(n,i){try{const e=JSON.parse(i.toString());if(e&&e.SPHardwareDataType&&e.SPHardwareDataType.length){let t=e.SPHardwareDataType[0].boot_rom_version;t=t?t.split("(")[0].trim():null,r.version=t}}catch(e){we.noop()}e&&e(r),t(r)}))),Ve&&(r.vendor="Sun Microsystems",e&&e(r),t(r)),Le)try{we.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then(((n,i)=>{if(!i){let e=n.toString().split("\r\n");const t=we.getValue(e,"description",":"),i=we.getValue(e,"SMBIOSBIOSVersion",":");-1!==t.indexOf(" Version ")?(r.vendor=t.split(" Version ")[0].trim(),r.version=t.split(" Version ")[1].trim()):-1!==t.indexOf(" Ver: ")?(r.vendor=we.getValue(e,"manufacturer",":"),r.version=t.split(" Ver: ")[1].trim()):(r.vendor=we.getValue(e,"manufacturer",":"),r.version=i||we.getValue(e,"version",":")),r.releaseDate=we.getValue(e,"releasedate",":"),r.revision=we.getValue(e,"buildnumber",":"),r.serial=Ae(we.getValue(e,"serialnumber",":"))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},ye.baseboard=function(e){return new Promise((t=>{process.nextTick((()=>{let r={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},n="";if(be||_e||Pe||Te){n="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";const i=[];i.push(Oe(n)),i.push(Oe("export LC_ALL=C; dmidecode -t memory 2>/dev/null")),we.promiseAll(i).then((n=>{let i=n.results[0]?n.results[0].toString().split("\n"):[""];r.manufacturer=we.getValue(i,"Manufacturer"),r.model=we.getValue(i,"Product Name"),r.version=we.getValue(i,"Version"),r.serial=we.getValue(i,"Serial Number"),r.assetTag=we.getValue(i,"Asset Tag");try{i=Ce('echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;\n echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;\n echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;\n echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;\n echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;').toString().split("\n"),r.manufacturer=r.manufacturer?r.manufacturer:we.getValue(i,"board_vendor"),r.model=r.model?r.model:we.getValue(i,"board_name"),r.version=r.version?r.version:we.getValue(i,"board_version"),r.serial=r.serial?r.serial:we.getValue(i,"board_serial"),r.assetTag=r.assetTag?r.assetTag:we.getValue(i,"board_asset_tag")}catch(e){we.noop()}-1!==r.serial.toLowerCase().indexOf("o.e.m.")&&(r.serial="-"),-1!==r.assetTag.toLowerCase().indexOf("o.e.m.")&&(r.assetTag="-"),i=n.results[1]?n.results[1].toString().split("\n"):[""],r.memMax=1024*we.toInt(we.getValue(i,"Maximum Capacity"))*1024*1024||null,r.memSlots=we.toInt(we.getValue(i,"Number Of Devices"))||null;let s="";try{s=ve.readFileSync("/proc/cpuinfo").toString().split("\n")}catch(e){we.noop()}if(s){if(we.getValue(s,"hardware").startsWith("BCM")){const e=we.decodePiCpuinfo(s);r.manufacturer=e.manufacturer,r.model="Raspberry Pi",r.serial=e.serial,r.version=e.type+" - "+e.revision,r.memMax=Se.totalmem(),r.memSlots=0}}e&&e(r),t(r)}))}if(Ee){const n=[];n.push(Oe("ioreg -c IOPlatformExpertDevice -d 2")),n.push(Oe("system_profiler SPMemoryDataType")),we.promiseAll(n).then((n=>{let i=n.results[0]?n.results[0].toString().replace(/[<>"]/g,"").split("\n"):[""];r.manufacturer=we.getValue(i,"manufacturer","=",!0),r.model=we.getValue(i,"model","=",!0),r.version=we.getValue(i,"version","=",!0),r.serial=we.getValue(i,"ioplatformserialnumber","=",!0),r.assetTag=we.getValue(i,"board-id","=",!0);let s=n.results[1]?n.results[1].toString().split(" BANK "):[""];1===s.length&&(s=n.results[1]?n.results[1].toString().split(" DIMM"):[""]),s.shift(),r.memSlots=s.length,"arm64"===Se.arch()&&(r.memSlots=0,r.memMax=Se.totalmem()),e&&e(r),t(r)}))}if(Ve&&(e&&e(r),t(r)),Le)try{const n=[],i=parseInt(Se.release())>=10,s=i?"MaxCapacityEx":"MaxCapacity";n.push(we.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")),n.push(we.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${s}, MemoryDevices | fl`)),we.promiseAll(n).then((n=>{let a=n.results[0]?n.results[0].toString().split("\r\n"):[""];r.manufacturer=Ae(we.getValue(a,"manufacturer",":")),r.model=Ae(we.getValue(a,"model",":")),r.model||(r.model=Ae(we.getValue(a,"product",":"))),r.version=Ae(we.getValue(a,"version",":")),r.serial=Ae(we.getValue(a,"serialnumber",":")),r.assetTag=Ae(we.getValue(a,"partnumber",":")),r.assetTag||(r.assetTag=Ae(we.getValue(a,"sku",":"))),a=n.results[1]?n.results[1].toString().split("\r\n"):[""],r.memMax=we.toInt(we.getValue(a,s,":"))*(i?1024:1)||null,r.memSlots=we.toInt(we.getValue(a,"MemoryDevices",":"))||null,e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},ye.chassis=function(e){const t=["Other","Unknown","Desktop","Low Profile Desktop","Pizza Box","Mini Tower","Tower","Portable","Laptop","Notebook","Hand Held","Docking Station","All in One","Sub Notebook","Space-Saving","Lunch Box","Main System Chassis","Expansion Chassis","SubChassis","Bus Expansion Chassis","Peripheral Chassis","Storage Chassis","Rack Mount Chassis","Sealed-Case PC","Multi-System Chassis","Compact PCI","Advanced TCA","Blade","Blade Enclosure","Tablet","Convertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise((r=>{process.nextTick((()=>{let n={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if(be||_e||Pe||Te){xe('echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;\n echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;\n echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;\n echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;\n echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;',(function(i,s){let a=s.toString().split("\n");n.manufacturer=we.getValue(a,"chassis_vendor");const o=parseInt(we.getValue(a,"chassis_type").replace(/\D/g,""));n.type=o&&!isNaN(o)&&o<t.length?t[o-1]:"",n.version=we.getValue(a,"chassis_version"),n.serial=we.getValue(a,"chassis_serial"),n.assetTag=we.getValue(a,"chassis_asset_tag"),-1!==n.manufacturer.toLowerCase().indexOf("o.e.m.")&&(n.manufacturer="-"),-1!==n.version.toLowerCase().indexOf("o.e.m.")&&(n.version="-"),-1!==n.serial.toLowerCase().indexOf("o.e.m.")&&(n.serial="-"),-1!==n.assetTag.toLowerCase().indexOf("o.e.m.")&&(n.assetTag="-"),e&&e(n),r(n)}))}if(Ee&&xe("ioreg -c IOPlatformExpertDevice -d 2",(function(t,i){if(!t){let e=i.toString().replace(/[<>"]/g,"").split("\n");n.manufacturer=we.getValue(e,"manufacturer","=",!0),n.model=we.getValue(e,"model","=",!0),n.version=we.getValue(e,"version","=",!0),n.serial=we.getValue(e,"ioplatformserialnumber","=",!0),n.assetTag=we.getValue(e,"board-id","=",!0)}e&&e(n),r(n)})),Ve&&(e&&e(n),r(n)),Le)try{we.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then(((i,s)=>{if(!s){let e=i.toString().split("\r\n");n.manufacturer=Ae(we.getValue(e,"manufacturer",":")),n.model=Ae(we.getValue(e,"model",":"));const r=parseInt(we.getValue(e,"ChassisTypes",":").replace(/\D/g,""));n.type=r&&!isNaN(r)&&r<t.length?t[r-1]:"",n.version=Ae(we.getValue(e,"version",":")),n.serial=Ae(we.getValue(e,"serialnumber",":")),n.assetTag=Ae(we.getValue(e,"partnumber",":")),n.assetTag||(n.assetTag=Ae(we.getValue(e,"SMBIOSAssetTag",":"))),n.sku=Ae(we.getValue(e,"sku",":"))}e&&e(n),r(n)}))}catch(t){e&&e(n),r(n)}}))}))};var Ne={};const De=m.default,ke=h.default,Me=L,Re=y.default.exec,Be=y.default.execSync;let Fe=process.platform;const Ge="linux"===Fe||"android"===Fe,We="darwin"===Fe,Ue="win32"===Fe,$e="freebsd"===Fe,je="openbsd"===Fe,He="netbsd"===Fe,Xe="sunos"===Fe;function ze(e){e=(e=e||"").toLowerCase();let t=Fe;return Ue?t="windows":-1!==e.indexOf("mac os")?t="apple":-1!==e.indexOf("arch")?t="arch":-1!==e.indexOf("centos")?t="centos":-1!==e.indexOf("coreos")?t="coreos":-1!==e.indexOf("debian")?t="debian":-1!==e.indexOf("deepin")?t="deepin":-1!==e.indexOf("elementary")?t="elementary":-1!==e.indexOf("fedora")?t="fedora":-1!==e.indexOf("gentoo")?t="gentoo":-1!==e.indexOf("mageia")?t="mageia":-1!==e.indexOf("mandriva")?t="mandriva":-1!==e.indexOf("manjaro")?t="manjaro":-1!==e.indexOf("mint")?t="mint":-1!==e.indexOf("mx")?t="mx":-1!==e.indexOf("openbsd")?t="openbsd":-1!==e.indexOf("freebsd")?t="freebsd":-1!==e.indexOf("opensuse")?t="opensuse":-1!==e.indexOf("pclinuxos")?t="pclinuxos":-1!==e.indexOf("puppy")?t="puppy":-1!==e.indexOf("raspbian")?t="raspbian":-1!==e.indexOf("reactos")?t="reactos":-1!==e.indexOf("redhat")?t="redhat":-1!==e.indexOf("slackware")?t="slackware":-1!==e.indexOf("sugar")?t="sugar":-1!==e.indexOf("steam")?t="steam":-1!==e.indexOf("suse")?t="suse":-1!==e.indexOf("mate")?t="ubuntu-mate":-1!==e.indexOf("lubuntu")?t="lubuntu":-1!==e.indexOf("xubuntu")?t="xubuntu":-1!==e.indexOf("ubuntu")?t="ubuntu":-1!==e.indexOf("solaris")?t="solaris":-1!==e.indexOf("tails")?t="tails":-1!==e.indexOf("feren")?t="ferenos":-1!==e.indexOf("robolinux")?t="robolinux":Ge&&e&&(t=e.toLowerCase().trim().replace(/\s+/g,"-")),t}function Ke(){let e=De.hostname;if(Ge||We)try{const t=Be("hostnamectl --json short 2>/dev/null");e=JSON.parse(t.toString()).StaticHostname}catch(t){try{e=Be("hostname -f 2>/dev/null").toString().split(De.EOL)[0]}catch(e){Me.noop()}}if($e||je||He)try{e=Be("hostname 2>/dev/null").toString().split(De.EOL)[0]}catch(e){Me.noop()}if(Ue)try{e=Be("echo %COMPUTERNAME%.%USERDNSDOMAIN%",Me.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(De.EOL)[0]}catch(e){Me.noop()}return e}function Ye(){let e=[];try{const t=De.networkInterfaces();for(let r in t)({}).hasOwnProperty.call(t,r)&&t[r].forEach((function(t){if(t&&t.mac&&"00:00:00:00:00:00"!==t.mac){const r=t.mac.toLowerCase();-1===e.indexOf(r)&&e.push(r)}}));e=e.sort((function(e,t){return e<t?-1:e>t?1:0}))}catch(t){e.push("00:00:00:00:00:00")}return e}function qe(e){return new Promise((t=>{process.nextTick((()=>{let r,n={os:"",hardware:"",macs:Ye()};if(We&&Re("system_profiler SPHardwareDataType -json",(function(r,i){if(!r)try{const e=JSON.parse(i.toString());if(e.SPHardwareDataType&&e.SPHardwareDataType.length>0){const t=e.SPHardwareDataType[0];n.os=t.platform_UUID.toLowerCase(),n.hardware=t.serial_number}}catch(e){Me.noop()}e&&e(n),t(n)})),Ge){Re('echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null; echo;\necho -n "os: "; cat /etc/machine-id 2> /dev/null; echo;\necho -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;',(function(r,i){const s=i.toString().split("\n");if(n.os=Me.getValue(s,"os").toLowerCase(),n.hardware=Me.getValue(s,"hardware").toLowerCase(),!n.hardware){const e=ke.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),t=Me.getValue(e,"serial");n.hardware=t||""}e&&e(n),t(n)}))}if(($e||je||He)&&Re("sysctl -i kern.hostid kern.hostuuid",(function(r,i){const s=i.toString().split("\n");n.os=Me.getValue(s,"kern.hostid",":").toLowerCase(),n.hardware=Me.getValue(s,"kern.hostuuid",":").toLowerCase(),n.os.indexOf("unknown")>=0&&(n.os=""),n.hardware.indexOf("unknown")>=0&&(n.hardware=""),e&&e(n),t(n)})),Ue){let i="%windir%\\System32";"ia32"===process.arch&&Object.prototype.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")&&(i="%windir%\\sysnative\\cmd.exe /c %windir%\\System32"),Me.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then((s=>{let a=s.split("\r\n");n.hardware=Me.getValue(a,"uuid",":").toLowerCase(),Re(`${i}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`,Me.execOptsWin,(function(i,s){r=s.toString().split("\n\r")[0].split("REG_SZ"),n.os=r.length>1?r[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase():"",e&&e(n),t(n)}))}))}}))}))}Ne.time=function(){let e=(new Date).toString().split(" ");return{current:Date.now(),uptime:De.uptime(),timezone:e.length>=7?e[5]:"",timezoneName:Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:e.length>=7?e.slice(6).join(" ").replace(/\(/g,"").replace(/\)/g,""):""}},Ne.osInfo=function(e){return new Promise((t=>{process.nextTick((()=>{let r={platform:"win32"===Fe?"Windows":Fe,distro:"unknown",release:"unknown",codename:"",kernel:De.release(),arch:De.arch(),hostname:De.hostname(),fqdn:Ke(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(Ge&&Re("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",(function(n,i){let s={};i.toString().split("\n").forEach((function(e){-1!==e.indexOf("=")&&(s[e.split("=")[0].trim().toUpperCase()]=e.split("=")[1].trim())}));let a=(s.VERSION||"").replace(/"/g,""),o=(s.DISTRIB_CODENAME||s.VERSION_CODENAME||"").replace(/"/g,"");a.indexOf("(")>=0&&(o=a.split("(")[1].replace(/[()]/g,"").trim(),a=a.split("(")[0].trim()),r.distro=(s.DISTRIB_ID||s.NAME||"unknown").replace(/"/g,""),r.logofile=ze(r.distro),r.release=(a||s.DISTRIB_RELEASE||s.VERSION_ID||"unknown").replace(/"/g,""),r.codename=o,r.codepage=Me.getCodepage(),r.build=(s.BUILD_ID||"").replace(/"/g,"").trim(),new Promise((e=>{process.nextTick((()=>{ke.stat("/sys/firmware/efi",(function(t){if(!t)return e(!0);Re('dmesg | grep -E "EFI v"',(function(t,r){if(!t){const t=r.toString().split("\n");return e(t.length>0)}return e(!1)}))}))}))})).then((n=>{r.uefi=n,qe().then((n=>{r.serial=n.os,e&&e(r),t(r)}))}))})),($e||je||He)&&Re("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml",(function(n,i){let s=i.toString().split("\n");const a=Me.getValue(s,"kern.ostype"),o=ze(a),l=Me.getValue(s,"kern.osrelease").split("-")[0],c=Me.getValue(s,"kern.uuid"),u=Me.getValue(s,"machdep.bootmethod"),p=i.toString().indexOf("<type>efi</type>")>=0,f=u?u.toLowerCase().indexOf("uefi")>=0:p||null;r.distro=a||r.distro,r.logofile=o||r.logofile,r.release=l||r.release,r.serial=c||r.serial,r.codename="",r.codepage=Me.getCodepage(),r.uefi=f||null,e&&e(r),t(r)})),We&&Re("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",(function(n,i){let s=i.toString().split("\n");r.serial=Me.getValue(s,"kern.uuid"),r.distro=Me.getValue(s,"ProductName"),r.release=(Me.getValue(s,"ProductVersion",":",!0,!0)+" "+Me.getValue(s,"ProductVersionExtra",":",!0,!0)).trim(),r.build=Me.getValue(s,"BuildVersion"),r.logofile=ze(r.distro),r.codename="macOS",r.codename=r.release.indexOf("10.4")>-1?"Mac OS X Tiger":r.codename,r.codename=r.release.indexOf("10.5")>-1?"Mac OS X Leopard":r.codename,r.codename=r.release.indexOf("10.6")>-1?"Mac OS X Snow Leopard":r.codename,r.codename=r.release.indexOf("10.7")>-1?"Mac OS X Lion":r.codename,r.codename=r.release.indexOf("10.8")>-1?"OS X Mountain Lion":r.codename,r.codename=r.release.indexOf("10.9")>-1?"OS X Mavericks":r.codename,r.codename=r.release.indexOf("10.10")>-1?"OS X Yosemite":r.codename,r.codename=r.release.indexOf("10.11")>-1?"OS X El Capitan":r.codename,r.codename=r.release.indexOf("10.12")>-1?"macOS Sierra":r.codename,r.codename=r.release.indexOf("10.13")>-1?"macOS High Sierra":r.codename,r.codename=r.release.indexOf("10.14")>-1?"macOS Mojave":r.codename,r.codename=r.release.indexOf("10.15")>-1?"macOS Catalina":r.codename,r.codename=r.release.startsWith("11.")?"macOS Big Sur":r.codename,r.codename=r.release.startsWith("12.")?"macOS Monterey":r.codename,r.codename=r.release.startsWith("13.")?"macOS Ventura":r.codename,r.codename=r.release.startsWith("14.")?"macOS Sonoma":r.codename,r.uefi=!0,r.codepage=Me.getCodepage(),e&&e(r),t(r)})),Xe&&(r.release=r.kernel,Re("uname -o",(function(n,i){let s=i.toString().split("\n");r.distro=s[0],r.logofile=ze(r.distro),e&&e(r),t(r)}))),Ue){r.logofile=ze(),r.release=r.kernel;try{const n=[];n.push(Me.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")),n.push(Me.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),n.push(Me.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),Me.promiseAll(n).then((n=>{let i=n.results[0]?n.results[0].toString().split("\r\n"):[""];r.distro=Me.getValue(i,"Caption",":").trim(),r.serial=Me.getValue(i,"SerialNumber",":").trim(),r.build=Me.getValue(i,"BuildNumber",":").trim(),r.servicepack=Me.getValue(i,"ServicePackMajorVersion",":").trim()+"."+Me.getValue(i,"ServicePackMinorVersion",":").trim(),r.codepage=Me.getCodepage();const s=n.results[1]?n.results[1].toString().toLowerCase():"";r.hypervisor=-1!==s.indexOf("true");const a=n.results[2]?n.results[2].toString():"";r.remoteSession=a.toString().toLowerCase().indexOf("true")>=0,new Promise((e=>{process.nextTick((()=>{try{Re('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',Me.execOptsWin,(function(t,r){if(!t){const t=r.toString().split("\n\r")[0];return e(t.toLowerCase().indexOf("efi")>=0)}Re("echo %firmware_type%",Me.execOptsWin,(function(t,r){if(t)return e(!1);{const t=r.toString()||"";return e(t.toLowerCase().indexOf("efi")>=0)}}))}))}catch(t){return e(!1)}}))})).then((n=>{r.uefi=n,e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}}}))}))},Ne.versions=function(e,t){let r={kernel:De.release(),openssl:"",systemOpenssl:"",systemOpensslLib:"",node:process.versions.node,v8:process.versions.v8,npm:"",yarn:"",pm2:"",gulp:"",grunt:"",git:"",tsc:"",mysql:"",redis:"",mongodb:"",apache:"",nginx:"",php:"",docker:"",postfix:"",postgresql:"",perl:"",python:"",python3:"",pip:"",pip3:"",java:"",gcc:"",virtualbox:"",bash:"",zsh:"",fish:"",powershell:"",dotnet:""};return new Promise((n=>{process.nextTick((()=>{if(Me.isFunction(e)&&!t)t=e,e="*";else if("string"!=typeof(e=e||"*"))return t&&t({}),n({});const i=function(e){if("*"===e)return{versions:r,counter:30};if(!Array.isArray(e)){e=(e=e.trim().toLowerCase().replace(/,+/g,"|").replace(/ /g,"|")).split("|");const t={versions:{},counter:0};return e.forEach((e=>{if(e)for(let n in r)({}).hasOwnProperty.call(r,n)&&(n.toLowerCase()!==e.toLowerCase()||{}.hasOwnProperty.call(t.versions,n)||(t.versions[n]=r[n],"openssl"===n&&(t.versions.systemOpenssl="",t.versions.systemOpensslLib=""),t.versions[n]||t.counter++))})),t}}(e);let s=i.counter,a=function(){0==--s&&(t&&t(i.versions),n(i.versions))},o="";try{if({}.hasOwnProperty.call(i.versions,"openssl")&&(i.versions.openssl=process.versions.openssl,Re("openssl version",(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim().split(" ");i.versions.systemOpenssl=e.length>0?e[1]:e[0],i.versions.systemOpensslLib=e.length>0?e[0]:"openssl"}a()}))),{}.hasOwnProperty.call(i.versions,"npm")&&Re("npm -v",(function(e,t){e||(i.versions.npm=t.toString().split("\n")[0]),a()})),{}.hasOwnProperty.call(i.versions,"pm2")&&(o="pm2",Ue&&(o+=".cmd"),Re(`${o} -v`,(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim();e.startsWith("[PM2]")||(i.versions.pm2=e)}a()}))),{}.hasOwnProperty.call(i.versions,"yarn")&&Re("yarn --version",(function(e,t){e||(i.versions.yarn=t.toString().split("\n")[0]),a()})),{}.hasOwnProperty.call(i.versions,"gulp")&&(o="gulp",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.gulp=(e.toLowerCase().split("version")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"tsc")&&(o="tsc",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.tsc=(e.toLowerCase().split("version")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"grunt")&&(o="grunt",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.grunt=(e.toLowerCase().split("cli v")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"git"))if(We){const e=ke.existsSync("/usr/local/Cellar/git")||ke.existsSync("/opt/homebrew/bin/git");Me.darwinXcodeExists()||e?Re("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),i.versions.git=(e.split(" ")[0]||"").trim()}a()})):a()}else Re("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),i.versions.git=(e.split(" ")[0]||"").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"apache")&&Re("apachectl -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(":");i.versions.apache=e.length>1?e[1].replace("Apache","").replace("/","").split("(")[0].trim():""}a()})),{}.hasOwnProperty.call(i.versions,"nginx")&&Re("nginx -v 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.nginx=(e.toLowerCase().split("/")[1]||"").trim()}a()})),{}.hasOwnProperty.call(i.versions,"mysql")&&Re("mysql -V",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";if(e=e.toLowerCase(),e.indexOf(",")>-1){e=(e.split(",")[0]||"").trim();const t=e.split(" ");i.versions.mysql=(t[t.length-1]||"").trim()}else e.indexOf(" ver ")>-1&&(e=e.split(" ver ")[1],i.versions.mysql=e.split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"php")&&Re("php -v",(function(e,t){if(!e){let e=(t.toString().split("\n")[0]||"").split("(");e[0].indexOf("-")&&(e=e[0].split("-")),i.versions.php=e[0].replace(/[^0-9.]/g,"")}a()})),{}.hasOwnProperty.call(i.versions,"redis")&&Re("redis-server --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.redis=Me.getValue(e,"v","=",!0)}a()})),{}.hasOwnProperty.call(i.versions,"docker")&&Re("docker --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.docker=e.length>2&&e[2].endsWith(",")?e[2].slice(0,-1):""}a()})),{}.hasOwnProperty.call(i.versions,"postfix")&&Re("postconf -d | grep mail_version",(function(e,t){if(!e){const e=t.toString().split("\n")||[];i.versions.postfix=Me.getValue(e,"mail_version","=",!0)}a()})),{}.hasOwnProperty.call(i.versions,"mongodb")&&Re("mongod --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.mongodb=(e.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}a()})),{}.hasOwnProperty.call(i.versions,"postgresql")&&(Ge?Re("locate bin/postgres",(function(e,t){if(e)Re("psql -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:"",i.versions.postgresql=i.versions.postgresql.split("-")[0]}a()}));else{const e=t.toString().split("\n").sort();e.length?Re(e[e.length-1]+" -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:""}a()})):a()}})):Ue?Me.powerShell("Get-CimInstance Win32_Service | select caption | fl").then((e=>{e.split(/\n\s*\n/).forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=Me.getValue(t,"caption",":",!0).toLowerCase();if(r.indexOf("postgresql")>-1){const e=r.split(" server ");e.length>1&&(i.versions.postgresql=e[1])}}})),a()})):Re("postgres -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:""}a()}))),{}.hasOwnProperty.call(i.versions,"perl")&&Re("perl -v",(function(e,t){if(!e){const e=t.toString().split("\n")||"";for(;e.length>0&&""===e[0].trim();)e.shift();e.length>0&&(i.versions.perl=e[0].split("(").pop().split(")")[0].replace("v",""))}a()})),{}.hasOwnProperty.call(i.versions,"python"))if(We)try{const e=Be("sw_vers").toString().split("\n"),t=Me.getValue(e,"ProductVersion",":"),r=ke.existsSync("/usr/local/Cellar/python"),n=ke.existsSync("/opt/homebrew/bin/python");if(Me.darwinXcodeExists()&&Me.semverCompare("12.0.1",t)<0||r||n){Re(r?"/usr/local/Cellar/python -V 2>&1":n?"/opt/homebrew/bin/python -V 2>&1":"python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python=e.toLowerCase().replace("python","").trim()}a()}))}else a()}catch(e){a()}else Re("python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python=e.toLowerCase().replace("python","").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"python3"))if(We){const e=ke.existsSync("/usr/local/Cellar/python3")||ke.existsSync("/opt/homebrew/bin/python3");Me.darwinXcodeExists()||e?Re("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python3=e.toLowerCase().replace("python","").trim()}a()})):a()}else Re("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python3=e.toLowerCase().replace("python","").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"pip"))if(We){const e=ke.existsSync("/usr/local/Cellar/pip")||ke.existsSync("/opt/homebrew/bin/pip");Me.darwinXcodeExists()||e?Re("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip=e.length>=2?e[1]:""}a()})):a()}else Re("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip=e.length>=2?e[1]:""}a()}));if({}.hasOwnProperty.call(i.versions,"pip3"))if(We){const e=ke.existsSync("/usr/local/Cellar/pip3")||ke.existsSync("/opt/homebrew/bin/pip3");Me.darwinXcodeExists()||e?Re("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip3=e.length>=2?e[1]:""}a()})):a()}else Re("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip3=e.length>=2?e[1]:""}a()}));({}).hasOwnProperty.call(i.versions,"java")&&(We?Re("/usr/libexec/java_home -V 2>&1",(function(e,t){e||-1!==t.toString().toLowerCase().indexOf("no java runtime")?a():Re("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');i.versions.java=3===e.length?e[1].trim():""}a()}))})):Re("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');i.versions.java=3===e.length?e[1].trim():""}a()}))),{}.hasOwnProperty.call(i.versions,"gcc")&&(We&&Me.darwinXcodeExists()||!We?Re("gcc -dumpversion",(function(e,t){e||(i.versions.gcc=t.toString().split("\n")[0].trim()||""),i.versions.gcc.indexOf(".")>-1?a():Re("gcc --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].trim();if(e.indexOf("gcc")>-1&&e.indexOf(")")>-1){const t=e.split(")");i.versions.gcc=t[1].trim()||i.versions.gcc}}a()}))})):a()),{}.hasOwnProperty.call(i.versions,"virtualbox")&&Re(Me.getVboxmanage()+" -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split("r");i.versions.virtualbox=e[0]}a()})),{}.hasOwnProperty.call(i.versions,"bash")&&Re("bash --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(i.versions.bash=e[1].split(" ")[0].split("(")[0])}a()})),{}.hasOwnProperty.call(i.versions,"zsh")&&Re("zsh --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split("zsh ");e.length>1&&(i.versions.zsh=e[1].split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"fish")&&Re("fish --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(i.versions.fish=e[1].split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"powershell")&&(Ue?Me.powerShell("$PSVersionTable").then((e=>{const t=e.toString().split("\n").map((e=>e.replace(/ +/g," ").replace(/ +/g,":")));i.versions.powershell=Me.getValue(t,"psversion"),a()})):a()),{}.hasOwnProperty.call(i.versions,"dotnet")&&(Ue?Me.powerShell('gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release').then((e=>{const t=e.toString().split("\r\n");let r="";t.forEach((e=>{const t=(e=e.replace(/ +/g," ")).split(" ");r=r||(t[0].toLowerCase().startsWith("client")&&t.length>2||t[0].toLowerCase().startsWith("full")&&t.length>2?t[1].trim():"")})),i.versions.dotnet=r.trim(),a()})):a())}catch(e){t&&t(i.versions),n(i.versions)}}))}))},Ne.shell=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ue)t("cmd");else{let r="";Re("echo $SHELL",(function(n,i){n||(r=i.toString().split("\n")[0]),e&&e(r),t(r)}))}}))}))},Ne.uuid=qe;var Je={};const Qe=m.default,Ze=y.default.exec,et=y.default.execSync,tt=h.default,rt=L;let nt=process.platform;const it="linux"===nt||"android"===nt,st="darwin"===nt,at="win32"===nt,ot="freebsd"===nt,lt="openbsd"===nt,ct="netbsd"===nt,ut="sunos"===nt;let pt=0,ft={user:0,nice:0,system:0,idle:0,irq:0,steal:0,guest:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,currentLoadSteal:0,currentLoadGuest:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0,rawCurrentLoadSteal:0,rawCurrentLoadGuest:0},dt=[],mt=0;const ht={8346:"1.8",8347:"1.9",8350:"2.0",8354:"2.2","8356|SE":"2.4",8356:"2.3",8360:"2.5",2372:"2.1",2373:"2.1",2374:"2.2",2376:"2.3",2377:"2.3",2378:"2.4",2379:"2.4",2380:"2.5",2381:"2.5",2382:"2.6",2384:"2.7",2386:"2.8",2387:"2.8",2389:"2.9",2393:"3.1",8374:"2.2",8376:"2.3",8378:"2.4",8379:"2.4",8380:"2.5",8381:"2.5",8382:"2.6",8384:"2.7",8386:"2.8",8387:"2.8",8389:"2.9",8393:"3.1","2419EE":"1.8","2423HE":"2.0","2425HE":"2.1",2427:"2.2",2431:"2.4",2435:"2.6","2439SE":"2.8","8425HE":"2.1",8431:"2.4",8435:"2.6","8439SE":"2.8",4122:"2.2",4130:"2.6","4162EE":"1.7","4164EE":"1.8","4170HE":"2.1","4174HE":"2.3","4176HE":"2.4",4180:"2.6",4184:"2.8","6124HE":"1.8","6128HE":"2.0","6132HE":"2.2",6128:"2.0",6134:"2.3",6136:"2.4",6140:"2.6","6164HE":"1.7","6166HE":"1.8",6168:"1.9",6172:"2.1",6174:"2.2",6176:"2.3","6176SE":"2.3","6180SE":"2.5",3250:"2.5",3260:"2.7",3280:"2.4",4226:"2.7",4228:"2.8",4230:"2.9",4234:"3.1",4238:"3.3",4240:"3.4",4256:"1.6",4274:"2.5",4276:"2.6",4280:"2.8",4284:"3.0",6204:"3.3",6212:"2.6",6220:"3.0",6234:"2.4",6238:"2.6","6262HE":"1.6",6272:"2.1",6274:"2.2",6276:"2.3",6278:"2.4","6282SE":"2.6","6284SE":"2.7",6308:"3.5",6320:"2.8",6328:"3.2","6338P":"2.3",6344:"2.6",6348:"2.8",6366:"1.8","6370P":"2.0",6376:"2.3",6378:"2.4",6380:"2.5",6386:"2.8","FX|4100":"3.6","FX|4120":"3.9","FX|4130":"3.8","FX|4150":"3.8","FX|4170":"4.2","FX|6100":"3.3","FX|6120":"3.6","FX|6130":"3.6","FX|6200":"3.8","FX|8100":"2.8","FX|8120":"3.1","FX|8140":"3.2","FX|8150":"3.6","FX|8170":"3.9","FX|4300":"3.8","FX|4320":"4.0","FX|4350":"4.2","FX|6300":"3.5","FX|6350":"3.9","FX|8300":"3.3","FX|8310":"3.4","FX|8320":"3.5","FX|8350":"4.0","FX|8370":"4.0","FX|9370":"4.4","FX|9590":"4.7","FX|8320E":"3.2","FX|8370E":"3.3",1200:"3.1","Pro 1200":"3.1","1300X":"3.5","Pro 1300":"3.5",1400:"3.2","1500X":"3.5","Pro 1500":"3.5",1600:"3.2","1600X":"3.6","Pro 1600":"3.2",1700:"3.0","Pro 1700":"3.0","1700X":"3.4","Pro 1700X":"3.4","1800X":"3.6","1900X":"3.8",1920:"3.2","1920X":"3.5","1950X":"3.4","200GE":"3.2","Pro 200GE":"3.2","220GE":"3.4","240GE":"3.5","3000G":"3.5","300GE":"3.4","3050GE":"3.4","2200G":"3.5","Pro 2200G":"3.5","2200GE":"3.2","Pro 2200GE":"3.2","2400G":"3.6","Pro 2400G":"3.6","2400GE":"3.2","Pro 2400GE":"3.2","Pro 200U":"2.3","300U":"2.4","2200U":"2.5","3200U":"2.6","2300U":"2.0","Pro 2300U":"2.0","2500U":"2.0","Pro 2500U":"2.2","2600H":"3.2","2700U":"2.0","Pro 2700U":"2.2","2800H":"3.3",7351:"2.4","7351P":"2.4",7401:"2.0","7401P":"2.0","7551P":"2.0",7551:"2.0",7251:"2.1",7261:"2.5",7281:"2.1",7301:"2.2",7371:"3.1",7451:"2.3",7501:"2.0",7571:"2.2",7601:"2.2",V1500B:"2.2",V1780B:"3.35",V1202B:"2.3",V1404I:"2.0",V1605B:"2.0",V1756B:"3.25",V1807B:"3.35",3101:"2.1",3151:"2.7",3201:"1.5",3251:"2.5",3255:"2.5",3301:"2.0",3351:"1.9",3401:"1.85",3451:"2.15","1200|AF":"3.1","2300X":"3.5","2500X":"3.6",2600:"3.4","2600E":"3.1","1600|AF":"3.2","2600X":"3.6",2700:"3.2","2700E":"2.8","Pro 2700":"3.2","2700X":"3.7","Pro 2700X":"3.6","2920X":"3.5","2950X":"3.5","2970WX":"3.0","2990WX":"3.0","Pro 300GE":"3.4","Pro 3125GE":"3.4","3150G":"3.5","Pro 3150G":"3.5","3150GE":"3.3","Pro 3150GE":"3.3","3200G":"3.6","Pro 3200G":"3.6","3200GE":"3.3","Pro 3200GE":"3.3","3350G":"3.6","Pro 3350G":"3.6","3350GE":"3.3","Pro 3350GE":"3.3","3400G":"3.7","Pro 3400G":"3.7","3400GE":"3.3","Pro 3400GE":"3.3","3300U":"2.1","PRO 3300U":"2.1","3450U":"2.1","3500U":"2.1","PRO 3500U":"2.1","3500C":"2.1","3550H":"2.1","3580U":"2.1","3700U":"2.3","PRO 3700U":"2.3","3700C":"2.3","3750H":"2.3","3780U":"2.3",3100:"3.6","3300X":"3.8",3500:"3.6","3500X":"3.6",3600:"3.6","Pro 3600":"3.6","3600X":"3.8","3600XT":"3.8","Pro 3700":"3.6","3700X":"3.6","3800X":"3.9","3800XT":"3.9",3900:"3.1","Pro 3900":"3.1","3900X":"3.8","3900XT":"3.8","3950X":"3.5","3960X":"3.8","3970X":"3.7","3990X":"2.9","3945WX":"4.0","3955WX":"3.9","3975WX":"3.5","3995WX":"2.7","4300GE":"3.5","Pro 4300GE":"3.5","4300G":"3.8","Pro 4300G":"3.8","4600GE":"3.3","Pro 4650GE":"3.3","4600G":"3.7","Pro 4650G":"3.7","4700GE":"3.1","Pro 4750GE":"3.1","4700G":"3.6","Pro 4750G":"3.6","4300U":"2.7","4450U":"2.5","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4680U":"2.1","4600HS":"3.0","4600H":"3.0","4700U":"2.0","PRO 4750U":"1.7","4800U":"1.8","4800HS":"2.9","4800H":"2.9","4900HS":"3.0","4900H":"3.3","5300U":"2.6","5500U":"2.1","5700U":"1.8","7232P":"3.1","7302P":"3.0","7402P":"2.8","7502P":"2.5","7702P":"2.0",7252:"3.1",7262:"3.2",7272:"2.9",7282:"2.8",7302:"3.0",7352:"2.3",7402:"2.8",7452:"2.35",7502:"2.5",7532:"2.4",7542:"2.9",7552:"2.2",7642:"2.3",7662:"2.0",7702:"2.0",7742:"2.25","7H12":"2.6","7F32":"3.7","7F52":"3.5","7F72":"3.2","7773X":"2.2",7763:"2.45",7713:"2.0","7713P":"2.0",7663:"2.0",7643:"2.3","7573X":"2.8","75F3":"2.95",7543:"2.8","7543P":"2.8",7513:"2.6","7473X":"2.8",7453:"2.75","74F3":"3.2",7443:"2.85","7443P":"2.85",7413:"2.65","7373X":"3.05","73F3":"3.5",7343:"3.2",7313:"3.0","7313P":"3.0","72F3":"3.7","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4","5945WX":"4.1","5955WX":"4.0","5965WX":"3.8","5975WX":"3.6","5995WX":"2.7","7960X":"4.2","7970X":"4.0","7980X":"3.2","7965WX":"4.2","7975WX":"4.0","7985WX":"3.2","7995WX":"2.5",9754:"2.25","9754S":"2.25",9734:"2.2","9684X":"2.55","9384X":"3.1","9184X":"3.55","9654P":"2.4",9654:"2.4",9634:"2.25","9554P":"3.1",9554:"3.1",9534:"2.45","9474F":"3.6","9454P":"2.75",9454:"2.75","9374F":"3.85","9354P":"3.25",9354:"3.25",9334:"2.7","9274F":"4.05",9254:"2.9",9224:"2.5","9174F":"4.1",9124:"3.0"},gt={1:"Other",2:"Unknown",3:"Daughter Board",4:"ZIF Socket",5:"Replacement/Piggy Back",6:"None",7:"LIF Socket",8:"Slot 1",9:"Slot 2",10:"370 Pin Socket",11:"Slot A",12:"Slot M",13:"423",14:"A (Socket 462)",15:"478",16:"754",17:"940",18:"939",19:"mPGA604",20:"LGA771",21:"LGA775",22:"S1",23:"AM2",24:"F (1207)",25:"LGA1366",26:"G34",27:"AM3",28:"C32",29:"LGA1156",30:"LGA1567",31:"PGA988A",32:"BGA1288",33:"rPGA988B",34:"BGA1023",35:"BGA1224",36:"LGA1155",37:"LGA1356",38:"LGA2011",39:"FS1",40:"FS2",41:"FM1",42:"FM2",43:"LGA2011-3",44:"LGA1356-3",45:"LGA1150",46:"BGA1168",47:"BGA1234",48:"BGA1364",49:"AM4",50:"LGA1151",51:"BGA1356",52:"BGA1440",53:"BGA1515",54:"LGA3647-1",55:"SP3",56:"SP3r2",57:"LGA2066",58:"BGA1392",59:"BGA1510",60:"BGA1528",61:"LGA4189",62:"LGA1200",63:"LGA4677",64:"LGA1700",65:"BGA1744",66:"BGA1781",67:"BGA1211",68:"BGA2422",69:"LGA1211",70:"LGA2422",71:"LGA5773",72:"BGA5773"},yt={LGA1150:"i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",LGA1151:"i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",1155:"G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"};function vt(e){let t=e;return(e=e.toLowerCase()).indexOf("intel")>=0&&(t="Intel"),e.indexOf("amd")>=0&&(t="AMD"),e.indexOf("qemu")>=0&&(t="QEMU"),e.indexOf("hygon")>=0&&(t="Hygon"),e.indexOf("centaur")>=0&&(t="WinChip/Via"),e.indexOf("vmware")>=0&&(t="VMware"),e.indexOf("Xen")>=0&&(t="Xen Hypervisor"),e.indexOf("tcg")>=0&&(t="QEMU"),e.indexOf("apple")>=0&&(t="Apple"),t}function St(e){e.brand=e.brand.replace(/\(R\)+/g,"®").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(TM\)+/g,"™").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(C\)+/g,"©").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),e.manufacturer=vt(e.brand);let t=e.brand.split(" ");return t.shift(),e.brand=t.join(" "),e}function wt(e){let t="0";for(let r in ht)if({}.hasOwnProperty.call(ht,r)){let n=r.split("|"),i=0;n.forEach((t=>{e.indexOf(t)>-1&&i++})),i===n.length&&(t=ht[r])}return parseFloat(t)}function xt(){return new Promise((e=>{process.nextTick((()=>{const t="unknown";let r={manufacturer:t,brand:t,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:rt.cores(),physicalCores:rt.cores(),performanceCores:rt.cores(),efficiencyCores:0,processors:1,socket:"",flags:"",virtualization:!1,cache:{}};Ot().then((t=>{if(r.flags=t,r.virtualization=t.indexOf("vmx")>-1||t.indexOf("svm")>-1,st&&Ze("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",(function(t,n){let i=n.toString().split("\n");const s=rt.getValue(i,"machdep.cpu.brand_string").split("@");r.brand=s[0].trim();const a=s[1]?s[1].trim():"0";r.speed=parseFloat(a.replace(/GHz+/g,""));let o=rt.getValue(i,"hw.tbfrequency")/1e9;o=o<.1?100*o:o,r.speed=0===r.speed?o:r.speed,pt=r.speed,r=St(r),r.speedMin=rt.getValue(i,"hw.cpufrequency_min")?rt.getValue(i,"hw.cpufrequency_min")/1e9:r.speed,r.speedMax=rt.getValue(i,"hw.cpufrequency_max")?rt.getValue(i,"hw.cpufrequency_max")/1e9:r.speed,r.vendor=rt.getValue(i,"machdep.cpu.vendor")||"Apple",r.family=rt.getValue(i,"machdep.cpu.family")||rt.getValue(i,"hw.cpufamily"),r.model=rt.getValue(i,"machdep.cpu.model"),r.stepping=rt.getValue(i,"machdep.cpu.stepping")||rt.getValue(i,"hw.cpusubfamily"),r.virtualization=!0;const l=rt.getValue(i,"hw.packages"),c=rt.getValue(i,"hw.physicalcpu_max"),u=rt.getValue(i,"hw.ncpu");if("arm64"===Qe.arch()){r.socket="SOC";try{const e=et("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n"),t=e.filter((e=>e.indexOf('"E"')>=0)).length,n=e.filter((e=>e.indexOf('"P"')>=0)).length;r.efficiencyCores=t,r.performanceCores=n}catch(e){rt.noop()}}l&&(r.processors=parseInt(l)||1),c&&u&&(r.cores=parseInt(u)||rt.cores(),r.physicalCores=parseInt(c)||rt.cores()),It().then((t=>{r.cache=t,e(r)}))})),it){let t="",n=[];Qe.cpus()[0]&&Qe.cpus()[0].model&&(t=Qe.cpus()[0].model),Ze('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL',(function(i,s){i||(n=s.toString().split("\n")),t=rt.getValue(n,"model name")||t;const a=t.split("@");if(r.brand=a[0].trim(),r.speed=a[1]?parseFloat(a[1].trim()):0,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed){const e=Ct();0!==e.avg&&(r.speed=e.avg)}pt=r.speed,r.speedMin=Math.round(parseFloat(rt.getValue(n,"cpu min mhz").replace(/,/g,"."))/10)/100,r.speedMax=Math.round(parseFloat(rt.getValue(n,"cpu max mhz").replace(/,/g,"."))/10)/100,r=St(r),r.vendor=vt(rt.getValue(n,"vendor id")),r.family=rt.getValue(n,"cpu family"),r.model=rt.getValue(n,"model:"),r.stepping=rt.getValue(n,"stepping"),r.revision=rt.getValue(n,"cpu revision"),r.cache.l1d=rt.getValue(n,"l1d cache"),r.cache.l1d&&(r.cache.l1d=parseInt(r.cache.l1d)*(-1!==r.cache.l1d.indexOf("M")?1048576:-1!==r.cache.l1d.indexOf("K")?1024:1)),r.cache.l1i=rt.getValue(n,"l1i cache"),r.cache.l1i&&(r.cache.l1i=parseInt(r.cache.l1i)*(-1!==r.cache.l1i.indexOf("M")?1048576:-1!==r.cache.l1i.indexOf("K")?1024:1)),r.cache.l2=rt.getValue(n,"l2 cache"),r.cache.l2&&(r.cache.l2=parseInt(r.cache.l2)*(-1!==r.cache.l2.indexOf("M")?1048576:-1!==r.cache.l2.indexOf("K")?1024:1)),r.cache.l3=rt.getValue(n,"l3 cache"),r.cache.l3&&(r.cache.l3=parseInt(r.cache.l3)*(-1!==r.cache.l3.indexOf("M")?1048576:-1!==r.cache.l3.indexOf("K")?1024:1));const o=rt.getValue(n,"thread(s) per core")||"1",l=rt.getValue(n,"socket(s)")||"1";let c=parseInt(o,10),u=parseInt(l,10)||1;const p=parseInt(rt.getValue(n,"core(s) per socket"),10);if(r.physicalCores=p?p*u:r.cores/c,r.performanceCores=c>1?r.cores-r.physicalCores:r.cores,r.efficiencyCores=c>1?r.cores-c*r.performanceCores:0,r.processors=u,r.governor=rt.getValue(n,"governor")||"","ARM"===r.vendor){const e=tt.readFileSync("/proc/cpuinfo").toString().split("\n"),t=rt.decodePiCpuinfo(e);t.model.toLowerCase().indexOf("raspberry")>=0&&(r.family=r.manufacturer,r.manufacturer=t.manufacturer,r.brand=t.processor,r.revision=t.revisionCode,r.socket="SOC")}let f=[];Ze('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL',(function(t,n){f=n.toString().split("\n"),f&&f.length&&(r.socket=rt.getValue(f,"Upgrade").replace("Socket","").trim()||r.socket),e(r)}))}))}if(ot||lt||ct){let t="",n=[];Qe.cpus()[0]&&Qe.cpus()[0].model&&(t=Qe.cpus()[0].model),Ze("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL",(function(i,s){let a=[];if(!i){const e=s.toString().split("# dmidecode"),t=e.length>1?e[1]:"";a=e.length>2?e[2].split("Cache Information"):[],n=t.split("\n")}if(r.brand=t.split("@")[0].trim(),r.speed=t.split("@")[1]?parseFloat(t.split("@")[1].trim()):0,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed){const e=Ct();0!==e.avg&&(r.speed=e.avg)}pt=r.speed,r.speedMin=r.speed,r.speedMax=Math.round(parseFloat(rt.getValue(n,"max speed").replace(/Mhz/g,""))/10)/100,r=St(r),r.vendor=vt(rt.getValue(n,"manufacturer"));let o=rt.getValue(n,"signature");o=o.split(",");for(let e=0;e<o.length;e++)o[e]=o[e].trim();r.family=rt.getValue(o,"Family"," ",!0),r.model=rt.getValue(o,"Model"," ",!0),r.stepping=rt.getValue(o,"Stepping"," ",!0),r.revision="";const l=parseFloat(rt.getValue(n,"voltage"));r.voltage=isNaN(l)?"":l.toFixed(2);for(let e=0;e<a.length;e++){n=a[e].split("\n");let t=rt.getValue(n,"Socket Designation").toLowerCase().replace(" ","-").split("-");t=t.length?t[0]:"";const i=rt.getValue(n,"Installed Size").split(" ");let s=parseInt(i[0],10);const o=i.length>1?i[1]:"kb";s*="kb"===o?1024:"mb"===o?1048576:"gb"===o?1073741824:1,t&&("l1"===t?(r.cache[t+"d"]=s/2,r.cache[t+"i"]=s/2):r.cache[t]=s)}r.socket=rt.getValue(n,"Upgrade").replace("Socket","").trim();const c=rt.getValue(n,"thread count").trim(),u=rt.getValue(n,"core count").trim();u&&c&&(r.cores=parseInt(c,10),r.physicalCores=parseInt(u,10)),e(r)}))}if(ut&&e(r),at)try{const t=[];t.push(rt.powerShell("Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl")),t.push(rt.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),t.push(rt.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),Promise.all(t).then((t=>{let n=t[0].split("\r\n"),i=rt.getValue(n,"name",":")||"";i.indexOf("@")>=0?(r.brand=i.split("@")[0].trim(),r.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,pt=r.speed):(r.brand=i.trim(),r.speed=0),r=St(r),r.revision=rt.getValue(n,"revision",":"),r.vendor=rt.getValue(n,"manufacturer",":"),r.speedMax=Math.round(parseFloat(rt.getValue(n,"maxclockspeed",":").replace(/,/g,"."))/10)/100,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed&&(r.speed=r.speedMax),r.speedMin=r.speed;let s=rt.getValue(n,"description",":").split(" ");for(let e=0;e<s.length;e++)s[e].toLowerCase().startsWith("family")&&e+1<s.length&&s[e+1]&&(r.family=s[e+1]),s[e].toLowerCase().startsWith("model")&&e+1<s.length&&s[e+1]&&(r.model=s[e+1]),s[e].toLowerCase().startsWith("stepping")&&e+1<s.length&&s[e+1]&&(r.stepping=s[e+1]);const a=rt.getValue(n,"UpgradeMethod",":");gt[a]&&(r.socket=gt[a]);const o=function(e){let t="";for(const r in yt)yt[r].split(" ").forEach((n=>{e.indexOf(n)>=0&&(t=r)}));return t}(i);o&&(r.socket=o);const l=rt.countLines(n,"Caption"),c=rt.getValue(n,"NumberOfLogicalProcessors",":"),u=rt.getValue(n,"NumberOfCores",":");l&&(r.processors=parseInt(l)||1),u&&c&&(r.cores=parseInt(c)||rt.cores(),r.physicalCores=parseInt(u)||rt.cores()),l>1&&(r.cores=r.cores*l,r.physicalCores=r.physicalCores*l),r.cache=bt(t[0],t[1]);const p=t[2]?t[2].toString().toLowerCase():"";r.virtualization=-1!==p.indexOf("true"),e(r)}))}catch(t){e(r)}}))}))}))}function Ct(){let e=Qe.cpus(),t=999999999,r=0,n=0,i=[];if(e&&e.length){for(let s in e)if({}.hasOwnProperty.call(e,s)){let a=e[s].speed>100?(e[s].speed+1)/1e3:e[s].speed/10;n+=a,a>r&&(r=a),a<t&&(t=a),i.push(parseFloat(a.toFixed(2)))}return n/=e.length,{min:parseFloat(t.toFixed(2)),max:parseFloat(r.toFixed(2)),avg:parseFloat(n.toFixed(2)),cores:i}}return{min:0,max:0,avg:0,cores:i}}function Ot(e){return new Promise((t=>{process.nextTick((()=>{let r="";if(at)try{Ze('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet',rt.execOptsWin,(function(n,i){if(!n){let e=i.split("0x").pop().trim(),t=parseInt(e,16).toString(2),n="0".repeat(32-t.length)+t,s=["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","","sep","mtrr","pge","mca","cmov","pat","pse-36","psn","clfsh","","ds","acpi","mmx","fxsr","sse","sse2","ss","htt","tm","ia64","pbe"];for(let e=0;e<s.length;e++)"1"===n[e]&&""!==s[e]&&(r+=" "+s[e]);r=r.trim().toLowerCase()}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(it)try{Ze("export LC_ALL=C; lscpu; unset LC_ALL",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){-1!==e.split(":")[0].toUpperCase().indexOf("FLAGS")&&(r=e.split(":")[1].trim().toLowerCase())}))}r?(e&&e(r),t(r)):tt.readFile("/proc/cpuinfo",(function(n,i){if(!n){let e=i.toString().split("\n");r=rt.getValue(e,"features",":",!0).toLowerCase()}e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}(ot||lt||ct)&&Ze("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL",(function(n,i){let s=[];if(!n){let e=i.toString().split("\tFlags:");(e.length>1?e[1].split("\tVersion:")[0].split("\n"):[]).forEach((function(e){let t=(e.indexOf("(")?e.split("(")[0].toLowerCase():"").trim().replace(/\t/g,"");t&&s.push(t)}))}r=s.join(" ").trim().toLowerCase(),e&&e(r),t(r)})),st&&Ze("sysctl machdep.cpu.features",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&-1!==e[0].indexOf("machdep.cpu.features:")&&(r=e[0].split(":")[1].trim().toLowerCase())}e&&e(r),t(r)})),ut&&(e&&e(r),t(r))}))}))}function It(e){return new Promise((t=>{process.nextTick((()=>{let r={l1d:null,l1i:null,l2:null,l3:null};if(it)try{Ze("export LC_ALL=C; lscpu; unset LC_ALL",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toUpperCase().indexOf("L1D CACHE")&&(r.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L1I CACHE")&&(r.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L2 CACHE")&&(r.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L3 CACHE")&&(r.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1))}))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if((ot||lt||ct)&&Ze("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL",(function(n,i){let s=[];if(!n){s=i.toString().split("Cache Information"),s.shift()}for(let e=0;e<s.length;e++){const t=s[e].split("\n");let n=rt.getValue(t,"Socket Designation").toLowerCase().replace(" ","-").split("-");n=n.length?n[0]:"";const i=rt.getValue(t,"Installed Size").split(" ");let a=parseInt(i[0],10);const o=i.length>1?i[1]:"kb";a*="kb"===o?1024:"mb"===o?1048576:"gb"===o?1073741824:1,n&&("l1"===n?(r.cache[n+"d"]=a/2,r.cache[n+"i"]=a/2):r.cache[n]=a)}e&&e(r),t(r)})),st&&Ze("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toLowerCase().indexOf("hw.l1icachesize")&&(r.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l1dcachesize")&&(r.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l2cachesize")&&(r.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l3cachesize")&&(r.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1))}))}e&&e(r),t(r)})),ut&&(e&&e(r),t(r)),at)try{const n=[];n.push(rt.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")),n.push(rt.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),Promise.all(n).then((n=>{r=bt(n[0],n[1]),e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))}function bt(e,t){let r={l1d:null,l1i:null,l2:null,l3:null},n=e.split("\r\n");r.l1d=0,r.l1i=0,r.l2=rt.getValue(n,"l2cachesize",":"),r.l3=rt.getValue(n,"l3cachesize",":"),r.l2?r.l2=1024*parseInt(r.l2,10):r.l2=0,r.l3?r.l3=1024*parseInt(r.l3,10):r.l3=0;const i=t.split(/\n\s*\n/);let s=0,a=0,o=0;return i.forEach((function(e){const t=e.split("\r\n"),n=rt.getValue(t,"CacheType"),i=rt.getValue(t,"Level"),l=rt.getValue(t,"InstalledSize");"3"===i&&"3"===n&&(r.l1i=r.l1i+1024*parseInt(l,10)),"3"===i&&"4"===n&&(r.l1d=r.l1d+1024*parseInt(l,10)),"3"===i&&"5"===n&&(s=parseInt(l,10)/2,a=parseInt(l,10)/2),"4"===i&&"5"===n&&(o+=1024*parseInt(l,10))})),r.l1i||r.l1d||(r.l1i=s,r.l1d=a),o&&(r.l2=o),r}Je.cpu=function(e){return new Promise((t=>{process.nextTick((()=>{xt().then((r=>{e&&e(r),t(r)}))}))}))},Je.cpuCurrentSpeed=function(e){return new Promise((t=>{process.nextTick((()=>{let r=Ct();if(0===r.avg&&0!==pt){const e=parseFloat(pt);r={min:e,max:e,avg:e,cores:[]}}e&&e(r),t(r)}))}))},Je.cpuTemperature=function(e){return new Promise((t=>{process.nextTick((()=>{let r={main:null,cores:[],max:null,socket:[],chipset:null};if(it){try{const e=et('cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;').toString().split("-----\n");if(2===e.length){const t=e[0].split("\n"),n=e[1].split("\n");for(let e=0;e<t.length;e++){const i=t[e].trim();i.startsWith("acpi")&&n[e]&&r.socket.push(Math.round(parseInt(n[e],10)/100)/10),i.startsWith("pch")&&n[e]&&(r.chipset=Math.round(parseInt(n[e],10)/100)/10)}}}catch(e){rt.noop()}const n='for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';try{Ze(n,(function(n,i){const s=(i=i.toString()).toLowerCase().indexOf("tdie");-1!==s&&(i=i.substring(s));let a=i.split("\n"),o=0;if(a.forEach((e=>{const t=e.split("___"),n=t[0],i=t.length>1&&t[1]?t[1]:"0";i&&n&&"tctl"===n.toLowerCase()&&(o=r.main=Math.round(parseInt(i,10)/100)/10),i&&(void 0===n||n&&n.toLowerCase().startsWith("core"))?r.cores.push(Math.round(parseInt(i,10)/100)/10):i&&n&&null===r.main&&(n.toLowerCase().indexOf("package")>=0||n.toLowerCase().indexOf("physical")>=0||"tccd1"===n.toLowerCase())&&(r.main=Math.round(parseInt(i,10)/100)/10)})),o&&null===r.main&&(r.main=o),r.cores.length>0){null===r.main&&(r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length));let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}if(null!==r.main)return null===r.max&&(r.max=r.main),e&&e(r),void t(r);Ze("sensors",(function(n,i){if(!n){let n=i.toString().split("\n"),s=null,a=!0,o="";if(n.forEach((function(e){""===e.trim()?a=!0:a&&(e.trim().toLowerCase().startsWith("acpi")&&(o="acpi"),e.trim().toLowerCase().startsWith("pch")&&(o="pch"),e.trim().toLowerCase().startsWith("core")&&(o="core"),a=!1);let t=e.match(/[+-]([^°]*)/g),n=e.split(":")[0].toUpperCase();"acpi"===o?-1!==n.indexOf("TEMP")&&r.socket.push(parseFloat(t)):"pch"===o&&(-1===n.indexOf("TEMP")||r.chipset||(r.chipset=parseFloat(t))),-1===n.indexOf("PHYSICAL")&&-1===n.indexOf("PACKAGE")||(r.main=parseFloat(t)),-1!==n.indexOf("CORE ")&&r.cores.push(parseFloat(t)),-1!==n.indexOf("TDIE")&&null===s&&(s=parseFloat(t))})),r.cores.length>0){r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length);let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}else null===r.main&&null!==s&&(r.main=s,r.max=s);if(null!==r.main||null!==r.max)return e&&e(r),void t(r)}tt.stat("/sys/class/thermal/thermal_zone0/temp",(function(n){null===n?tt.readFile("/sys/class/thermal/thermal_zone0/temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&(r.main=parseFloat(e[0])/1e3,r.max=r.main)}e&&e(r),t(r)})):Ze("/opt/vc/bin/vcgencmd measure_temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&e[0].indexOf("=")&&(r.main=parseFloat(e[0].split("=")[1]),r.max=r.main)}e&&e(r),t(r)}))}))}))}))}catch(n){e&&e(r),t(r)}}if((ot||lt||ct)&&Ze("sysctl dev.cpu | grep temp",(function(n,i){if(!n){let e=i.toString().split("\n"),t=0;e.forEach((function(e){const n=e.split(":");if(n.length>1){const e=parseFloat(n[1].replace(",","."));e>r.max&&(r.max=e),t+=e,r.cores.push(e)}})),r.cores.length&&(r.main=Math.round(t/r.cores.length*100)/100)}e&&e(r),t(r)})),st){let n=null;try{n=require("osx-temperature-sensor")}catch(e){n=null}if(n&&(r=n.cpuTemperature(),r.main&&(r.main=Math.round(100*r.main)/100),r.max&&(r.max=Math.round(100*r.max)/100),r.cores&&r.cores.length))for(let e=0;e<r.cores.length;e++)r.cores[e]=Math.round(100*r.cores[e])/100;e&&e(r),t(r)}if(ut&&(e&&e(r),t(r)),at)try{rt.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then(((n,i)=>{if(!i){let e=0;n.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(t){let n=(parseInt(t,10)-2732)/10;isNaN(n)||(e+=n,n>r.max&&(r.max=n),r.cores.push(n))})),r.cores.length&&(r.main=e/r.cores.length)}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},Je.cpuFlags=Ot,Je.cpuCache=It,Je.currentLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{let t=Qe.loadavg().map((function(e){return e/rt.cores()})),r=parseFloat(Math.max.apply(Math,t).toFixed(2)),n={};if(Date.now()-ft.ms>=200){ft.ms=Date.now();const e=Qe.cpus().map((function(e){return e.times.steal=0,e.times.guest=0,e}));let t=0,i=0,s=0,a=0,o=0,l=0,c=0,u=[];if(mt=e&&e.length?e.length:0,it)try{const t=et("cat /proc/stat 2>/dev/null | grep cpu",{encoding:"utf8"}).toString().split("\n");if(t.length>1&&(t.shift(),t.length===e.length))for(let r=0;r<t.length;r++){let n=t[r].split(" ");if(n.length>=10){const t=parseFloat(n[8])||0,i=parseFloat(n[9])||0;e[r].times.steal=t,e[r].times.guest=i}}}catch(e){rt.noop()}for(let r=0;r<mt;r++){const n=e[r].times;t+=n.user,i+=n.sys,s+=n.nice,o+=n.idle,a+=n.irq,l+=n.steal||0,c+=n.guest||0;let p=dt&&dt[r]&&dt[r].totalTick?dt[r].totalTick:0,f=dt&&dt[r]&&dt[r].totalLoad?dt[r].totalLoad:0,d=dt&&dt[r]&&dt[r].user?dt[r].user:0,m=dt&&dt[r]&&dt[r].sys?dt[r].sys:0,h=dt&&dt[r]&&dt[r].nice?dt[r].nice:0,g=dt&&dt[r]&&dt[r].idle?dt[r].idle:0,y=dt&&dt[r]&&dt[r].irq?dt[r].irq:0,v=dt&&dt[r]&&dt[r].steal?dt[r].steal:0,S=dt&&dt[r]&&dt[r].guest?dt[r].guest:0;dt[r]=n,dt[r].totalTick=dt[r].user+dt[r].sys+dt[r].nice+dt[r].irq+dt[r].steal+dt[r].guest+dt[r].idle,dt[r].totalLoad=dt[r].user+dt[r].sys+dt[r].nice+dt[r].irq+dt[r].steal+dt[r].guest,dt[r].currentTick=dt[r].totalTick-p,dt[r].load=dt[r].totalLoad-f,dt[r].loadUser=dt[r].user-d,dt[r].loadSystem=dt[r].sys-m,dt[r].loadNice=dt[r].nice-h,dt[r].loadIdle=dt[r].idle-g,dt[r].loadIrq=dt[r].irq-y,dt[r].loadSteal=dt[r].steal-v,dt[r].loadGuest=dt[r].guest-S,u[r]={},u[r].load=dt[r].load/dt[r].currentTick*100,u[r].loadUser=dt[r].loadUser/dt[r].currentTick*100,u[r].loadSystem=dt[r].loadSystem/dt[r].currentTick*100,u[r].loadNice=dt[r].loadNice/dt[r].currentTick*100,u[r].loadIdle=dt[r].loadIdle/dt[r].currentTick*100,u[r].loadIrq=dt[r].loadIrq/dt[r].currentTick*100,u[r].loadSteal=dt[r].loadSteal/dt[r].currentTick*100,u[r].loadGuest=dt[r].loadGuest/dt[r].currentTick*100,u[r].rawLoad=dt[r].load,u[r].rawLoadUser=dt[r].loadUser,u[r].rawLoadSystem=dt[r].loadSystem,u[r].rawLoadNice=dt[r].loadNice,u[r].rawLoadIdle=dt[r].loadIdle,u[r].rawLoadIrq=dt[r].loadIrq,u[r].rawLoadSteal=dt[r].loadSteal,u[r].rawLoadGuest=dt[r].loadGuest}let p=t+i+s+a+l+c+o,f=t+i+s+a+l+c,d=p-ft.tick;n={avgLoad:r,currentLoad:(f-ft.load)/d*100,currentLoadUser:(t-ft.user)/d*100,currentLoadSystem:(i-ft.system)/d*100,currentLoadNice:(s-ft.nice)/d*100,currentLoadIdle:(o-ft.idle)/d*100,currentLoadIrq:(a-ft.irq)/d*100,currentLoadSteal:(l-ft.steal)/d*100,currentLoadGuest:(c-ft.guest)/d*100,rawCurrentLoad:f-ft.load,rawCurrentLoadUser:t-ft.user,rawCurrentLoadSystem:i-ft.system,rawCurrentLoadNice:s-ft.nice,rawCurrentLoadIdle:o-ft.idle,rawCurrentLoadIrq:a-ft.irq,rawCurrentLoadSteal:l-ft.steal,rawCurrentLoadGuest:c-ft.guest,cpus:u},ft={user:t,nice:s,system:i,idle:o,irq:a,steal:l,guest:c,tick:p,load:f,ms:ft.ms,currentLoad:n.currentLoad,currentLoadUser:n.currentLoadUser,currentLoadSystem:n.currentLoadSystem,currentLoadNice:n.currentLoadNice,currentLoadIdle:n.currentLoadIdle,currentLoadIrq:n.currentLoadIrq,currentLoadSteal:n.currentLoadSteal,currentLoadGuest:n.currentLoadGuest,rawCurrentLoad:n.rawCurrentLoad,rawCurrentLoadUser:n.rawCurrentLoadUser,rawCurrentLoadSystem:n.rawCurrentLoadSystem,rawCurrentLoadNice:n.rawCurrentLoadNice,rawCurrentLoadIdle:n.rawCurrentLoadIdle,rawCurrentLoadIrq:n.rawCurrentLoadIrq,rawCurrentLoadSteal:n.rawCurrentLoadSteal,rawCurrentLoadGuest:n.rawCurrentLoadGuest}}else{let e=[];for(let t=0;t<mt;t++)e[t]={},e[t].load=dt[t].load/dt[t].currentTick*100,e[t].loadUser=dt[t].loadUser/dt[t].currentTick*100,e[t].loadSystem=dt[t].loadSystem/dt[t].currentTick*100,e[t].loadNice=dt[t].loadNice/dt[t].currentTick*100,e[t].loadIdle=dt[t].loadIdle/dt[t].currentTick*100,e[t].loadIrq=dt[t].loadIrq/dt[t].currentTick*100,e[t].rawLoad=dt[t].load,e[t].rawLoadUser=dt[t].loadUser,e[t].rawLoadSystem=dt[t].loadSystem,e[t].rawLoadNice=dt[t].loadNice,e[t].rawLoadIdle=dt[t].loadIdle,e[t].rawLoadIrq=dt[t].loadIrq,e[t].rawLoadSteal=dt[t].loadSteal,e[t].rawLoadGuest=dt[t].loadGuest;n={avgLoad:r,currentLoad:ft.currentLoad,currentLoadUser:ft.currentLoadUser,currentLoadSystem:ft.currentLoadSystem,currentLoadNice:ft.currentLoadNice,currentLoadIdle:ft.currentLoadIdle,currentLoadIrq:ft.currentLoadIrq,currentLoadSteal:ft.currentLoadSteal,currentLoadGuest:ft.currentLoadGuest,rawCurrentLoad:ft.rawCurrentLoad,rawCurrentLoadUser:ft.rawCurrentLoadUser,rawCurrentLoadSystem:ft.rawCurrentLoadSystem,rawCurrentLoadNice:ft.rawCurrentLoadNice,rawCurrentLoadIdle:ft.rawCurrentLoadIdle,rawCurrentLoadIrq:ft.rawCurrentLoadIrq,rawCurrentLoadSteal:ft.rawCurrentLoadSteal,rawCurrentLoadGuest:ft.rawCurrentLoadGuest,cpus:e}}e(n)}))})).then((r=>{e&&e(r),t(r)}))}))}))},Je.fullLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{const t=Qe.cpus();let r=0,n=0,i=0,s=0,a=0,o=0;if(t&&t.length){for(let e=0,o=t.length;e<o;e++){const o=t[e].times;r+=o.user,n+=o.sys,i+=o.nice,s+=o.irq,a+=o.idle}let e=a+s+i+n+r;o=(e-a)/e*100}e(o)}))})).then((r=>{e&&e(r),t(r)}))}))}))};var Et={};const Lt=m.default,_t=y.default.exec,Pt=y.default.execSync,Tt=L,Vt=h.default;let At=process.platform;const Nt="linux"===At||"android"===At,Dt="darwin"===At,kt="win32"===At,Mt="freebsd"===At,Rt="openbsd"===At,Bt="netbsd"===At,Ft="sunos"===At,Gt={"0x014F":"Transcend Information","0x2C00":"Micron Technology Inc.","0x802C":"Micron Technology Inc.","0x80AD":"Hynix Semiconductor Inc.","0x80CE":"Samsung Electronics Inc.","0xAD00":"Hynix Semiconductor Inc.","0xCE00":"Samsung Electronics Inc.","0x02FE":"Elpida","0x5105":"Qimonda AG i. In.","0x8551":"Qimonda AG i. In.","0x859B":"Crucial","0x04CD":"G-Skill"},Wt={"017A":"Apacer","0198":"HyperX","029E":"Corsair","04CB":"A-DATA","04CD":"G-Skill","059B":"Crucial","00CE":"Samsung",1315:"Crutial","014F":"Transcend Information","2C00":"Micron Technology Inc.","802C":"Micron Technology Inc.","80AD":"Hynix Semiconductor Inc.","80CE":"Samsung Electronics Inc.",AD00:"Hynix Semiconductor Inc.",CE00:"Samsung Electronics Inc.","02FE":"Elpida",5105:"Qimonda AG i. In.",8551:"Qimonda AG i. In.","859B":"Crucial"};Et.mem=function(e){return new Promise((t=>{process.nextTick((()=>{let r={total:Lt.totalmem(),free:Lt.freemem(),used:Lt.totalmem()-Lt.freemem(),active:Lt.totalmem()-Lt.freemem(),available:Lt.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0,writeback:null,dirty:null};if(Nt)try{Vt.readFile("/proc/meminfo",(function(n,i){if(!n){const e=i.toString().split("\n");r.total=parseInt(Tt.getValue(e,"memtotal"),10),r.total=r.total?1024*r.total:Lt.totalmem(),r.free=parseInt(Tt.getValue(e,"memfree"),10),r.free=r.free?1024*r.free:Lt.freemem(),r.used=r.total-r.free,r.buffers=parseInt(Tt.getValue(e,"buffers"),10),r.buffers=r.buffers?1024*r.buffers:0,r.cached=parseInt(Tt.getValue(e,"cached"),10),r.cached=r.cached?1024*r.cached:0,r.slab=parseInt(Tt.getValue(e,"slab"),10),r.slab=r.slab?1024*r.slab:0,r.buffcache=r.buffers+r.cached+r.slab;let t=parseInt(Tt.getValue(e,"memavailable"),10);r.available=t?1024*t:r.free+r.buffcache,r.active=r.total-r.available,r.swaptotal=parseInt(Tt.getValue(e,"swaptotal"),10),r.swaptotal=r.swaptotal?1024*r.swaptotal:0,r.swapfree=parseInt(Tt.getValue(e,"swapfree"),10),r.swapfree=r.swapfree?1024*r.swapfree:0,r.swapused=r.swaptotal-r.swapfree,r.writeback=parseInt(Tt.getValue(e,"writeback"),10),r.writeback=r.writeback?1024*r.writeback:0,r.dirty=parseInt(Tt.getValue(e,"dirty"),10),r.dirty=r.dirty?1024*r.dirty:0}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(Mt||Rt||Bt)try{_t("/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size",(function(n,i){if(!n){let e=i.toString().split("\n");const t=parseInt(Tt.getValue(e,"vm.stats.vm.v_page_size"),10),n=parseInt(Tt.getValue(e,"vm.stats.vm.v_inactive_count"),10)*t,s=parseInt(Tt.getValue(e,"vm.stats.vm.v_cache_count"),10)*t;r.total=parseInt(Tt.getValue(e,"hw.realmem"),10),isNaN(r.total)&&(r.total=parseInt(Tt.getValue(e,"hw.physmem"),10)),r.free=parseInt(Tt.getValue(e,"vm.stats.vm.v_free_count"),10)*t,r.buffcache=n+s,r.available=r.buffcache+r.free,r.active=r.total-r.free-r.buffcache,r.swaptotal=0,r.swapfree=0,r.swapused=0}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(Ft&&(e&&e(r),t(r)),Dt){let n=4096;try{let e=Tt.toInt(Pt("sysctl -n vm.pagesize").toString());n=e||n}catch(e){Tt.noop()}try{_t('vm_stat 2>/dev/null | grep "Pages active"',(function(i,s){if(!i){let e=s.toString().split("\n");r.active=parseInt(e[0].split(":")[1],10)*n,r.buffcache=r.used-r.active,r.available=r.free+r.buffcache}_t("sysctl -n vm.swapusage 2>/dev/null",(function(n,i){if(!n){let e=i.toString().split("\n");if(e.length>0){e[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach((e=>{-1!==e.toLowerCase().indexOf("total")&&(r.swaptotal=1024*parseFloat(e.split("=")[1].trim())*1024),-1!==e.toLowerCase().indexOf("used")&&(r.swapused=1024*parseFloat(e.split("=")[1].trim())*1024),-1!==e.toLowerCase().indexOf("free")&&(r.swapfree=1024*parseFloat(e.split("=")[1].trim())*1024)}))}}e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}}if(kt){let n=0,i=0;try{Tt.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then(((s,a)=>{if(!a){s.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(e){""!==e&&(e=e.trim().split(/\s\s+/),n+=parseInt(e[0],10)||0,i+=parseInt(e[1],10)||0)}))}r.swaptotal=1024*n*1024,r.swapused=1024*i*1024,r.swapfree=r.swaptotal-r.swapused,e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}}))}))},Et.memLayout=function(e){function t(e){const t=e.replace("0x","").toUpperCase();return 4===t.length&&{}.hasOwnProperty.call(Wt,t)?Wt[t]:e}return new Promise((r=>{process.nextTick((()=>{let n=[];if((Nt||Mt||Rt||Bt)&&_t('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',(function(i,s){if(!i){let e=s.toString().split("Memory Device");e.shift(),e.forEach((function(e){let r=e.split("\n");const i=Tt.getValue(r,"Size"),s=i.indexOf("GB")>=0?1024*parseInt(i,10)*1024*1024:1024*parseInt(i,10)*1024;let a=Tt.getValue(r,"Bank Locator");if(a.toLowerCase().indexOf("bad")>=0&&(a=""),parseInt(Tt.getValue(r,"Size"),10)>0){const e=Tt.toInt(Tt.getValue(r,"Total Width")),i=Tt.toInt(Tt.getValue(r,"Data Width"));n.push({size:s,bank:a,type:Tt.getValue(r,"Type:"),ecc:!(!i||!e)&&e>i,clockSpeed:Tt.getValue(r,"Configured Clock Speed:")?parseInt(Tt.getValue(r,"Configured Clock Speed:"),10):Tt.getValue(r,"Speed:")?parseInt(Tt.getValue(r,"Speed:"),10):null,formFactor:Tt.getValue(r,"Form Factor:"),manufacturer:t(Tt.getValue(r,"Manufacturer:")),partNum:Tt.getValue(r,"Part Number:"),serialNum:Tt.getValue(r,"Serial Number:"),voltageConfigured:parseFloat(Tt.getValue(r,"Configured Voltage:"))||null,voltageMin:parseFloat(Tt.getValue(r,"Minimum Voltage:"))||null,voltageMax:parseFloat(Tt.getValue(r,"Maximum Voltage:"))||null})}else n.push({size:0,bank:a,type:"Empty",ecc:null,clockSpeed:0,formFactor:Tt.getValue(r,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!n.length){n.push({size:Lt.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let e=Pt("cat /proc/cpuinfo 2>/dev/null"),t=e.toString().split("\n"),r=Tt.getValue(t,"hardware",":",!0).toUpperCase(),i=Tt.getValue(t,"revision",":",!0).toLowerCase();if("BCM2835"===r||"BCM2708"===r||"BCM2709"===r||"BCM2835"===r||"BCM2837"===r){const r={0:400,1:450,2:450,3:3200};n[0].type="LPDDR2",n[0].type=i&&i[2]&&"3"===i[2]?"LPDDR4":n[0].type,n[0].ecc=!1,n[0].clockSpeed=i&&i[2]&&r[i[2]]||400,n[0].clockSpeed=i&&i[4]&&"d"===i[4]?500:n[0].clockSpeed,n[0].formFactor="SoC",e=Pt("vcgencmd get_config sdram_freq 2>/dev/null"),t=e.toString().split("\n");let s=parseInt(Tt.getValue(t,"sdram_freq","=",!0),10)||0;s&&(n[0].clockSpeed=s),e=Pt("vcgencmd measure_volts sdram_p 2>/dev/null"),t=e.toString().split("\n");let a=parseFloat(Tt.getValue(t,"volt","=",!0))||0;a&&(n[0].voltageConfigured=a,n[0].voltageMin=a,n[0].voltageMax=a)}}catch(e){Tt.noop()}}e&&e(n),r(n)})),Dt&&_t("system_profiler SPMemoryDataType",(function(t,i){if(!t){const e=i.toString().split("\n"),t=Tt.getValue(e,"ecc",":",!0).toLowerCase();let r=i.toString().split(" BANK "),s=!0;1===r.length&&(r=i.toString().split(" DIMM"),s=!1),r.shift(),r.forEach((function(e){let r=e.split("\n");const i=(s?"BANK ":"DIMM")+r[0].trim().split("/")[0],a=parseInt(Tt.getValue(r," Size"));var o;a?n.push({size:1024*a*1024*1024,bank:i,type:Tt.getValue(r," Type:"),ecc:t?"enabled"===t:null,clockSpeed:parseInt(Tt.getValue(r," Speed:"),10),formFactor:"",manufacturer:(o=Tt.getValue(r," Manufacturer:"),{}.hasOwnProperty.call(Gt,o)?Gt[o]:o),partNum:Tt.getValue(r," Part Number:"),serialNum:Tt.getValue(r," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):n.push({size:0,bank:i,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!n.length){const e=i.toString().split("\n"),t=parseInt(Tt.getValue(e," Memory:")),r=Tt.getValue(e," Type:");t&&r&&n.push({size:1024*t*1024*1024,bank:"0",type:r,ecc:!1,clockSpeed:0,formFactor:"",manufacturer:"Apple",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}e&&e(n),r(n)})),Ft&&(e&&e(n),r(n)),kt){const t="Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"),i="Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");try{Tt.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl").then(((s,a)=>{if(!a){let e=s.toString().split(/\n\s*\n/);e.shift(),e.forEach((function(e){let r=e.split("\r\n");const s=Tt.toInt(Tt.getValue(r,"DataWidth",":")),a=Tt.toInt(Tt.getValue(r,"TotalWidth",":")),o=parseInt(Tt.getValue(r,"Capacity",":"),10)||0;o&&n.push({size:o,bank:Tt.getValue(r,"BankLabel",":"),type:t[parseInt(Tt.getValue(r,"MemoryType",":"),10)||parseInt(Tt.getValue(r,"SMBIOSMemoryType",":"),10)],ecc:!(!s||!a)&&a>s,clockSpeed:parseInt(Tt.getValue(r,"ConfiguredClockSpeed",":"),10)||parseInt(Tt.getValue(r,"Speed",":"),10)||0,formFactor:i[parseInt(Tt.getValue(r,"FormFactor",":"),10)||0],manufacturer:Tt.getValue(r,"Manufacturer",":"),partNum:Tt.getValue(r,"PartNumber",":"),serialNum:Tt.getValue(r,"SerialNumber",":"),voltageConfigured:(parseInt(Tt.getValue(r,"ConfiguredVoltage",":"),10)||0)/1e3,voltageMin:(parseInt(Tt.getValue(r,"MinVoltage",":"),10)||0)/1e3,voltageMax:(parseInt(Tt.getValue(r,"MaxVoltage",":"),10)||0)/1e3})}))}e&&e(n),r(n)}))}catch(t){e&&e(n),r(n)}}}))}))};const Ut=y.default.exec,$t=h.default,jt=L;let Ht=process.platform;const Xt="linux"===Ht||"android"===Ht,zt="darwin"===Ht,Kt="win32"===Ht,Yt="freebsd"===Ht,qt="openbsd"===Ht,Jt="netbsd"===Ht,Qt="sunos"===Ht;function Zt(e,t,r){const n={};let i=jt.getValue(e,"BatteryStatus",":").trim();if(i>=0){const s=i?parseInt(i):0;n.status=s,n.hasBattery=!0,n.maxCapacity=r||parseInt(jt.getValue(e,"DesignCapacity",":")||0),n.designedCapacity=parseInt(jt.getValue(e,"DesignCapacity",":")||t),n.voltage=parseInt(jt.getValue(e,"DesignVoltage",":")||0)/1e3,n.capacityUnit="mWh",n.percent=parseInt(jt.getValue(e,"EstimatedChargeRemaining",":")||0),n.currentCapacity=parseInt(n.maxCapacity*n.percent/100),n.isCharging=s>=6&&s<=9||11===s||3!==s&&1!==s&&n.percent<100,n.acConnected=n.isCharging||2===s,n.model=jt.getValue(e,"DeviceID",":")}else n.status=-1;return n}var er=function(e){return new Promise((t=>{process.nextTick((()=>{let r={hasBattery:!1,cycleCount:0,isCharging:!1,designedCapacity:0,maxCapacity:0,currentCapacity:0,voltage:0,capacityUnit:"",percent:0,timeRemaining:null,acConnected:!0,type:"",model:"",manufacturer:"",serial:""};if(Xt){let n="";$t.existsSync("/sys/class/power_supply/BAT1/uevent")?n="/sys/class/power_supply/BAT1/":$t.existsSync("/sys/class/power_supply/BAT0/uevent")&&(n="/sys/class/power_supply/BAT0/");let i=!1,s="";if($t.existsSync("/sys/class/power_supply/AC/online")?s="/sys/class/power_supply/AC/online":$t.existsSync("/sys/class/power_supply/AC0/online")&&(s="/sys/class/power_supply/AC0/online"),s){const e=$t.readFileSync(s);i="1"===e.toString().trim()}n?$t.readFile(n+"uevent",(function(n,s){if(n)e&&e(r),t(r);else{let n=s.toString().split("\n");r.isCharging="charging"===jt.getValue(n,"POWER_SUPPLY_STATUS","=").toLowerCase(),r.acConnected=i||r.isCharging,r.voltage=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,r.capacityUnit=r.voltage?"mWh":"mAh",r.cycleCount=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CYCLE_COUNT","="),10),r.maxCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_FULL","=",!0,!0),10)/1e3*(r.voltage||1));const a=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_VOLTAGE_MIN_DESIGN","="),10)/1e6;r.designedCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_FULL_DESIGN","=",!0,!0),10)/1e3*(a||r.voltage||1)),r.currentCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3*(r.voltage||1)),r.maxCapacity||(r.maxCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_FULL","=",!0,!0),10)/1e3,r.designedCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_FULL_DESIGN","=",!0,!0),10)/1e3|r.maxCapacity,r.currentCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);const o=jt.getValue(n,"POWER_SUPPLY_CAPACITY","="),l=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_NOW","="),10),c=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_POWER_NOW","="),10),u=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CURRENT_NOW","="),10),p=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_NOW","="),10);r.percent=parseInt("0"+o,10),r.maxCapacity&&r.currentCapacity&&(r.hasBattery=!0,o||(r.percent=100*r.currentCapacity/r.maxCapacity)),r.isCharging&&(r.hasBattery=!0),l&&c?r.timeRemaining=Math.floor(l/c*60):u&&p?r.timeRemaining=Math.floor(p/u*60):u&&r.currentCapacity&&(r.timeRemaining=Math.floor(r.currentCapacity/u*60)),r.type=jt.getValue(n,"POWER_SUPPLY_TECHNOLOGY","="),r.model=jt.getValue(n,"POWER_SUPPLY_MODEL_NAME","="),r.manufacturer=jt.getValue(n,"POWER_SUPPLY_MANUFACTURER","="),r.serial=jt.getValue(n,"POWER_SUPPLY_SERIAL_NUMBER","="),e&&e(r),t(r)}})):(e&&e(r),t(r))}if((Yt||qt||Jt)&&Ut("sysctl -i hw.acpi.battery hw.acpi.acline",(function(n,i){let s=i.toString().split("\n");const a=parseInt("0"+jt.getValue(s,"hw.acpi.battery.units"),10),o=parseInt("0"+jt.getValue(s,"hw.acpi.battery.life"),10);r.hasBattery=a>0,r.cycleCount=null,r.isCharging="1"!==jt.getValue(s,"hw.acpi.acline"),r.acConnected=r.isCharging,r.maxCapacity=null,r.currentCapacity=null,r.capacityUnit="unknown",r.percent=a?o:null,e&&e(r),t(r)})),zt&&Ut('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %',(function(n,i){if(i){let e=i.toString().replace(/ +/g,"").replace(/"+/g,"").replace(/-/g,"").split("\n");r.cycleCount=parseInt("0"+jt.getValue(e,"cyclecount","="),10),r.voltage=parseInt("0"+jt.getValue(e,"voltage","="),10)/1e3,r.capacityUnit=r.voltage?"mWh":"mAh",r.maxCapacity=Math.round(parseInt("0"+jt.getValue(e,"applerawmaxcapacity","="),10)*(r.voltage||1)),r.currentCapacity=Math.round(parseInt("0"+jt.getValue(e,"applerawcurrentcapacity","="),10)*(r.voltage||1)),r.designedCapacity=Math.round(parseInt("0"+jt.getValue(e,"DesignCapacity","="),10)*(r.voltage||1)),r.manufacturer="Apple",r.serial=jt.getValue(e,"BatterySerialNumber","=");let t=null;let n=jt.getValue(e,"internal","Battery").split(";");if(n&&n[0]){let e=n[0].split("\t");e&&e[1]&&(t=parseFloat(e[1].trim().replace(/%/g,"")))}n&&n[1]?(r.isCharging="charging"===n[1].trim(),r.acConnected="discharging"!==n[1].trim()):(r.isCharging="yes"===jt.getValue(e,"ischarging","=").toLowerCase(),r.acConnected=r.isCharging),r.maxCapacity&&r.currentCapacity&&(r.hasBattery=!0,r.type="Li-ion",r.percent=null!==t?t:Math.round(100*r.currentCapacity/r.maxCapacity),r.isCharging||(r.timeRemaining=parseInt("0"+jt.getValue(e,"TimeRemaining","="),10)))}e&&e(r),t(r)})),Qt&&(e&&e(r),t(r)),Kt)try{const n=[];n.push(jt.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")),n.push(jt.powerShell("(Get-CimInstance -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")),n.push(jt.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")),jt.promiseAll(n).then((n=>{if(n){let e=n.results[0].split(/\n\s*\n/),t=[];const i=e=>/\S/.test(e);for(let r=0;r<e.length;r++)!i(e[r])||t.length&&i(e[r-1])||t.push([]),i(e[r])&&t[t.length-1].push(e[r]);let s=n.results[1].split("\r\n").filter((e=>e)),a=n.results[2].split("\r\n").filter((e=>e));if(t.length){let e=!1,n=[];for(let i=0;i<t.length;i++){const o=Zt(t[i][0].split("\r\n"),s&&s.length>=i+1&&s[i]?jt.toInt(s[i]):0,a&&a.length>=i+1&&a[i]?jt.toInt(a[i]):0);!e&&o.status>0&&10!==o.status?(r.hasBattery=o.hasBattery,r.maxCapacity=o.maxCapacity,r.designedCapacity=o.designedCapacity,r.voltage=o.voltage,r.capacityUnit=o.capacityUnit,r.percent=o.percent,r.currentCapacity=o.currentCapacity,r.isCharging=o.isCharging,r.acConnected=o.acConnected,r.model=o.model,e=!0):-1!==o.status&&n.push({hasBattery:o.hasBattery,maxCapacity:o.maxCapacity,designedCapacity:o.designedCapacity,voltage:o.voltage,capacityUnit:o.capacityUnit,percent:o.percent,currentCapacity:o.currentCapacity,isCharging:o.isCharging,timeRemaining:null,acConnected:o.acConnected,model:o.model,type:"",manufacturer:"",serial:""})}!e&&n.length&&(r=n[0],n.shift()),n.length&&(r.additionalBatteries=n)}}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},tr={};const rr=h.default,nr=y.default.exec,ir=y.default.execSync,sr=L;let ar=process.platform,or="";const lr="linux"===ar||"android"===ar,cr="darwin"===ar,ur="win32"===ar,pr="freebsd"===ar,fr="openbsd"===ar,dr="netbsd"===ar,mr="sunos"===ar;let hr=0,gr=0,yr=0,vr=0;const Sr={"-2":"UNINITIALIZED","-1":"OTHER",0:"HD15",1:"SVIDEO",2:"Composite video",3:"Component video",4:"DVI",5:"HDMI",6:"LVDS",8:"D_JPN",9:"SDI",10:"DP",11:"DP embedded",12:"UDI",13:"UDI embedded",14:"SDTVDONGLE",15:"MIRACAST",2147483648:"INTERNAL"};function wr(e){const t=[{pattern:"^LG.+",manufacturer:"LG"},{pattern:"^BENQ.+",manufacturer:"BenQ"},{pattern:"^ASUS.+",manufacturer:"Asus"},{pattern:"^DELL.+",manufacturer:"Dell"},{pattern:"^SAMSUNG.+",manufacturer:"Samsung"},{pattern:"^VIEWSON.+",manufacturer:"ViewSonic"},{pattern:"^SONY.+",manufacturer:"Sony"},{pattern:"^ACER.+",manufacturer:"Acer"},{pattern:"^AOC.+",manufacturer:"AOC Monitors"},{pattern:"^HP.+",manufacturer:"HP"},{pattern:"^EIZO.?",manufacturer:"Eizo"},{pattern:"^PHILIPS.?",manufacturer:"Philips"},{pattern:"^IIYAMA.?",manufacturer:"Iiyama"},{pattern:"^SHARP.?",manufacturer:"Sharp"},{pattern:"^NEC.?",manufacturer:"NEC"},{pattern:"^LENOVO.?",manufacturer:"Lenovo"},{pattern:"COMPAQ.?",manufacturer:"Compaq"},{pattern:"APPLE.?",manufacturer:"Apple"},{pattern:"INTEL.?",manufacturer:"Intel"},{pattern:"AMD.?",manufacturer:"AMD"},{pattern:"NVIDIA.?",manufacturer:"NVDIA"}];let r="";return e&&(e=e.toUpperCase(),t.forEach((t=>{RegExp(t.pattern).test(e)&&(r=t.manufacturer)}))),r}function xr(e){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[e]||""}function Cr(e){let t="";return(e=(e||"").toLowerCase()).indexOf("apple")>=0?t="0x05ac":e.indexOf("nvidia")>=0?t="0x10de":e.indexOf("intel")>=0?t="0x8086":(e.indexOf("ati")>=0||e.indexOf("amd")>=0)&&(t="0x1002"),t}tr.graphics=function(e){function t(e){const t=function(){if(or)return or;if(ur)try{const e=sr.WINDIR+"\\System32\\DriverStore\\FileRepository",t=rr.readdirSync(e).filter((t=>rr.readdirSync([e,t].join("/")).includes("nvidia-smi.exe"))).reduce(((t,r)=>{const n=rr.statSync([e,t,"nvidia-smi.exe"].join("/")),i=rr.statSync([e,r,"nvidia-smi.exe"].join("/"));return n.ctimeMs>i.ctimeMs?t:r}));t&&(or=[e,t,"nvidia-smi.exe"].join("/"))}catch(e){sr.noop()}else lr&&(or="nvidia-smi");return or}();if(e=e||sr.execOptsWin,t){const r=t+" "+"--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits"+(lr?" 2>/dev/null":"");try{return ir(r,e).toString()}catch(e){sr.noop()}}return""}function r(){function e(e){return[null,void 0].includes(e)?e:parseFloat(e)}const r=t();if(!r)return[];let n=r.split("\n").filter(Boolean).map((t=>{const r=t.split(", ").map((e=>e.includes("N/A")?void 0:e));return 16===r.length?{driverVersion:r[0],subDeviceId:r[1],name:r[2],pciBus:r[3],fanSpeed:e(r[4]),memoryTotal:e(r[5]),memoryUsed:e(r[6]),memoryFree:e(r[7]),utilizationGpu:e(r[8]),utilizationMemory:e(r[9]),temperatureGpu:e(r[10]),temperatureMemory:e(r[11]),powerDraw:e(r[12]),powerLimit:e(r[13]),clockCore:e(r[14]),clockMemory:e(r[15])}:{}}));return n=n.filter((e=>"pciBus"in e)),n}function n(e,t){return t.driverVersion&&(e.driverVersion=t.driverVersion),t.subDeviceId&&(e.subDeviceId=t.subDeviceId),t.name&&(e.name=t.name),t.pciBus&&(e.pciBus=t.pciBus),t.fanSpeed&&(e.fanSpeed=t.fanSpeed),t.memoryTotal&&(e.memoryTotal=t.memoryTotal,e.vram=t.memoryTotal,e.vramDynamic=!1),t.memoryUsed&&(e.memoryUsed=t.memoryUsed),t.memoryFree&&(e.memoryFree=t.memoryFree),t.utilizationGpu&&(e.utilizationGpu=t.utilizationGpu),t.utilizationMemory&&(e.utilizationMemory=t.utilizationMemory),t.temperatureGpu&&(e.temperatureGpu=t.temperatureGpu),t.temperatureMemory&&(e.temperatureMemory=t.temperatureMemory),t.powerDraw&&(e.powerDraw=t.powerDraw),t.powerLimit&&(e.powerLimit=t.powerLimit),t.clockCore&&(e.clockCore=t.clockCore),t.clockMemory&&(e.clockMemory=t.clockMemory),e}function i(e){let t={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},r=108;if("000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),t.resolutionX=parseInt("0x0"+e.substr(r+8,1)+e.substr(r+4,2)),t.resolutionY=parseInt("0x0"+e.substr(r+14,1)+e.substr(r+10,2)),t.sizeX=parseInt("0x0"+e.substr(r+28,1)+e.substr(r+24,2)),t.sizeY=parseInt("0x0"+e.substr(r+29,1)+e.substr(r+26,2)),r=e.indexOf("000000fc00"),r>=0){let n=e.substr(r+10,26);-1!==n.indexOf("0a")&&(n=n.substr(0,n.indexOf("0a")));try{n.length>2&&(t.model=n.match(/.{1,2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}catch(e){sr.noop()}}else t.model="";return t}return new Promise((t=>{process.nextTick((()=>{let s={controllers:[],displays:[]};if(cr){nr("system_profiler -xml -detailLevel full SPDisplaysDataType",(function(r,n){if(!r){try{const e=n.toString();s=function(e){const t={controllers:[],displays:[]};try{return e.forEach((function(e){const r=(e.sppci_bus||"").indexOf("builtin")>-1?"Built-In":(e.sppci_bus||"").indexOf("pcie")>-1?"PCIe":"",n=(parseInt(e.spdisplays_vram||"",10)||0)*((e.spdisplays_vram||"").indexOf("GB")>-1?1024:1),i=(parseInt(e.spdisplays_vram_shared||"",10)||0)*((e.spdisplays_vram_shared||"").indexOf("GB")>-1?1024:1);let s={spdisplays_mtlgpufamilymac1:"mac1",spdisplays_mtlgpufamilymac2:"mac2",spdisplays_mtlgpufamilyapple1:"apple1",spdisplays_mtlgpufamilyapple2:"apple2",spdisplays_mtlgpufamilyapple3:"apple3",spdisplays_mtlgpufamilyapple4:"apple4",spdisplays_mtlgpufamilyapple5:"apple5",spdisplays_mtlgpufamilyapple6:"apple6",spdisplays_mtlgpufamilyapple7:"apple7",spdisplays_metalfeaturesetfamily11:"family1_v1",spdisplays_metalfeaturesetfamily12:"family1_v2",spdisplays_metalfeaturesetfamily13:"family1_v3",spdisplays_metalfeaturesetfamily14:"family1_v4",spdisplays_metalfeaturesetfamily21:"family2_v1"}[e.spdisplays_metal||e.spdisplays_metalfamily||""]||"";t.controllers.push({vendor:wr(e.spdisplays_vendor||"")||e.spdisplays_vendor||"",model:e.sppci_model||"",bus:r,vramDynamic:"Built-In"===r,vram:n||i||null,deviceId:e["spdisplays_device-id"]||"",vendorId:e["spdisplays_vendor-id"]||Cr((e.spdisplays_vendor||"")+(e.sppci_model||"")),external:"spdisplays_egpu"===e.sppci_device_type,cores:e.sppci_cores||null,metalVersion:s}),e.spdisplays_ndrvs&&e.spdisplays_ndrvs.length&&e.spdisplays_ndrvs.forEach((function(e){const r=e.spdisplays_connection_type||"",n=(e._spdisplays_resolution||"").split("@"),i=n[0].split("x"),s=(e._spdisplays_pixels||"").split("x"),a=e.spdisplays_depth||"",o=e["_spdisplays_display-serial-number"]||e["_spdisplays_display-serial-number2"]||null;t.displays.push({vendor:xr(e["_spdisplays_display-vendor-id"]||"")||wr(e._name||""),vendorId:e["_spdisplays_display-vendor-id"]||"",model:e._name||"",productionYear:e["_spdisplays_display-year"]||null,serial:"0"!==o?o:null,displayId:e._spdisplays_displayID||null,main:!!e.spdisplays_main&&"spdisplays_yes"===e.spdisplays_main,builtin:(e.spdisplays_display_type||"").indexOf("built-in")>-1,connection:r.indexOf("_internal")>-1?"Internal":r.indexOf("_displayport")>-1?"Display Port":r.indexOf("_hdmi")>-1?"HDMI":null,sizeX:null,sizeY:null,pixelDepth:"CGSThirtyBitColor"===a?30:"CGSThirtytwoBitColor"===a?32:"CGSTwentyfourBitColor"===a?24:null,resolutionX:s.length>1?parseInt(s[0],10):null,resolutionY:s.length>1?parseInt(s[1],10):null,currentResX:i.length>1?parseInt(i[0],10):null,currentResY:i.length>1?parseInt(i[1],10):null,positionX:0,positionY:0,currentRefreshRate:n.length>1?parseInt(n[1],10):null})}))})),t}catch(e){return t}}(sr.plistParser(e)[0]._items)}catch(e){sr.noop()}try{const e=((n=ir('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""',{maxBuffer:2048e4}))||"").toString(),t=sr.plistReader(e);if(t.DisplayAnyUserSets&&t.DisplayAnyUserSets.Configs&&t.DisplayAnyUserSets.Configs[0]&&t.DisplayAnyUserSets.Configs[0].DisplayConfig){const e=t.DisplayAnyUserSets.Configs[0].DisplayConfig;let r=0;e.forEach((e=>{e.CurrentInfo&&void 0!==e.CurrentInfo.OriginX&&s.displays&&s.displays[r]&&(s.displays[r].positionX=e.CurrentInfo.OriginX),e.CurrentInfo&&void 0!==e.CurrentInfo.OriginY&&s.displays&&s.displays[r]&&(s.displays[r].positionY=e.CurrentInfo.OriginY),r++}))}if(t.DisplayAnyUserSets&&t.DisplayAnyUserSets.length>0&&t.DisplayAnyUserSets[0].length>0&&t.DisplayAnyUserSets[0][0].DisplayID){const e=t.DisplayAnyUserSets[0];let r=0;e.forEach((e=>{"OriginX"in e&&s.displays&&s.displays[r]&&(s.displays[r].positionX=e.OriginX),"OriginY"in e&&s.displays&&s.displays[r]&&(s.displays[r].positionY=e.OriginY),e.Mode&&void 0!==e.Mode.BitsPerPixel&&s.displays&&s.displays[r]&&(s.displays[r].pixelDepth=e.Mode.BitsPerPixel),r++}))}}catch(e){sr.noop()}}e&&e(s),t(s)}))}if(lr)if(sr.isRaspberry()&&sr.isRaspbian()){nr("fbset -s | grep 'mode \"'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;",(function(r,n){let i=n.toString().split("\n");if(i.length>3&&i[0].indexOf('mode "')>=-1&&i[2].indexOf("0x12000a")>-1){const e=i[0].replace("mode","").replace(/"/g,"").trim().split("x");2===e.length&&s.displays.push({vendor:"",model:sr.getValue(i,"device_name","="),main:!0,builtin:!1,connection:"HDMI",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:parseInt(e[0],10),resolutionY:parseInt(e[1],10),currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})}i.length>1&&n.toString().indexOf("gpu=")>=-1&&s.controllers.push({vendor:"Broadcom",model:sr.getRpiGpu(),bus:"",vram:sr.getValue(i,"gpu","=").replace("M",""),vramDynamic:!0}),e&&e(s),t(s)}))}else{nr("lspci -vvv 2>/dev/null",(function(a,o){if(!a){let e=o.toString().split("\n");s.controllers=function(e){let t=[],r={vendor:"",subVendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1,pciID:""},n=!1,i=[];try{i=ir('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split("\n");for(let e=0;e<i.length;e++)i[e]=i[e].replace("Bus Address:","").replace("0000:","").trim();i=i.filter((function(e){return null!=e&&e}))}catch(e){sr.noop()}let s=1;return e.forEach((a=>{let o="";if(s<e.length&&e[s]&&(o=e[s],o.indexOf(":")>0&&(o=o.split(":")[1])),""!==a.trim()){if(" "!==a[0]&&"\t"!==a[0]){let e=i.indexOf(a.split(" ")[0])>=0,s=a.toLowerCase().indexOf(" vga "),l=a.toLowerCase().indexOf("3d controller");if(-1!==s||-1!==l){-1!==l&&-1===s&&(s=l),(r.vendor||r.model||r.bus||null!==r.vram||r.vramDynamic)&&(t.push(r),r={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1});const c=a.split(" ")[0];/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(c)&&(r.busAddress=c),n=!0;let u=a.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),p=a.substr(s,u-s).split(":");if(r.busAddress=a.substr(0,s).trim(),p.length>1&&(p[1]=p[1].trim(),p[1].toLowerCase().indexOf("corporation")>=0?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("corporation")+11).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("corporation")+11,200).split("(")[0].trim(),r.bus=i.length>0&&e?"PCIe":"Onboard",r.vram=null,r.vramDynamic=!1):p[1].toLowerCase().indexOf(" inc.")>=0?((p[1].match(/]/g)||[]).length>1?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" inc.")+5).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf(" inc.")+5,200).trim().split("(")[0].trim()),r.bus=i.length>0&&e?"PCIe":"Onboard",r.vram=null,r.vramDynamic=!1):p[1].toLowerCase().indexOf(" ltd.")>=0&&((p[1].match(/]/g)||[]).length>1?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" ltd.")+5).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf(" ltd.")+5,200).trim().split("(")[0].trim())),r.model&&-1!==o.indexOf(r.model))){const e=o.split(r.model)[0].trim();e&&(r.subVendor=e)}}else n=!1}if(n){let e=a.split(":");if(e.length>1&&-1!==e[0].replace(/ +/g,"").toLowerCase().indexOf("devicename")&&-1!==e[1].toLowerCase().indexOf("onboard")&&(r.bus="Onboard"),e.length>1&&-1!==e[0].replace(/ +/g,"").toLowerCase().indexOf("region")&&-1!==e[1].toLowerCase().indexOf("memory")){let t=e[1].split("=");t.length>1&&(r.vram=parseInt(t[1]))}}}s++})),(r.vendor||r.model||r.bus||r.busAddress||null!==r.vram||r.vramDynamic)&&t.push(r),t}(e);const t=r();s.controllers=s.controllers.map((e=>n(e,t.find((t=>t.pciBus.toLowerCase().endsWith(e.busAddress.toLowerCase())))||{})))}nr("clinfo --raw",(function(r,n){if(!r){let e=n.toString().split("\n");s.controllers=function(e,t){const r=/\[([^\]]+)\]\s+(\w+)\s+(.*)/,n=t.reduce(((e,t)=>{const n=r.exec(t.trim());return n&&(e[n[1]]||(e[n[1]]={}),e[n[1]][n[2]]=n[3]),e}),{});for(let t in n){const r=n[t];if("CL_DEVICE_TYPE_GPU"===r.CL_DEVICE_TYPE){let t;if(r.CL_DEVICE_TOPOLOGY_AMD){const e=r.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);e&&(t=e[0])}else if(r.CL_DEVICE_PCI_BUS_ID_NV&&r.CL_DEVICE_PCI_SLOT_ID_NV){const e=parseInt(r.CL_DEVICE_PCI_BUS_ID_NV),n=parseInt(r.CL_DEVICE_PCI_SLOT_ID_NV);if(!isNaN(e)&&!isNaN(n)){const r=n>>3&255,i=7&n;t=`${(255&e).toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}.${i}`}}if(t){let n=e.find((e=>e.busAddress===t));n||(n={vendor:"",model:"",bus:"",busAddress:t,vram:null,vramDynamic:!1},e.push(n)),n.vendor=r.CL_DEVICE_VENDOR,r.CL_DEVICE_BOARD_NAME_AMD?n.model=r.CL_DEVICE_BOARD_NAME_AMD:n.model=r.CL_DEVICE_NAME;const i=parseInt(r.CL_DEVICE_GLOBAL_MEM_SIZE);isNaN(i)||(n.vram=Math.round(i/1024/1024))}}}return e}(s.controllers,e)}nr("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'",(function(r,n){let a=0;if(!r){let e=n.toString().split("\n");a=parseInt(e[0])||0}nr("xrandr --verbose 2>/dev/null",(function(r,n){if(!r){let e=n.toString().split("\n");s.displays=function(e,t){let r=[],n={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},s=!1,a=!1,o="",l=0;for(let c=1;c<e.length;c++)if(""!==e[c].trim()){if(" "!==e[c][0]&&"\t"!==e[c][0]&&-1!==e[c].toLowerCase().indexOf(" connected ")){(n.model||n.main||n.builtin||n.connection||null!==n.sizeX||null!==n.pixelDepth||null!==n.resolutionX)&&(r.push(n),n={vendor:"",model:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null});let t=e[c].split(" ");n.connection=t[0],n.main=e[c].toLowerCase().indexOf(" primary ")>=0,n.builtin=t[0].toLowerCase().indexOf("edp")>=0}if(s)if(e[c].search(/\S|$/)>l)o+=e[c].toLowerCase().trim();else{let e=i(o);n.vendor=e.vendor,n.model=e.model,n.resolutionX=e.resolutionX,n.resolutionY=e.resolutionY,n.sizeX=e.sizeX,n.sizeY=e.sizeY,n.pixelDepth=t,s=!1}if(e[c].toLowerCase().indexOf("edid:")>=0&&(s=!0,l=e[c].search(/\S|$/)),e[c].toLowerCase().indexOf("*current")>=0){const t=e[c].split("(");if(t&&t.length>1&&t[0].indexOf("x")>=0){const e=t[0].trim().split("x");n.currentResX=sr.toInt(e[0]),n.currentResY=sr.toInt(e[1])}a=!0}if(a&&e[c].toLowerCase().indexOf("clock")>=0&&e[c].toLowerCase().indexOf("hz")>=0&&e[c].toLowerCase().indexOf("v: height")>=0){const t=e[c].split("clock");t&&t.length>1&&t[1].toLowerCase().indexOf("hz")>=0&&(n.currentRefreshRate=sr.toInt(t[1])),a=!1}}return(n.model||n.main||n.builtin||n.connection||null!==n.sizeX||null!==n.pixelDepth||null!==n.resolutionX)&&r.push(n),r}(e,a)}e&&e(s),t(s)}))}))}))}))}if((pr||fr||dr)&&(e&&e(null),t(null)),mr&&(e&&e(null),t(null)),ur)try{const i=[];i.push(sr.powerShell("Get-CimInstance win32_VideoController | fl *")),i.push(sr.powerShell('gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl')),i.push(sr.powerShell("Get-CimInstance win32_desktopmonitor | fl *")),i.push(sr.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")),i.push(sr.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")),i.push(sr.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")),i.push(sr.powerShell('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}'));const a=r();Promise.all(i).then((r=>{let i=r[0].replace(/\r/g,"").split(/\n\s*\n/),o=r[1].replace(/\r/g,"").split(/\n\s*\n/);s.controllers=function(e,t){const r={};for(const e in t)if({}.hasOwnProperty.call(t,e)&&""!==t[e].trim()){const n=t[e].trim().split("\n"),i=sr.getValue(n,"MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);if(i){const e=parseInt(sr.getValue(n,"HardwareInformation.qwMemorySize"));if(!isNaN(e)){let t=i[1].toUpperCase()+"&"+i[2].toUpperCase();i[3]&&(t+="&"+i[3].toUpperCase()),i[4]&&(t+="&"+i[4].toUpperCase()),r[t]=e}}}let n=[];for(let t in e)if({}.hasOwnProperty.call(e,t)&&""!==e[t].trim()){let i=e[t].trim().split("\n"),s=sr.getValue(i,"PNPDeviceID",":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i),a=null,o=null;if(s){if(a=s[3]||"",a&&(a=a.split("_")[1]),null==o&&s[3]&&s[4]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[3].toUpperCase()+"&"+s[4].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o&&s[3]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[3].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o&&s[4]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[4].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}}n.push({vendor:sr.getValue(i,"AdapterCompatibility",":"),model:sr.getValue(i,"name",":"),bus:sr.getValue(i,"PNPDeviceID",":").startsWith("PCI")?"PCI":"",vram:(null==o?sr.toInt(sr.getValue(i,"AdapterRAM",":")):o)/1024/1024,vramDynamic:"2"===sr.getValue(i,"VideoMemoryType",":"),subDeviceId:a}),hr=sr.toInt(sr.getValue(i,"CurrentHorizontalResolution",":"))||hr,gr=sr.toInt(sr.getValue(i,"CurrentVerticalResolution",":"))||gr,vr=sr.toInt(sr.getValue(i,"CurrentRefreshRate",":"))||vr,yr=sr.toInt(sr.getValue(i,"CurrentBitsPerPixel",":"))||yr}return n}(i,o),s.controllers=s.controllers.map((e=>"nvidia"===e.vendor.toLowerCase()?n(e,a.find((t=>{let r=(e.subDeviceId||"").toLowerCase();const n=t.subDeviceId.split("x");let i=n.length>1?n[1].toLowerCase():n[0].toLowerCase();const s=Math.abs(r.length-i.length);if(r.length>i.length)for(let e=0;e<s;e++)i="0"+i;else if(r.length<i.length)for(let e=0;e<s;e++)r="0"+r;return r===i}))||{}):e));let l=r[2].replace(/\r/g,"").split(/\n\s*\n/);""===l[0].trim()&&l.shift(),l.length&&""===l[l.length-1].trim()&&l.pop();let c=r[3].replace(/\r/g,"").split("Active ");c.shift();let u=r[4].replace(/\r/g,"").split("BitsPerPixel ");u.shift();let p=r[5].replace(/\r/g,"").split(/\n\s*\n/);p.shift();const f=r[6].replace(/\r/g,"").split(/\n/);let d=[];f.forEach((e=>{const t=e.split("|");5===t.length&&d.push({vendor:t[0],code:t[1],model:t[2],serial:t[3],instanceId:t[4]})})),s.displays=function(e,t,r,n,i){let s=[],a="",o="",l="",c=0,u=0;if(r&&r.length){let e=r[0].split("\n");a=sr.getValue(e,"MonitorManufacturer",":"),o=sr.getValue(e,"Name",":"),l=sr.getValue(e,"PNPDeviceID",":").replace(/&amp;/g,"&").toLowerCase(),c=sr.toInt(sr.getValue(e,"ScreenWidth",":")),u=sr.toInt(sr.getValue(e,"ScreenHeight",":"))}for(let r=0;r<e.length;r++)if(""!==e[r].trim()){e[r]="BitsPerPixel "+e[r],t[r]="Active "+t[r],0!==n.length&&void 0!==n[r]||(n[r]="Unknown");let c=e[r].split("\n"),u=t[r].split("\n"),p=n[r].split("\n");const f=sr.getValue(c,"BitsPerPixel"),d=sr.getValue(c,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),m=sr.getValue(c,"Primary"),h=sr.getValue(u,"MaxHorizontalImageSize"),g=sr.getValue(u,"MaxVerticalImageSize"),y=sr.getValue(u,"InstanceName").toLowerCase(),v=sr.getValue(p,"VideoOutputTechnology"),S=sr.getValue(c,"DeviceName");let w="",x="";i.forEach((e=>{e.instanceId.toLowerCase().startsWith(y)&&a.startsWith("(")&&o.startsWith("PnP")&&(w=e.vendor,x=e.model)})),s.push({vendor:y.startsWith(l)&&""===w?a:w,model:y.startsWith(l)&&""===x?o:x,deviceName:S,main:"true"===m.toLowerCase(),builtin:"2147483648"===v,connection:v&&Sr[v]?Sr[v]:"",resolutionX:sr.toInt(sr.getValue(d,"Width",":")),resolutionY:sr.toInt(sr.getValue(d,"Height",":")),sizeX:h?parseInt(h,10):null,sizeY:g?parseInt(g,10):null,pixelDepth:f,currentResX:sr.toInt(sr.getValue(d,"Width",":")),currentResY:sr.toInt(sr.getValue(d,"Height",":")),positionX:sr.toInt(sr.getValue(d,"X",":")),positionY:sr.toInt(sr.getValue(d,"Y",":"))})}0===e.length&&s.push({vendor:a,model:o,main:!0,sizeX:null,sizeY:null,resolutionX:c,resolutionY:u,pixelDepth:null,currentResX:c,currentResY:u,positionX:0,positionY:0});return s}(u,c,l,p,d),1===s.displays.length&&(hr&&(s.displays[0].resolutionX=hr,s.displays[0].currentResX||(s.displays[0].currentResX=hr)),gr&&(s.displays[0].resolutionY=gr,0===s.displays[0].currentResY&&(s.displays[0].currentResY=gr)),yr&&(s.displays[0].pixelDepth=yr)),s.displays=s.displays.map((e=>(vr&&!e.currentRefreshRate&&(e.currentRefreshRate=vr),e))),e&&e(s),t(s)})).catch((()=>{e&&e(s),t(s)}))}catch(r){e&&e(s),t(s)}}))}))};var Or={};const Ir=L,br=h.default,Er=y.default.exec,Lr=y.default.execSync,_r=Ir.promisifySave(y.default.exec);let Pr=process.platform;const Tr="linux"===Pr||"android"===Pr,Vr="darwin"===Pr,Ar="win32"===Pr,Nr="freebsd"===Pr,Dr="openbsd"===Pr,kr="netbsd"===Pr,Mr="sunos"===Pr;let Rr={},Br={};function Fr(e){let t=[],r=0;return e.forEach((e=>{if(e.length>0)if("*"===e[0])r++;else{let n=e.split(":");n.length>1&&(t[r]||(t[r]={name:"",identifier:"",type:"disk",fsType:"",mount:"",size:0,physical:"HDD",uuid:"",label:"",model:"",serial:"",removable:!1,protocol:"",group:"",device:""}),n[0]=n[0].trim().toUpperCase().replace(/ +/g,""),n[1]=n[1].trim(),"DEVICEIDENTIFIER"===n[0]&&(t[r].identifier=n[1]),"DEVICENODE"===n[0]&&(t[r].name=n[1]),"VOLUMENAME"===n[0]&&-1===n[1].indexOf("Not applicable")&&(t[r].label=n[1]),"PROTOCOL"===n[0]&&(t[r].protocol=n[1]),"DISKSIZE"===n[0]&&(t[r].size=function(e){return parseInt(e.substr(e.indexOf(" (")+2,e.indexOf(" Bytes)")-10))}(n[1])),"FILESYSTEMPERSONALITY"===n[0]&&(t[r].fsType=n[1]),"MOUNTPOINT"===n[0]&&(t[r].mount=n[1]),"VOLUMEUUID"===n[0]&&(t[r].uuid=n[1]),"READ-ONLYMEDIA"===n[0]&&"Yes"===n[1]&&(t[r].physical="CD/DVD"),"SOLIDSTATE"===n[0]&&"Yes"===n[1]&&(t[r].physical="SSD"),"VIRTUAL"===n[0]&&(t[r].type="virtual"),"REMOVABLEMEDIA"===n[0]&&(t[r].removable="Removable"===n[1]),"PARTITIONTYPE"===n[0]&&(t[r].type="part"),"DEVICE/MEDIANAME"===n[0]&&(t[r].model=n[1]))}})),t}function Gr(e){let t=[];return e.filter((e=>""!==e)).forEach((e=>{try{e=(e=decodeURIComponent(e.replace(/\\x/g,"%"))).replace(/\\/g,"\\\\");let r=JSON.parse(e);t.push({name:r.name,type:r.type,fsType:r.fsType,mount:r.mountpoint,size:parseInt(r.size),physical:"disk"===r.type?"0"===r.rota?"SSD":"HDD":"rom"===r.type?"CD/DVD":"",uuid:r.uuid,label:r.label,model:(r.model||"").trim(),serial:r.serial,removable:"1"===r.rm,protocol:r.tran,group:r.group||""})}catch(e){Ir.noop()}})),t=Ir.unique(t),t=Ir.sortByKey(t,["type","name"]),t}function Wr(e){let t=e;try{e.forEach((e=>{if(e.type.startsWith("raid")){const r=function(e){const t=Ir.getValue(e,"md_level","="),r=Ir.getValue(e,"md_name","="),n=Ir.getValue(e,"md_uuid","="),i=[];return e.forEach((e=>{e.toLowerCase().startsWith("md_device_dev")&&e.toLowerCase().indexOf("/dev/")>0&&i.push(e.split("/dev/")[1])})),{raid:t,label:r,uuid:n,members:i}}(Lr(`mdadm --export --detail /dev/${e.name}`).toString().split("\n"));e.label=r.label,e.uuid=r.uuid,r.members&&r.members.length&&r.raid===e.type&&(t=t.map((t=>("linux_raid_member"===t.fsType&&r.members.indexOf(t.name)>=0&&(t.group=e.name),t))))}}))}catch(e){Ir.noop()}return t}function Ur(e,t){const r=function(e){const t=[];return e.forEach((e=>{const r=e.split("\r\n"),n=Ir.getValue(r,"DeviceID",":");let i=e.split("@{DeviceID=");i.length>1&&(i=i.slice(1),i.forEach((e=>{t.push({name:e.split(";")[0].toUpperCase(),device:n})})))})),t}(t);return e.map((e=>{const t=r.filter((t=>t.name===e.name.toUpperCase()));return t.length>0&&(e.device=t[0].device),e})),e}function $r(e){return e.toString().replace(/NAME=/g,'{"name":').replace(/FSTYPE=/g,',"fsType":').replace(/TYPE=/g,',"type":').replace(/SIZE=/g,',"size":').replace(/MOUNTPOINT=/g,',"mountpoint":').replace(/UUID=/g,',"uuid":').replace(/ROTA=/g,',"rota":').replace(/RO=/g,',"ro":').replace(/RM=/g,',"rm":').replace(/TRAN=/g,',"tran":').replace(/SERIAL=/g,',"serial":').replace(/LABEL=/g,',"label":').replace(/MODEL=/g,',"model":').replace(/OWNER=/g,',"owner":').replace(/GROUP=/g,',"group":').replace(/\n/g,"}\n")}function jr(e,t){let r={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return Rr&&Rr.ms?(r.rx=e,r.wx=t,r.tx=r.rx+r.wx,r.ms=Date.now()-Rr.ms,r.rx_sec=(r.rx-Rr.bytes_read)/(r.ms/1e3),r.wx_sec=(r.wx-Rr.bytes_write)/(r.ms/1e3),r.tx_sec=r.rx_sec+r.wx_sec,Rr.rx_sec=r.rx_sec,Rr.wx_sec=r.wx_sec,Rr.tx_sec=r.tx_sec,Rr.bytes_read=r.rx,Rr.bytes_write=r.wx,Rr.bytes_overall=r.rx+r.wx,Rr.ms=Date.now(),Rr.last_ms=r.ms):(r.rx=e,r.wx=t,r.tx=r.rx+r.wx,Rr.rx_sec=null,Rr.wx_sec=null,Rr.tx_sec=null,Rr.bytes_read=r.rx,Rr.bytes_write=r.wx,Rr.bytes_overall=r.rx+r.wx,Rr.ms=Date.now(),Rr.last_ms=0),r}function Hr(e,t,r,n,i){let s={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0};return Br&&Br.ms?(s.rIO=e,s.wIO=t,s.tIO=e+t,s.ms=Date.now()-Br.ms,s.rIO_sec=(s.rIO-Br.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-Br.wIO)/(s.ms/1e3),s.tIO_sec=s.rIO_sec+s.wIO_sec,s.rWaitTime=r,s.wWaitTime=n,s.tWaitTime=i,s.rWaitPercent=100*(s.rWaitTime-Br.rWaitTime)/s.ms,s.wWaitPercent=100*(s.wWaitTime-Br.wWaitTime)/s.ms,s.tWaitPercent=100*(s.tWaitTime-Br.tWaitTime)/s.ms,Br.rIO=e,Br.wIO=t,Br.rIO_sec=s.rIO_sec,Br.wIO_sec=s.wIO_sec,Br.tIO_sec=s.tIO_sec,Br.rWaitTime=r,Br.wWaitTime=n,Br.tWaitTime=i,Br.rWaitPercent=s.rWaitPercent,Br.wWaitPercent=s.wWaitPercent,Br.tWaitPercent=s.tWaitPercent,Br.last_ms=s.ms,Br.ms=Date.now()):(s.rIO=e,s.wIO=t,s.tIO=e+t,s.rWaitTime=r,s.wWaitTime=n,s.tWaitTime=i,Br.rIO=e,Br.wIO=t,Br.rIO_sec=null,Br.wIO_sec=null,Br.tIO_sec=null,Br.rWaitTime=r,Br.wWaitTime=n,Br.tWaitTime=i,Br.rWaitPercent=null,Br.wWaitPercent=null,Br.tWaitPercent=null,Br.last_ms=0,Br.ms=Date.now()),s}Or.fsSize=function(e,t){Ir.isFunction(e)&&(t=e,e="");let r=[],n=[];function i(e){let t=e.toString().split("\n");if(t.shift(),e.toString().toLowerCase().indexOf("filesystem")){let e=0;for(let r=0;r<t.length;r++)t[r]&&t[r].toLowerCase().startsWith("filesystem")&&(e=r);for(let r=0;r<e;r++)t.shift()}return t}function s(e){let t=[];return e.forEach((function(e){if(""!==e&&(e=e.replace(/ +/g," ").split(" "))&&(e[0].startsWith("/")||e[6]&&"/"===e[6]||e[0].indexOf("/")>0||1===e[0].indexOf(":")||!Vr&&!function(e){let t=!1;return["rootfs","unionfs","squashfs","cramfs","initrd","initramfs","devtmpfs","tmpfs","udev","devfs","specfs","type","appimaged"].forEach((r=>{e.toLowerCase().indexOf(r)>=0&&(t=!0)})),t}(e[1]))){const i=e[0],s=Tr||Nr||Dr||kr?e[1]:function(e){if(!e.startsWith("/"))return"NFS";const t=e.split("/"),n=t[t.length-1],i=r.filter((e=>e.indexOf(n)>=0));return 1===i.length&&i[0].indexOf("APFS")>=0?"APFS":"HFS"}(e[0]),a=1024*parseInt(Tr||Nr||Dr||kr?e[2]:e[1]),o=1024*parseInt(Tr||Nr||Dr||kr?e[3]:e[2]),l=1024*parseInt(Tr||Nr||Dr||kr?e[4]:e[3]),c=parseFloat((o/(o+l)*100).toFixed(2));let u=n&&Object.keys(n).length>0?n[i]||!1:null;e.splice(0,Tr||Nr||Dr||kr?6:5);const p=e.join(" ");t.find((e=>e.fs===i&&e.type===s))||t.push({fs:i,type:s,size:a,used:o,available:l,use:c,mount:p,rw:u})}})),t}return new Promise((a=>{process.nextTick((()=>{let o=[];if(Tr||Nr||Dr||kr||Vr){let l="";if(r=[],n={},Vr){l="df -kP";try{r=Lr("diskutil list").toString().split("\n").filter((e=>!e.startsWith("/")&&e.indexOf(":")>0)),Lr("mount").toString().split("\n").filter((e=>e.startsWith("/"))).forEach((e=>{n[e.split(" ")[0]]=-1===e.toLowerCase().indexOf("read-only")}))}catch(e){Ir.noop()}}if(Tr)try{l="export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL",Lr("cat /proc/mounts 2>/dev/null").toString().split("\n").filter((e=>e.startsWith("/"))).forEach((e=>{n[e.split(" ")[0]]=n[e.split(" ")[0]]||!1,-1===e.toLowerCase().indexOf("/snap/")&&(n[e.split(" ")[0]]=e.toLowerCase().indexOf("rw,")>=0||e.toLowerCase().indexOf(" rw ")>=0)}))}catch(e){Ir.noop()}if(Nr||Dr||kr)try{l="df -lkPT",Lr("mount").toString().split("\n").forEach((e=>{n[e.split(" ")[0]]=-1===e.toLowerCase().indexOf("read-only")}))}catch(e){Ir.noop()}Er(l,{maxBuffer:1048576},(function(r,n){let l=i(n);o=s(l),e&&(o=o.filter((t=>t.fs.toLowerCase().indexOf(e.toLowerCase())>=0||t.mount.toLowerCase().indexOf(e.toLowerCase())>=0))),r&&!o.length||""===n.toString().trim()?Er("df -kPT",{maxBuffer:1048576},(function(e,r){if(!e){let e=i(r);o=s(e)}t&&t(o),a(o)})):(t&&t(o),a(o))}))}if(Mr&&(t&&t(o),a(o)),Ar)try{const r=`Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${e?"| where -property Caption -eq "+e:""} | fl`;Ir.powerShell(r).then(((e,r)=>{if(!r){e.toString().split(/\n\s*\n/).forEach((function(e){let t=e.split("\r\n");const r=Ir.toInt(Ir.getValue(t,"size",":")),n=Ir.toInt(Ir.getValue(t,"freespace",":")),i=Ir.getValue(t,"caption",":"),s=Ir.getValue(t,"access",":"),a=s?1!==Ir.toInt(s):null;r&&o.push({fs:i,type:Ir.getValue(t,"filesystem",":"),size:r,used:r-n,available:n,use:parseFloat((100*(r-n)/r).toFixed(2)),mount:i,rw:a})}))}t&&t(o),a(o)}))}catch(e){t&&t(o),a(o)}}))}))},Or.fsOpenFiles=function(e){return new Promise((t=>{process.nextTick((()=>{const r={max:null,allocated:null,available:null};if(Nr||Dr||kr||Vr){Er("sysctl -i kern.maxfiles kern.num_files kern.open_files",{maxBuffer:1048576},(function(n,i){if(!n){let e=i.toString().split("\n");r.max=parseInt(Ir.getValue(e,"kern.maxfiles",":"),10),r.allocated=parseInt(Ir.getValue(e,"kern.num_files",":"),10)||parseInt(Ir.getValue(e,"kern.open_files",":"),10),r.available=r.max-r.allocated}e&&e(r),t(r)}))}Tr&&br.readFile("/proc/sys/fs/file-nr",(function(n,i){if(n)br.readFile("/proc/sys/fs/file-max",(function(n,i){if(!n){let e=i.toString().split("\n");e[0]&&(r.max=parseInt(e[0],10))}e&&e(r),t(r)}));else{let n=i.toString().split("\n");if(n[0]){const e=n[0].replace(/\s+/g," ").split(" ");3===e.length&&(r.allocated=parseInt(e[0],10),r.available=parseInt(e[1],10),r.max=parseInt(e[2],10),r.available||(r.available=r.max-r.allocated))}e&&e(r),t(r)}})),Mr&&(e&&e(null),t(null)),Ar&&(e&&e(null),t(null))}))}))},Or.blockDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Tr&&Er("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1048576},(function(n,i){if(n)Er("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1048576},(function(n,i){if(!n){let e=$r(i).split("\n");r=Gr(e),r=Wr(r)}e&&e(r),t(r)}));else{let n=$r(i).split("\n");r=Gr(n),r=Wr(r),r=function(e){let t=e;try{const r=function(e){const t=[];return e.forEach((e=>{e.type.startsWith("disk")&&t.push(e.name)})),t}(e);t=t.map((e=>((e.type.startsWith("part")||e.type.startsWith("disk"))&&r.forEach((t=>{e.name.startsWith(t)&&(e.device="/dev/"+t)})),e)))}catch(e){Ir.noop()}return t}(r),e&&e(r),t(r)}})),Vr&&Er("diskutil info -all",{maxBuffer:1048576},(function(n,i){if(!n){let e=i.toString().split("\n");r=Fr(e),r=function(e){let t=e;try{const r=function(e){const t=[];return e.forEach((e=>{if(e.type.startsWith("disk")&&t.push({name:e.name,model:e.model,device:e.name}),e.type.startsWith("virtual")){let r="";t.forEach((t=>{t.model===e.model&&(r=t.device)})),r&&t.push({name:e.name,model:e.model,device:r})}})),t}(e);t=t.map((e=>((e.type.startsWith("part")||e.type.startsWith("disk")||e.type.startsWith("virtual"))&&r.forEach((t=>{e.name.startsWith(t.name)&&(e.device=t.device)})),e)))}catch(e){Ir.noop()}return t}(r)}e&&e(r),t(r)})),Mr&&(e&&e(r),t(r)),Ar){let n=["Unknown","NoRoot","Removable","Local","Network","CD/DVD","RAM"];try{const i=[];i.push(Ir.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")),i.push(Ir.powerShell("Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl")),Ir.promiseAll(i).then((i=>{let s=i.results[0].toString().split(/\n\s*\n/),a=i.results[1].toString().split(/\n\s*\n/);s.forEach((function(e){let t=e.split("\r\n"),i=Ir.getValue(t,"drivetype",":");i&&r.push({name:Ir.getValue(t,"name",":"),identifier:Ir.getValue(t,"caption",":"),type:"disk",fsType:Ir.getValue(t,"filesystem",":").toLowerCase(),mount:Ir.getValue(t,"caption",":"),size:Ir.getValue(t,"size",":"),physical:i>=0&&i<=6?n[i]:n[0],uuid:Ir.getValue(t,"volumeserialnumber",":"),label:Ir.getValue(t,"volumename",":"),model:"",serial:Ir.getValue(t,"volumeserialnumber",":"),removable:"2"===i,protocol:"",group:"",device:""})})),r=Ur(r,a),e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}(Nr||Dr||kr)&&(e&&e(null),t(null))}))}))},Or.fsStats=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ar||Nr||Dr||kr||Mr)return t(null);let r={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0},n=0,i=0;Rr&&!Rr.ms||Rr&&Rr.ms&&Date.now()-Rr.ms>=500?(Tr&&Er("lsblk -r 2>/dev/null | grep /",{maxBuffer:1048576},(function(s,a){if(s)e&&e(r),t(r);else{let s=a.toString().split("\n"),o=[];s.forEach((function(e){""!==e&&(e=e.trim().split(" "),-1===o.indexOf(e[0])&&o.push(e[0]))}));let l=o.join("|");Er('cat /proc/diskstats | egrep "'+l+'"',{maxBuffer:1048576},(function(s,a){if(!s){a.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.replace(/ +/g," ").split(" "),n+=512*parseInt(e[5]),i+=512*parseInt(e[9]))})),r=jr(n,i)}e&&e(r),t(r)}))}})),Vr&&Er('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',{maxBuffer:1048576},(function(s,a){if(!s){a.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),n+=parseInt(e[2]),i+=parseInt(e[9]))})),r=jr(n,i)}e&&e(r),t(r)}))):(r.ms=Rr.last_ms,r.rx=Rr.bytes_read,r.wx=Rr.bytes_write,r.tx=Rr.bytes_read+Rr.bytes_write,r.rx_sec=Rr.rx_sec,r.wx_sec=Rr.wx_sec,r.tx_sec=Rr.tx_sec,e&&e(r),t(r))}))}))},Or.disksIO=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ar)return t(null);if(Mr)return t(null);let r={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0},n=0,i=0,s=0,a=0,o=0;if(Br&&!Br.ms||Br&&Br.ms&&Date.now()-Br.ms>=500){if(Tr||Nr||Dr||kr){Er('for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done',{maxBuffer:1048576},(function(l,c){if(l)e&&e(r),t(r);else{c.split("\n").forEach((function(e){if(!e)return;let t=e.split(";");n+=parseInt(t[0]),i+=parseInt(t[4]),s+=parseInt(t[3]),a+=parseInt(t[7]),o+=parseInt(t[10])})),r=Hr(n,i,s,a,o),e&&e(r),t(r)}}))}Vr&&Er('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',{maxBuffer:1048576},(function(l,c){if(!l){c.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),n+=parseInt(e[10]),i+=parseInt(e[0]))})),r=Hr(n,i,s,a,o)}e&&e(r),t(r)}))}else r.rIO=Br.rIO,r.wIO=Br.wIO,r.tIO=Br.rIO+Br.wIO,r.ms=Br.last_ms,r.rIO_sec=Br.rIO_sec,r.wIO_sec=Br.wIO_sec,r.tIO_sec=Br.tIO_sec,r.rWaitTime=Br.rWaitTime,r.wWaitTime=Br.wWaitTime,r.tWaitTime=Br.tWaitTime,r.rWaitPercent=Br.rWaitPercent,r.wWaitPercent=Br.wWaitPercent,r.tWaitPercent=Br.tWaitPercent,e&&e(r),t(r)}))}))},Or.diskLayout=function(e){function t(e){const t=[{pattern:"WESTERN.*",manufacturer:"Western Digital"},{pattern:"^WDC.*",manufacturer:"Western Digital"},{pattern:"WD.*",manufacturer:"Western Digital"},{pattern:"TOSHIBA.*",manufacturer:"Toshiba"},{pattern:"HITACHI.*",manufacturer:"Hitachi"},{pattern:"^IC.*",manufacturer:"Hitachi"},{pattern:"^HTS.*",manufacturer:"Hitachi"},{pattern:"SANDISK.*",manufacturer:"SanDisk"},{pattern:"KINGSTON.*",manufacturer:"Kingston Technology"},{pattern:"^SONY.*",manufacturer:"Sony"},{pattern:"TRANSCEND.*",manufacturer:"Transcend"},{pattern:"SAMSUNG.*",manufacturer:"Samsung"},{pattern:"^ST(?!I\\ ).*",manufacturer:"Seagate"},{pattern:"^STI\\ .*",manufacturer:"SimpleTech"},{pattern:"^D...-.*",manufacturer:"IBM"},{pattern:"^IBM.*",manufacturer:"IBM"},{pattern:"^FUJITSU.*",manufacturer:"Fujitsu"},{pattern:"^MP.*",manufacturer:"Fujitsu"},{pattern:"^MK.*",manufacturer:"Toshiba"},{pattern:"MAXTO.*",manufacturer:"Maxtor"},{pattern:"PIONEER.*",manufacturer:"Pioneer"},{pattern:"PHILIPS.*",manufacturer:"Philips"},{pattern:"QUANTUM.*",manufacturer:"Quantum Technology"},{pattern:"FIREBALL.*",manufacturer:"Quantum Technology"},{pattern:"^VBOX.*",manufacturer:"VirtualBox"},{pattern:"CORSAIR.*",manufacturer:"Corsair Components"},{pattern:"CRUCIAL.*",manufacturer:"Crucial"},{pattern:"ECM.*",manufacturer:"ECM"},{pattern:"INTEL.*",manufacturer:"INTEL"},{pattern:"EVO.*",manufacturer:"Samsung"},{pattern:"APPLE.*",manufacturer:"Apple"}];let r="";return e&&(e=e.toUpperCase(),t.forEach((t=>{RegExp(t.pattern).test(e)&&(r=t.manufacturer)}))),r}return new Promise((r=>{process.nextTick((()=>{const n=t=>{for(let e=0;e<t.length;e++)delete t[e].BSDName;e&&e(t),r(t)};let i=[],s="";if(Tr){let e="";Er("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL",{maxBuffer:1048576},(function(r,a){if(!r)try{const r=a.toString().trim();let n=[];try{const e=JSON.parse(r);e&&{}.hasOwnProperty.call(e,"blockdevices")&&(n=e.blockdevices.filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model||null===e.mountpoint&&null===e.label&&null===e.fstype&&null===e.parttype&&e.path&&0!==e.path.indexOf("/ram")&&0!==e.path.indexOf("/loop")&&e["disc-max"]&&0!==e["disc-max"]))))}catch(e){try{let e=$r(Lr("export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL").toString()).split("\n");n=Gr(e).filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model&&""!==e.model||""===e.mount&&""===e.label&&""===e.fsType)))}catch(e){Ir.noop()}}n.forEach((r=>{let n="";const a="/dev/"+r.name,o=r.name;try{n=Lr("cat /sys/block/"+o+"/queue/rotational 2>/dev/null").toString().split("\n")[0]}catch(e){Ir.noop()}let l=r.tran?r.tran.toUpperCase().trim():"";"NVME"===l&&(n="2",l="PCIe"),i.push({device:a,type:"0"===n?"SSD":"1"===n?"HD":"2"===n?"NVMe":r.model&&r.model.indexOf("SSD")>-1?"SSD":r.model&&r.model.indexOf("NVM")>-1?"NVMe":"HD",name:r.model||"",vendor:t(r.model)||(r.vendor?r.vendor.trim():""),size:r.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:r.rev?r.rev.trim():"",serialNum:r.serial?r.serial.trim():"",interfaceType:l,smartStatus:"unknown",temperature:null,BSDName:a}),s+=`printf "\n${a}|"; smartctl -H ${a} | grep overall;`,e+=`${e?'printf ",";':""}smartctl -a -j ${a};`}))}catch(e){Ir.noop()}e?Er(e,{maxBuffer:1048576},(function(e,t){try{JSON.parse(`[${t}]`).forEach((e=>{const t=e.smartctl.argv[e.smartctl.argv.length-1];for(let r=0;r<i.length;r++)i[r].BSDName===t&&(i[r].smartStatus=e.smart_status.passed?"Ok":!1===e.smart_status.passed?"Predicted Failure":"unknown",e.temperature&&e.temperature.current&&(i[r].temperature=e.temperature.current),i[r].smartData=e)})),n(i)}catch(e){s?(s+='printf "\n"',Er(s,{maxBuffer:1048576},(function(e,t){t.toString().split("\n").forEach((e=>{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let r=t[1].split(":");if(2===r.length){r[1]=r[1].trim();let t=r[1].toLowerCase();for(let r=0;r<i.length;r++)i[r].BSDName===e&&(i[r].smartStatus="passed"===t?"Ok":"failed!"===t?"Predicted Failure":"unknown")}}}})),n(i)}))):n(i)}})):n(i)}))}if((Nr||Dr||kr)&&(e&&e(i),r(i)),Mr&&(e&&e(i),r(i)),Vr&&Er("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType",{maxBuffer:1048576},(function(n,a){if(!n){let n=a.toString().split("\n"),o=[],l=[],c=[],u="SATA";n.forEach((e=>{"NVMExpress:"===e?u="NVMe":"USB:"===e?u="USB":"SATA/SATA Express:"===e?u="SATA":"SATA"===u?o.push(e):"NVMe"===u?l.push(e):"USB"===u&&c.push(e)}));try{let e=o.join("\n").split(" Physical Interconnect: ");e.shift(),e.forEach((function(e){let r=(e="InterfaceType: "+e).split("\n");const n=Ir.getValue(r,"Medium Type",":",!0).trim(),a=Ir.getValue(r,"capacity",":",!0).trim(),o=Ir.getValue(r,"BSD Name",":",!0).trim();if(a){let e=0;if(a.indexOf("(")>=0&&(e=parseInt(a.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(a)),e){const a=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:o,type:n.startsWith("Solid")?"SSD":"HD",name:Ir.getValue(r,"Model",":",!0).trim(),vendor:t(Ir.getValue(r,"Model",":",!0).trim())||Ir.getValue(r,"Manufacturer",":",!0),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:Ir.getValue(r,"InterfaceType",":",!0).trim(),smartStatus:"verified"===a?"OK":a||"unknown",temperature:null,BSDName:o}),s=s+'printf "\n'+o+'|"; diskutil info /dev/'+o+" | grep SMART;"}}}))}catch(e){Ir.noop()}try{let e=l.join("\n").split("\n\n Capacity:");e.shift(),e.forEach((function(e){let r=(e="!Capacity: "+e).split("\n");const n=Ir.getValue(r,"link width",":",!0).trim(),a=Ir.getValue(r,"!capacity",":",!0).trim(),o=Ir.getValue(r,"BSD Name",":",!0).trim();if(a){let e=0;if(a.indexOf("(")>=0&&(e=parseInt(a.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(a)),e){const a=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:o,type:"NVMe",name:Ir.getValue(r,"Model",":",!0).trim(),vendor:t(Ir.getValue(r,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+n).trim(),smartStatus:"verified"===a?"OK":a||"unknown",temperature:null,BSDName:o}),s=s+'printf "\n'+o+'|"; diskutil info /dev/'+o+" | grep SMART;"}}}))}catch(e){Ir.noop()}try{let e=c.join("\n").replaceAll("Media:\n ","Model:").split("\n\n Product ID:");e.shift(),e.forEach((function(e){let r=e.split("\n");const n=Ir.getValue(r,"Capacity",":",!0).trim(),a=Ir.getValue(r,"BSD Name",":",!0).trim();if(n){let e=0;if(n.indexOf("(")>=0&&(e=parseInt(n.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(n)),e){const n=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:a,type:"USB",name:Ir.getValue(r,"Model",":",!0).trim().replaceAll(":",""),vendor:t(Ir.getValue(r,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:"verified"===n?"OK":n||"unknown",temperature:null,BSDName:a}),s=s+'printf "\n'+a+'|"; diskutil info /dev/'+a+" | grep SMART;"}}}))}catch(e){Ir.noop()}if(s)s+='printf "\n"',Er(s,{maxBuffer:1048576},(function(t,n){n.toString().split("\n").forEach((e=>{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let r=t[1].split(":");if(2===r.length){r[1]=r[1].trim();let t=r[1].toLowerCase();for(let r=0;r<i.length;r++)i[r].BSDName===e&&(i[r].smartStatus="not supported"===t?"not supported":"verified"===t?"Ok":"failing"===t?"Predicted Failure":"unknown")}}}}));for(let e=0;e<i.length;e++)delete i[e].BSDName;e&&e(i),r(i)}));else{for(let e=0;e<i.length;e++)delete i[e].BSDName;e&&e(i),r(i)}}})),Ar)try{const n=[];if(n.push(Ir.powerShell("Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl")),n.push(Ir.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")),Ir.smartMonToolsInstalled())try{const e=JSON.parse(Lr("smartctl --scan -j").toString());e&&e.devices&&e.devices.length>0&&e.devices.forEach((e=>{n.push(_r(`smartctl -j -a ${e.name}`,Ir.execOptsWin))}))}catch(e){Ir.noop()}Ir.promiseAll(n).then((n=>{let s=n.results[0].toString().split(/\n\s*\n/);s.forEach((function(e){let r=e.split("\r\n");const n=Ir.getValue(r,"Size",":").trim(),s=Ir.getValue(r,"Status",":").trim().toLowerCase();n&&i.push({device:Ir.getValue(r,"DeviceId",":"),type:e.indexOf("SSD")>-1?"SSD":"HD",name:Ir.getValue(r,"Caption",":"),vendor:t(Ir.getValue(r,"Caption",":",!0).trim()),size:parseInt(n),bytesPerSector:parseInt(Ir.getValue(r,"BytesPerSector",":")),totalCylinders:parseInt(Ir.getValue(r,"TotalCylinders",":")),totalHeads:parseInt(Ir.getValue(r,"TotalHeads",":")),totalSectors:parseInt(Ir.getValue(r,"TotalSectors",":")),totalTracks:parseInt(Ir.getValue(r,"TotalTracks",":")),tracksPerCylinder:parseInt(Ir.getValue(r,"TracksPerCylinder",":")),sectorsPerTrack:parseInt(Ir.getValue(r,"SectorsPerTrack",":")),firmwareRevision:Ir.getValue(r,"FirmwareRevision",":").trim(),serialNum:Ir.getValue(r,"SerialNumber",":").trim(),interfaceType:Ir.getValue(r,"InterfaceType",":").trim(),smartStatus:"ok"===s?"Ok":"degraded"===s?"Degraded":"pred fail"===s?"Predicted Failure":"Unknown",temperature:null})})),s=n.results[1].split(/\n\s*\n/),s.forEach((function(e){let t=e.split("\r\n");const r=Ir.getValue(t,"SerialNumber",":").trim(),n=Ir.getValue(t,"FriendlyName",":").trim().replace("Msft ","Microsoft"),s=Ir.getValue(t,"Size",":").trim(),a=Ir.getValue(t,"Model",":").trim(),o=Ir.getValue(t,"BusType",":").trim();let l=Ir.getValue(t,"MediaType",":").trim();if("3"!==l&&"HDD"!==l||(l="HD"),"4"===l&&(l="SSD"),"5"===l&&(l="SCM"),"Unspecified"===l&&(a.toLowerCase().indexOf("virtual")>-1||a.toLowerCase().indexOf("vbox")>-1)&&(l="Virtual"),s){let e=Ir.findObjectByKey(i,"serialNum",r);-1!==e&&""!==r||(e=Ir.findObjectByKey(i,"name",n)),-1!=e&&(i[e].type=l,i[e].interfaceType=o)}})),n.results.shift(),n.results.shift(),n.results.length&&n.results.forEach((e=>{try{const t=JSON.parse(e);if(t.serial_number){const e=t.serial_number;let r=Ir.findObjectByKey(i,"serialNum",e);-1!=r&&(i[r].smartStatus=t.smart_status&&t.smart_status.passed?"Ok":t.smart_status&&!1===t.smart_status.passed?"Predicted Failure":"unknown",t.temperature&&t.temperature.current&&(i[r].temperature=t.temperature.current),i[r].smartData=t)}}catch(e){Ir.noop()}})),e&&e(i),r(i)}))}catch(t){e&&e(i),r(i)}}))}))};var Xr={};const zr=m.default,Kr=y.default.exec,Yr=y.default.execSync,qr=h.default,Jr=L;let Qr=process.platform;const Zr="linux"===Qr||"android"===Qr,en="darwin"===Qr,tn="win32"===Qr,rn="freebsd"===Qr,nn="openbsd"===Qr,sn="netbsd"===Qr,an="sunos"===Qr;let on,ln={},cn="",un={},pn=[],fn=[],dn={};function mn(){let e="",t="";try{let r=zr.networkInterfaces(),n=9999;for(let i in r)({}).hasOwnProperty.call(r,i)&&r[i].forEach((function(r){r&&!1===r.internal&&(t=t||i,r.scopeid&&r.scopeid<n&&(e=i,n=r.scopeid))}));if(e=e||t||"",tn){let t="";const n=Yr("netstat -r",Jr.execOptsWin);if(n.toString().split(zr.EOL).forEach((e=>{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const r=e.split(" ");r.length>=5&&(t=r[r.length-2])}})),t)for(let n in r)({}).hasOwnProperty.call(r,n)&&r[n].forEach((function(r){r&&r.address&&r.address===t&&(e=n)}))}if(Zr){let t=Yr("ip route 2> /dev/null | grep default").toString().split("\n")[0].split(/\s+/);"none"===t[0]&&t[5]?e=t[5]:t[4]&&(e=t[4]),e.indexOf(":")>-1&&(e=e.split(":")[1].trim())}if(en||rn||nn||sn||an){let t="";Zr&&(t="ip route 2> /dev/null | grep default | awk '{print $5}'"),en&&(t="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(rn||nn||sn||an)&&(t="route get 0.0.0.0 | grep interface:");let r=Yr(t);e=r.toString().split("\n")[0],e.indexOf(":")>-1&&(e=e.split(":")[1].trim())}}catch(e){Jr.noop()}return e&&(cn=e),cn}function hn(){let e="",t="",r={};if(Zr||rn||nn||sn){if(void 0===on)try{const e=Yr("which ip").toString().split("\n");on=e.length&&-1===e[0].indexOf(":")&&0===e[0].indexOf("/")?e[0]:""}catch(e){on=""}try{const n=Yr("export LC_ALL=C; "+(on?on+" link show up":"/sbin/ifconfig")+"; unset LC_ALL").toString().split("\n");for(let i=0;i<n.length;i++)if(n[i]&&" "!==n[i][0]){if(on){let r=n[i+1].trim().split(" ");"link/ether"===r[0]&&(e=n[i].split(" ")[1],e=e.slice(0,e.length-1),t=r[1])}else e=n[i].split(" ")[0],t=n[i].split("HWaddr ")[1];e&&t&&(r[e]=t.trim(),e="",t="")}}catch(e){Jr.noop()}}if(en)try{const n=Yr("/sbin/ifconfig").toString().split("\n");for(let i=0;i<n.length;i++)n[i]&&"\t"!==n[i][0]&&n[i].indexOf(":")>0?e=n[i].split(":")[0]:0===n[i].indexOf("\tether ")&&(t=n[i].split("\tether ")[1],e&&t&&(r[e]=t.trim(),e="",t=""))}catch(e){Jr.noop()}return r}function gn(){return new Promise((e=>{process.nextTick((()=>{let t="Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";t+="Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";try{Jr.powerShell("Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled").then((t=>{const r=((t=t.split("#-#-#-#"))[0]||"").split(/\n\s*\n/),n=(t[1]||"").split(/\n\s*\n/);e(function(e,t){let r=[];for(let n in e)if({}.hasOwnProperty.call(e,n)&&""!==e[n].trim()){let i=e[n].trim().split("\r\n"),s=t&&t[n]?t[n].trim().split("\r\n"):[],a=Jr.getValue(i,"NetEnabled",":"),o="9"===Jr.getValue(i,"AdapterTypeID",":")?"wireless":"wired",l=Jr.getValue(i,"Name",":").replace(/\]/g,")").replace(/\[/g,"("),c=Jr.getValue(i,"NetConnectionID",":").replace(/\]/g,")").replace(/\[/g,"(");if((l.toLowerCase().indexOf("wi-fi")>=0||l.toLowerCase().indexOf("wireless")>=0)&&(o="wireless"),""!==a){const e=parseInt(Jr.getValue(i,"speed",":").trim(),10)/1e6;r.push({mac:Jr.getValue(i,"MACAddress",":").toLowerCase(),dhcp:"true"===Jr.getValue(s,"dhcpEnabled",":").toLowerCase(),name:l,iface:c,netEnabled:"TRUE"===a,speed:isNaN(e)?null:e,operstate:"2"===Jr.getValue(i,"NetConnectionStatus",":")?"up":"down",type:o})}}return r}(r,n))}))}catch(t){e([])}}))}))}function yn(e,t){let r="";const n=t+".";try{const t=e.filter((e=>n.includes(e.name+"."))).map((e=>e.dnsSuffix));return t[0]&&(r=t[0]),r||(r=""),r}catch(e){return"Unknown"}}function vn(e,t,r){let n={state:"Unknown",protocol:"Unknown"};if("Disabled"===r)return n.state="Disabled",n.protocol="Not defined",n;if("wired"==e&&r.length>0)try{const e=r.find((e=>e.includes(t+"\r\n"))).split("\r\n"),i=e.find((e=>e.includes("802.1x")));if(i.includes("Disabled"))n.state="Disabled",n.protocol="Not defined";else if(i.includes("Enabled")){const t=e.find((e=>e.includes("EAP")));n.protocol=t.split(":").pop(),n.state="Enabled"}}catch(e){return n}else if("wireless"==e){let e="",r="";try{const i=function(e){try{return Yr(`netsh wlan show interface name="${e}" | findstr "SSID"`,Jr.execOptsWin).split("\r\n").shift().split(":").pop()}catch(e){return"Unknown"}}(t);"Unknown"!==i&&(e=Yr(`netsh wlan show profiles "${i}" | findstr "802.1X"`,Jr.execOptsWin),r=Yr(`netsh wlan show profiles "${i}" | findstr "EAP"`,Jr.execOptsWin)),e.includes(":")&&r.includes(":")&&(n.state=e.split(":").pop(),n.protocol=r.split(":").pop())}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")&&(n.state="Disabled",n.protocol="Not defined"),n}}return n}function Sn(e){const t=[];let r=[];return e.forEach((function(e){e.startsWith("\t")||e.startsWith(" ")||r.length&&(t.push(r),r=[]),r.push(e)})),r.length&&t.push(r),t}function wn(){try{const e=Yr("/sbin/ifconfig -v",{maxBuffer:2048e4}).toString().split("\n");return function(e){let t=[];return e.forEach((e=>{let r={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1};const n=e[0];r.iface=n.split(":")[0].trim();let i=n.split("> mtu");r.mtu=i.length>1?parseInt(i[1],10):null,isNaN(r.mtu)&&(r.mtu=null),r.internal=i[0].toLowerCase().indexOf("loopback")>-1,e.forEach((e=>{e.trim().startsWith("ether ")&&(r.mac=e.split("ether ")[1].toLowerCase().trim()),e.trim().startsWith("inet6 ")&&!r.ip6&&(r.ip6=e.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),e.trim().startsWith("inet ")&&!r.ip4&&(r.ip4=e.split("inet ")[1].toLowerCase().split(" ")[0])}));let s=Jr.getValue(e,"link rate");r.speed=s?parseFloat(s):null,null===r.speed?(s=Jr.getValue(e,"uplink rate"),r.speed=s?parseFloat(s):null,null!==r.speed&&s.toLowerCase().indexOf("gbps")>=0&&(r.speed=1e3*r.speed)):s.toLowerCase().indexOf("gbps")>=0&&(r.speed=1e3*r.speed),r.type=Jr.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired";const a=Jr.getValue(e,"status").toLowerCase();r.operstate="active"===a?"up":"inactive"===a?"down":"unknown",r.duplex=Jr.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(r.ip6||r.ip4||r.mac)&&t.push(r)})),t}(Sn(e))}catch(e){return[]}}function xn(e){const t=`nmcli device status 2>/dev/null | grep ${e}`;try{const e=Yr(t).toString().replace(/\s+/g," ").trim(),r=e.split(" ").slice(3).join(" ");return"--"!=r?r:""}catch(e){return""}}function Cn(e){let t=[];try{let r=`cat ${e} 2> /dev/null | grep 'iface\\|source'`;Yr(r,{maxBuffer:2048e4}).toString().split("\n").forEach((e=>{const r=e.replace(/\s+/g," ").trim().split(" ");if(r.length>=4&&e.toLowerCase().indexOf(" inet ")>=0&&e.toLowerCase().indexOf("dhcp")>=0&&t.push(r[1]),e.toLowerCase().includes("source")){let r=e.split(" ")[1];t=t.concat(Cn(r))}}))}catch(e){Jr.noop()}return t}function On(){let e=[];try{const t=Yr("ip a 2> /dev/null",{maxBuffer:2048e4}).toString().split("\n");e=function(e){const t=[];e&&e.length&&e.forEach((e=>{if(e&&e.length){if(e[0].split(":").length>2)for(let r of e)if(r.indexOf(" inet ")>=0&&r.indexOf(" dynamic ")>=0){const e=r.split(" "),n=e[e.length-1].trim();t.push(n);break}}}));return t}(Sn(t))}catch(e){Jr.noop()}try{e=Cn("/etc/network/interfaces")}catch(e){Jr.noop()}return e}function In(e,t,r){let n=!1;if(!t)return r.indexOf(e)>=0;{const i=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.method;`;try{const e=Yr(i).toString();if("auto"===e.replace(/\s+/g," ").trim().split(" ").slice(1).toString())n=!0;else n=!1;return n}catch(t){return r.indexOf(e)>=0}}}function bn(e){let t=!1;const r=`ipconfig getpacket "${e}" 2>/dev/null | grep lease_time;`;try{const e=Yr(r).toString().split("\n");e.length&&e[0].startsWith("lease_time")&&(t=!0)}catch(e){Jr.noop()}return t}function En(e){if(!e)return"Unknown";{const t=`nmcli connection show "${e}" 2>/dev/null | grep ipv4.dns-search;`;try{const e=Yr(t).toString(),r=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==r?"Not defined":r}catch(e){return"Unknown"}}}function Ln(e){if(!e)return"Not defined";{const t=`nmcli connection show "${e}" 2>/dev/null | grep 802-1x.eap;`;try{const e=Yr(t).toString(),r=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==r?"":r}catch(e){return"Not defined"}}}function _n(e,t,r){return!!r&&(["00:00:00:00:00:00","00:03:FF","00:05:69","00:0C:29","00:0F:4B","00:13:07","00:13:BE","00:15:5d","00:16:3E","00:1C:42","00:21:F6","00:24:0B","00:50:56","00:A0:B1","00:E0:C8","08:00:27","0A:00:27","18:92:2C","16:DF:49","3C:F3:92","54:52:00","FC:15:97"].filter((e=>r.toUpperCase().toUpperCase().startsWith(e.substring(0,r.length)))).length>0||e.toLowerCase().indexOf(" virtual ")>-1||t.toLowerCase().indexOf(" virtual ")>-1||e.toLowerCase().indexOf("vethernet ")>-1||t.toLowerCase().indexOf("vethernet ")>-1||e.toLowerCase().startsWith("veth")||t.toLowerCase().startsWith("veth")||e.toLowerCase().startsWith("vboxnet")||t.toLowerCase().startsWith("vboxnet"))}function Pn(e,t,r){return"string"==typeof e&&(r=e,t=!0,e=null),"boolean"==typeof e&&(t=e,e=null,r=""),void 0===t&&(t=!0),r=""+(r=r||""),new Promise((n=>{process.nextTick((()=>{let i=zr.networkInterfaces(),s=[],a=[],o=[],l=[];if(en||rn||nn||sn)if(JSON.stringify(i)!==JSON.stringify(un)||t){const t=mn();un=JSON.parse(JSON.stringify(i)),a=wn(),a.forEach((e=>{({}).hasOwnProperty.call(i,e.iface)&&i[e.iface].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(e.ip4subnet=t.netmask),"IPv6"!==t.family&&6!==t.family||(e.ip6subnet=t.netmask)}));let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e.iface),a=Jr.mathMin(n.length,2e3);for(let e=0;e<=a;e++)void 0!==n[e]&&(r+=n[e]);s.push({iface:e.iface,ifaceName:e.iface,default:e.iface===t,ip4:e.ip4,ip4subnet:e.ip4subnet||"",ip6:e.ip6,ip6subnet:e.ip6subnet||"",mac:e.mac,internal:e.internal,virtual:!e.internal&&_n(e.iface,e.iface,e.mac),operstate:e.operstate,type:e.type,duplex:e.duplex,mtu:e.mtu,speed:e.speed,dhcp:bn(r),dnsSuffix:"",ieee8021xAuth:"",ieee8021xState:"",carrierChanges:0})})),fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}else s=fn,e&&e(s),n(s);if(Zr)if(JSON.stringify(i)!==JSON.stringify(un)||t){un=JSON.parse(JSON.stringify(i)),pn=On();const t=mn();for(let e in i){let r="",n="",a="",o="",l="",u="",p="",f=null,d=0,m=!1,h="",g="",y="",v="";if({}.hasOwnProperty.call(i,e)){let S=e;i[e].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(r=t.address,n=t.netmask),"IPv6"!==t.family&&6!==t.family||a&&!a.match(/^fe80::/i)||(a=t.address,o=t.netmask),l=t.mac;const i=parseInt(process.versions.node.split("."),10);l.indexOf("00:00:0")>-1&&(Zr||en)&&!t.internal&&i>=8&&i<=11&&(0===Object.keys(dn).length&&(dn=hn()),l=dn[e]||"")}));let w=e.split(":")[0].trim().toLowerCase(),x="";const C=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(w),O=Jr.mathMin(C.length,2e3);for(let e=0;e<=O;e++)void 0!==C[e]&&(x+=C[e]);const I=`echo -n "addr_assign_type: "; cat /sys/class/net/${x}/addr_assign_type 2>/dev/null; echo;\n echo -n "address: "; cat /sys/class/net/${x}/address 2>/dev/null; echo;\n echo -n "addr_len: "; cat /sys/class/net/${x}/addr_len 2>/dev/null; echo;\n echo -n "broadcast: "; cat /sys/class/net/${x}/broadcast 2>/dev/null; echo;\n echo -n "carrier: "; cat /sys/class/net/${x}/carrier 2>/dev/null; echo;\n echo -n "carrier_changes: "; cat /sys/class/net/${x}/carrier_changes 2>/dev/null; echo;\n echo -n "dev_id: "; cat /sys/class/net/${x}/dev_id 2>/dev/null; echo;\n echo -n "dev_port: "; cat /sys/class/net/${x}/dev_port 2>/dev/null; echo;\n echo -n "dormant: "; cat /sys/class/net/${x}/dormant 2>/dev/null; echo;\n echo -n "duplex: "; cat /sys/class/net/${x}/duplex 2>/dev/null; echo;\n echo -n "flags: "; cat /sys/class/net/${x}/flags 2>/dev/null; echo;\n echo -n "gro_flush_timeout: "; cat /sys/class/net/${x}/gro_flush_timeout 2>/dev/null; echo;\n echo -n "ifalias: "; cat /sys/class/net/${x}/ifalias 2>/dev/null; echo;\n echo -n "ifindex: "; cat /sys/class/net/${x}/ifindex 2>/dev/null; echo;\n echo -n "iflink: "; cat /sys/class/net/${x}/iflink 2>/dev/null; echo;\n echo -n "link_mode: "; cat /sys/class/net/${x}/link_mode 2>/dev/null; echo;\n echo -n "mtu: "; cat /sys/class/net/${x}/mtu 2>/dev/null; echo;\n echo -n "netdev_group: "; cat /sys/class/net/${x}/netdev_group 2>/dev/null; echo;\n echo -n "operstate: "; cat /sys/class/net/${x}/operstate 2>/dev/null; echo;\n echo -n "proto_down: "; cat /sys/class/net/${x}/proto_down 2>/dev/null; echo;\n echo -n "speed: "; cat /sys/class/net/${x}/speed 2>/dev/null; echo;\n echo -n "tx_queue_len: "; cat /sys/class/net/${x}/tx_queue_len 2>/dev/null; echo;\n echo -n "type: "; cat /sys/class/net/${x}/type 2>/dev/null; echo;\n echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${x}; echo;\n echo -n "wirelessspeed: "; iw dev ${x} link 2>&1 | grep bitrate; echo;`;let b=[];try{b=Yr(I).toString().split("\n");const e=xn(x);m=In(x,e,pn),h=En(e),g=Ln(e),y=(c=g)?"Not defined"==c?"Disabled":"Enabled":"Unknown"}catch(e){Jr.noop()}u=Jr.getValue(b,"duplex"),u=u.startsWith("cat")?"":u,p=parseInt(Jr.getValue(b,"mtu"),10);let E=parseInt(Jr.getValue(b,"speed"),10);f=isNaN(E)?null:E;let L=Jr.getValue(b,"wirelessspeed").split("tx bitrate: ");null===f&&2===L.length&&(E=parseFloat(L[1]),f=isNaN(E)?null:E),d=parseInt(Jr.getValue(b,"carrier_changes"),10);const _=Jr.getValue(b,"operstate");v="up"===_?Jr.getValue(b,"wireless").trim()?"wireless":"wired":"unknown",("lo"===x||x.startsWith("bond"))&&(v="virtual");let P=!(!i[e]||!i[e][0])&&i[e][0].internal;(e.toLowerCase().indexOf("loopback")>-1||S.toLowerCase().indexOf("loopback")>-1)&&(P=!0);const T=!P&&_n(e,S,l);s.push({iface:x,ifaceName:S,default:w===t,ip4:r,ip4subnet:n,ip6:a,ip6subnet:o,mac:l,internal:P,virtual:T,operstate:_,type:v,duplex:u,mtu:p,speed:f,dhcp:m,dnsSuffix:h,ieee8021xAuth:g,ieee8021xState:y,carrierChanges:d})}}fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}else s=fn,e&&e(s),n(s);var c;if(tn)if(JSON.stringify(i)!==JSON.stringify(un)||t){un=JSON.parse(JSON.stringify(i));const t=mn();gn().then((function(a){a.forEach((e=>{let t=!1;Object.keys(i).forEach((r=>{t||i[r].forEach((r=>{Object.keys(r).indexOf("mac")>=0&&(t=r.mac===e.mac)}))})),t||(i[e.name]=[{mac:e.mac}])})),l=function(){try{return Yr("netsh lan show profiles",Jr.execOptsWin).split("\r\nProfile on interface")}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")?"Disabled":[]}}(),o=function(){let e={},t={primaryDNS:"",exitCode:0,ifaces:[]};try{return Yr("ipconfig /all",Jr.execOptsWin).split("\r\n\r\n").forEach(((r,n)=>{if(1==n){const e=r.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),n=e[0].substring(e[0].lastIndexOf(":")+1);t.primaryDNS=n.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(n>1)if(n%2==0){const t=r.substring(r.lastIndexOf(" ")+1).replace(":","");e.name=t}else{const n=r.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),i=n[0].substring(n[0].lastIndexOf(":")+1);e.dnsSuffix=i.trim(),t.ifaces.push(e),e={}}})),t}catch(e){return{primaryDNS:"",exitCode:0,ifaces:[]}}}();for(let e in i){let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e),c=Jr.mathMin(n.length,2e3);for(let e=0;e<=c;e++)void 0!==n[e]&&(r+=n[e]);let u=e,p="",f="",d="",m="",h="",g="",y="",v=null,S=0,w="down",x=!1,C="",O="",I="",b="";if({}.hasOwnProperty.call(i,e)){let n=e;i[e].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(p=t.address,f=t.netmask),"IPv6"!==t.family&&6!==t.family||d&&!d.match(/^fe80::/i)||(d=t.address,m=t.netmask),h=t.mac;const r=parseInt(process.versions.node.split("."),10);h.indexOf("00:00:0")>-1&&(Zr||en)&&!t.internal&&r>=8&&r<=11&&(0===Object.keys(dn).length&&(dn=hn()),h=dn[e]||"")})),C=yn(o.ifaces,r);let c=!1;a.forEach((e=>{e.mac!==h||c||(u=e.iface||u,n=e.name,x=e.dhcp,w=e.operstate,v=e.speed,b=e.type,c=!0)})),(e.toLowerCase().indexOf("wlan")>=0||n.toLowerCase().indexOf("wlan")>=0||n.toLowerCase().indexOf("802.11n")>=0||n.toLowerCase().indexOf("wireless")>=0||n.toLowerCase().indexOf("wi-fi")>=0||n.toLowerCase().indexOf("wifi")>=0)&&(b="wireless");const E=vn(b,r,l);O=E.protocol,I=E.state;let L=!(!i[e]||!i[e][0])&&i[e][0].internal;(e.toLowerCase().indexOf("loopback")>-1||n.toLowerCase().indexOf("loopback")>-1)&&(L=!0);const _=!L&&_n(e,n,h);s.push({iface:u,ifaceName:n,default:u===t,ip4:p,ip4subnet:f,ip6:d,ip6subnet:m,mac:h,internal:L,virtual:_,operstate:w,type:b,duplex:g,mtu:y,speed:v,dhcp:x,dnsSuffix:C,ieee8021xAuth:O,ieee8021xState:I,carrierChanges:S})}}fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}))}else s=fn,e&&e(s),n(s)}))}))}function Tn(e,t,r,n,i,s,a,o){let l={iface:e,operstate:n,rx_bytes:t,rx_dropped:i,rx_errors:s,tx_bytes:r,tx_dropped:a,tx_errors:o,rx_sec:null,tx_sec:null,ms:0};return ln[e]&&ln[e].ms?(l.ms=Date.now()-ln[e].ms,l.rx_sec=t-ln[e].rx_bytes>=0?(t-ln[e].rx_bytes)/(l.ms/1e3):0,l.tx_sec=r-ln[e].tx_bytes>=0?(r-ln[e].tx_bytes)/(l.ms/1e3):0,ln[e].rx_bytes=t,ln[e].tx_bytes=r,ln[e].rx_sec=l.rx_sec,ln[e].tx_sec=l.tx_sec,ln[e].ms=Date.now(),ln[e].last_ms=l.ms,ln[e].operstate=n):(ln[e]||(ln[e]={}),ln[e].rx_bytes=t,ln[e].tx_bytes=r,ln[e].rx_sec=null,ln[e].tx_sec=null,ln[e].ms=Date.now(),ln[e].last_ms=0,ln[e].operstate=n),l}function Vn(e){return new Promise((t=>{process.nextTick((()=>{let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e),i=Jr.mathMin(n.length,2e3);for(let e=0;e<=i;e++)void 0!==n[e]&&(r+=n[e]);let s,a,o,l={iface:r,operstate:"unknown",rx_bytes:0,rx_dropped:0,rx_errors:0,tx_bytes:0,tx_dropped:0,tx_errors:0,rx_sec:null,tx_sec:null,ms:0},c="unknown",u=0,p=0,f=0,d=0,m=0,h=0;if(!ln[r]||ln[r]&&!ln[r].ms||ln[r]&&ln[r].ms&&Date.now()-ln[r].ms>=500){if(Zr&&(qr.existsSync("/sys/class/net/"+r)?(s="cat /sys/class/net/"+r+"/operstate; cat /sys/class/net/"+r+"/statistics/rx_bytes; cat /sys/class/net/"+r+"/statistics/tx_bytes; cat /sys/class/net/"+r+"/statistics/rx_dropped; cat /sys/class/net/"+r+"/statistics/rx_errors; cat /sys/class/net/"+r+"/statistics/tx_dropped; cat /sys/class/net/"+r+"/statistics/tx_errors; ",Kr(s,(function(e,n){e||(a=n.toString().split("\n"),c=a[0].trim(),u=parseInt(a[1],10),p=parseInt(a[2],10),f=parseInt(a[3],10),d=parseInt(a[4],10),m=parseInt(a[5],10),h=parseInt(a[6],10),l=Tn(r,u,p,c,f,d,m,h)),t(l)}))):t(l)),(rn||nn||sn)&&(s="netstat -ibndI "+r,Kr(s,(function(e,n){if(!e){a=n.toString().split("\n");for(let e=1;e<a.length;e++){const t=a[e].replace(/ +/g," ").split(" ");t&&t[0]&&t[7]&&t[10]&&(u+=parseInt(t[7]),"-"!==t[6].trim()&&(f+=parseInt(t[6])),"-"!==t[5].trim()&&(d+=parseInt(t[5])),p+=parseInt(t[10]),"-"!==t[12].trim()&&(m+=parseInt(t[12])),"-"!==t[9].trim()&&(h+=parseInt(t[9])),c="up")}l=Tn(r,u,p,c,f,d,m,h)}t(l)}))),en&&(s="ifconfig "+r+' | grep "status"',Kr(s,(function(e,n){l.operstate=(n.toString().split(":")[1]||"").trim(),l.operstate=(l.operstate||"").toLowerCase(),l.operstate="active"===l.operstate?"up":"inactive"===l.operstate?"down":"unknown",s="netstat -bdI "+r,Kr(s,(function(e,n){if(!e&&(a=n.toString().split("\n"),a.length>1&&""!==a[1].trim())){o=a[1].replace(/ +/g," ").split(" ");const e=o.length>11?1:0;u=parseInt(o[e+5]),f=parseInt(o[e+10]),d=parseInt(o[e+4]),p=parseInt(o[e+8]),m=parseInt(o[e+10]),h=parseInt(o[e+7]),l=Tn(r,u,p,l.operstate,f,d,m,h)}t(l)}))}))),tn){let e=[],n=r;Jr.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then(((i,s)=>{if(!s){const t=i.toString().split(/\n\s*\n/);e=function(e){let t=[];for(let r in e)if({}.hasOwnProperty.call(e,r)&&""!==e[r].trim()){let n=e[r].trim().split("\r\n");t.push({name:Jr.getValue(n,"Name",":").replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase(),rx_bytes:parseInt(Jr.getValue(n,"BytesReceivedPersec",":"),10),rx_errors:parseInt(Jr.getValue(n,"PacketsReceivedErrors",":"),10),rx_dropped:parseInt(Jr.getValue(n,"PacketsReceivedDiscarded",":"),10),tx_bytes:parseInt(Jr.getValue(n,"BytesSentPersec",":"),10),tx_errors:parseInt(Jr.getValue(n,"PacketsOutboundErrors",":"),10),tx_dropped:parseInt(Jr.getValue(n,"PacketsOutboundDiscarded",":"),10)})}return t}(t)}Pn(!1).then((i=>{u=0,p=0,e.forEach((e=>{i.forEach((t=>{t.iface.toLowerCase()!==r.toLowerCase()&&t.mac.toLowerCase()!==r.toLowerCase()&&t.ip4.toLowerCase()!==r.toLowerCase()&&t.ip6.toLowerCase()!==r.toLowerCase()&&t.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()!==r.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase()||t.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()!==e.name||(n=t.iface,u=e.rx_bytes,f=e.rx_dropped,d=e.rx_errors,p=e.tx_bytes,m=e.tx_dropped,h=e.tx_errors,c=t.operstate)}))})),u&&p&&(l=Tn(n,parseInt(u),parseInt(p),c,f,d,m,h)),t(l)}))}))}}else l.rx_bytes=ln[r].rx_bytes,l.tx_bytes=ln[r].tx_bytes,l.rx_sec=ln[r].rx_sec,l.tx_sec=ln[r].tx_sec,l.ms=ln[r].last_ms,l.operstate=ln[r].operstate,t(l)}))}))}function An(e,t){let r="";e.forEach((e=>{const n=e.split(" ");(parseInt(n[0],10)||-1)===t&&(n.shift(),r=n.join(" ").split(":")[0])})),r=r.split(" -")[0];const n=r.split("/");return n[n.length-1]}Xr.getDefaultNetworkInterface=mn,Xr.networkInterfaceDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let r=mn();e&&e(r),t(r)}))}))},Xr.networkInterfaces=Pn,Xr.networkStats=function e(t,r){let n=[];return new Promise((i=>{process.nextTick((()=>{if(Jr.isFunction(t)&&!r)r=t,n=[mn()];else{if("string"!=typeof t&&void 0!==t)return r&&r([]),i([]);(t=t||mn()).__proto__.toLowerCase=Jr.stringToLower,t.__proto__.replace=Jr.stringReplace,t.__proto__.trim=Jr.stringTrim,t=t.trim().toLowerCase().replace(/,+/g,"|"),n=t.split("|")}const s=[],a=[];if(n.length&&"*"===n[0].trim())n=[],Pn(!1).then((t=>{for(let e of t)n.push(e.iface);e(n.join(",")).then((e=>{r&&r(e),i(e)}))}));else{for(let e of n)a.push(Vn(e.trim()));a.length?Promise.all(a).then((e=>{r&&r(e),i(e)})):(r&&r(s),i(s))}}))}))},Xr.networkConnections=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Zr||rn||nn||sn){let n='export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';(rn||nn||sn)&&(n='export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'),Kr(n,{maxBuffer:2048e4},(function(i,s){let a=s.toString().split("\n");!i&&(a.length>1||""!=a[0])?(a.forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=7){let t=e[3],n="",i=e[3].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":"));let s=e[4],a="",o=e[4].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":"));let l=e[5],c=e[6].split("/");l&&r.push({protocol:e[0],localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:l,pid:c[0]&&"-"!==c[0]?parseInt(c[0],10):null,process:c[1]?c[1].split(" ")[0].split(":")[0]:""})}})),e&&e(r),t(r)):(n='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',Kr(n,{maxBuffer:2048e4},(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=6){let t=e[4],n="",i=e[4].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":"));let s=e[5],a="",o=e[5].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":"));let l=e[1];"ESTAB"===l&&(l="ESTABLISHED"),"TIME-WAIT"===l&&(l="TIME_WAIT");let c=null,u="";if(e.length>=7&&e[6].indexOf("users:")>-1){let t=e[6].replace('users:(("',"").replace(/"/g,"").split(",");t.length>2&&(u=t[0].split(" ")[0].split(":")[0],c=parseInt(t[1],10))}l&&r.push({protocol:e[0],localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:l,pid:c,process:u})}}))}e&&e(r),t(r)})))}))}if(en){const n="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN";Kr('netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"',{maxBuffer:2048e4},(function(i,s){i||Kr("ps -axo pid,command",{maxBuffer:2048e4},(function(i,a){let o=a.toString().split("\n");o=o.map((e=>e.trim().replace(/ +/g," "))),s.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=8){let t=e[3],i="",s=e[3].split(".");s.length>1&&(i=s[s.length-1],s.pop(),t=s.join("."));let a=e[4],l="",c=e[4].split(".");c.length>1&&(l=c[c.length-1],c.pop(),a=c.join("."));const u=n.indexOf(e[5])>=0;let p=u?e[5]:"UNKNOWN",f=parseInt(e[8+(u?0:-1)],10);p&&r.push({protocol:e[0],localAddress:t,localPort:i,peerAddress:a,peerPort:l,state:p,pid:f,process:An(o,f)})}})),e&&e(r),t(r)}))}))}if(tn){let n="netstat -nao";try{Kr(n,Jr.execOptsWin,(function(n,i){if(!n){i.toString().split("\r\n").forEach((function(e){if((e=e.trim().replace(/ +/g," ").split(" ")).length>=4){let t=e[1],n="",i=e[1].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":")),t=t.replace(/\[/g,"").replace(/\]/g,"");let s=e[2],a="",o=e[2].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":")),s=s.replace(/\[/g,"").replace(/\]/g,"");let l=Jr.toInt(e[4]),c=e[3];"HERGESTELLT"===c&&(c="ESTABLISHED"),c.startsWith("ABH")&&(c="LISTEN"),"SCHLIESSEN_WARTEN"===c&&(c="CLOSE_WAIT"),"WARTEND"===c&&(c="TIME_WAIT"),"SYN_GESENDET"===c&&(c="SYN_SENT"),"LISTENING"===c&&(c="LISTEN"),"SYN_RECEIVED"===c&&(c="SYN_RECV"),"FIN_WAIT_1"===c&&(c="FIN_WAIT1"),"FIN_WAIT_2"===c&&(c="FIN_WAIT2"),"udp"!==e[0].toLowerCase()&&c?r.push({protocol:e[0].toLowerCase(),localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:c,pid:l,process:""}):"udp"===e[0].toLowerCase()&&r.push({protocol:e[0].toLowerCase(),localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:"",pid:parseInt(e[3],10),process:""})}})),e&&e(r),t(r)}}))}catch(n){e&&e(r),t(r)}}}))}))},Xr.networkGatewayDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let r="";if(Zr||rn||nn||sn){let n="ip route get 1";try{Kr(n,{maxBuffer:2048e4},(function(n,i){if(n)e&&e(r),t(r);else{let n=i.toString().split("\n");let s=(n&&n[0]?n[0]:"").split(" via ");s&&s[1]&&(s=s[1].split(" "),r=s[0]),e&&e(r),t(r)}}))}catch(n){e&&e(r),t(r)}}if(en){let n="route -n get default";try{Kr(n,{maxBuffer:2048e4},(function(i,s){if(!i){const e=s.toString().split("\n").map((e=>e.trim()));r=Jr.getValue(e,"gateway")}r?(e&&e(r),t(r)):(n="netstat -rn | awk '/default/ {print $2}'",Kr(n,{maxBuffer:2048e4},(function(n,i){const s=i.toString().split("\n").map((e=>e.trim()));r=s.find((e=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))),e&&e(r),t(r)})))}))}catch(n){e&&e(r),t(r)}}if(tn)try{Kr("netstat -r",Jr.execOptsWin,(function(n,i){i.toString().split(zr.EOL).forEach((e=>{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const t=e.split(" ");t.length>=5&&t[t.length-3].indexOf(".")>-1&&(r=t[t.length-3])}})),r?(e&&e(r),t(r)):Jr.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then((n=>{let i=n.toString().split("\r\n");i.length>1&&!r&&(r=Jr.getValue(i,"NextHop"),e&&e(r),t(r))}))}))}catch(n){e&&e(r),t(r)}}))}))};var Nn={};const Dn=m.default,kn=y.default.exec,Mn=y.default.execSync,Rn=L;let Bn=process.platform;const Fn="linux"===Bn||"android"===Bn,Gn="darwin"===Bn,Wn="win32"===Bn;function Un(e){return parseFloat(e)/2-100}function $n(e){const t=2*(parseFloat(e)+100);return t<=100?t:100}const jn={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484,32:5160,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,50:5250,52:5260,54:5270,56:5280,58:5290,60:5300,62:5310,64:5320,68:5340,96:5480,100:5500,102:5510,104:5520,106:5530,108:5540,110:5550,112:5560,114:5570,116:5580,118:5590,120:5600,122:5610,124:5620,126:5630,128:5640,132:5660,134:5670,136:5680,138:5690,140:5700,142:5710,144:5720,149:5745,151:5755,153:5765,155:5775,157:5785,159:5795,161:5805,165:5825,169:5845,173:5865,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};function Hn(e){return{}.hasOwnProperty.call(jn,e)?jn[e]:null}function Xn(e){let t=0;for(let r in jn)({}).hasOwnProperty.call(jn,r)&&jn[r]===e&&(t=Rn.toInt(r));return t}function zn(){const e=[];try{const t=Mn("iw dev 2>/dev/null").toString().split("\n").map((e=>e.trim())).join("\n").split("\nInterface ");return t.shift(),t.forEach((t=>{const r=t.split("\n"),n=r[0],i=Rn.toInt(Rn.getValue(r,"ifindex"," ")),s=Rn.getValue(r,"addr"," "),a=Rn.toInt(Rn.getValue(r,"channel"," "));e.push({id:i,iface:n,mac:s,channel:a})})),e}catch(t){try{const t=Mn("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null").toString().split("\n\n");let r=1;return t.forEach((t=>{const n=t.split("\n"),i=Rn.getValue(n,"GENERAL.DEVICE"),s=Rn.getValue(n,"GENERAL.TYPE"),a=r++,o=Rn.getValue(n,"GENERAL.HWADDR");"wifi"===s.toLowerCase()&&e.push({id:a,iface:i,mac:o,channel:""})})),e}catch(e){return[]}}}function Kn(e){const t=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${e} 2>/dev/null`;try{const r=Mn(t).toString().split("\n"),n=Rn.getValue(r,"GENERAL.CONNECTION");return{iface:e,type:Rn.getValue(r,"GENERAL.TYPE"),vendor:Rn.getValue(r,"GENERAL.VENDOR"),product:Rn.getValue(r,"GENERAL.PRODUCT"),mac:Rn.getValue(r,"GENERAL.HWADDR").toLowerCase(),ssid:"--"!==n?n:null}}catch(e){return{}}}function Yn(){const e=[];try{const t=Mn("nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null",{maxBuffer:2048e4}).toString().split("ACTIVE:");return t.shift(),t.forEach((t=>{const r=(t="ACTIVE:"+t).split(Dn.EOL),n=Rn.getValue(r,"CHAN"),i=Rn.getValue(r,"FREQ").toLowerCase().replace("mhz","").trim(),s=Rn.getValue(r,"SECURITY").replace("(","").replace(")",""),a=Rn.getValue(r,"WPA-FLAGS").replace("(","").replace(")",""),o=Rn.getValue(r,"RSN-FLAGS").replace("(","").replace(")","");e.push({ssid:Rn.getValue(r,"SSID"),bssid:Rn.getValue(r,"BSSID").toLowerCase(),mode:Rn.getValue(r,"MODE"),channel:n?parseInt(n,10):null,frequency:i?parseInt(i,10):null,signalLevel:Un(Rn.getValue(r,"SIGNAL")),quality:parseFloat(Rn.getValue(r,"SIGNAL")),security:s&&"none"!==s?s.split(" "):[],wpaFlags:a&&"none"!==a?a.split(" "):[],rsnFlags:o&&"none"!==o?o.split(" "):[]})})),e}catch(e){return[]}}function qn(e){const t=[];try{let r=Mn(`export LC_ALL=C; iwlist ${e} scan 2>&1; unset LC_ALL`).toString().split(" Cell ");return r[0].indexOf("resource busy")>=0?-1:(r.length>1&&(r.shift(),r.forEach((e=>{const r=e.split("\n"),n=Rn.getValue(r,"channel",":",!0),i=r&&r.length&&r[0].indexOf("Address:")>=0?r[0].split("Address:")[1].trim().toLowerCase():"",s=Rn.getValue(r,"mode",":",!0),a=Rn.getValue(r,"frequency",":",!0),o=Rn.getValue(r,"Quality","=",!0).toLowerCase().split("signal level="),l=o.length>1?Rn.toInt(o[1]):0,c=l?$n(l):0,u=Rn.getValue(r,"essid",":",!0),p=e.indexOf(" WPA ")>=0,f=e.indexOf("WPA2 ")>=0,d=[];p&&d.push("WPA"),f&&d.push("WPA2");const m=[];let h="";r.forEach((function(e){const t=e.trim().toLowerCase();if(t.indexOf("group cipher")>=0){h&&m.push(h);const e=t.split(":");e.length>1&&(h=e[1].trim().toUpperCase())}if(t.indexOf("pairwise cipher")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("tkip")?h=h?"TKIP/"+h:"TKIP":e[1].indexOf("ccmp")?h=h?"CCMP/"+h:"CCMP":e[1].indexOf("proprietary")&&(h=h?"PROP/"+h:"PROP"))}if(t.indexOf("authentication suites")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("802.1x")?h=h?"802.1x/"+h:"802.1x":e[1].indexOf("psk")&&(h=h?"PSK/"+h:"PSK"))}})),h&&m.push(h),t.push({ssid:u,bssid:i,mode:s,channel:n?Rn.toInt(n):null,frequency:a?Rn.toInt(a.replace(".","")):null,signalLevel:l,quality:c,security:d,wpaFlags:m,rsnFlags:[]})}))),t)}catch(e){return-1}}Nn.wifiNetworks=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Fn)if(r=Yn(),0===r.length)try{const n=Mn("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL").toString().split("\n\n");let i="";if(n.forEach((e=>{-1===e.indexOf("no wireless")&&""!==e.trim()&&(i=e.split(" ")[0])})),i){let n="";const s=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(i,!0),a=Rn.mathMin(s.length,2e3);for(let e=0;e<=a;e++)void 0!==s[e]&&(n+=s[e]);const o=qn(n);-1===o?setTimeout((function(n){const i=qn(n);-1!=i&&(r=i),e&&e(r),t(r)}),4e3):(r=o,e&&e(r),t(r))}else e&&e(r),t(r)}catch(n){e&&e(r),t(r)}else e&&e(r),t(r);else if(Gn){kn("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x",{maxBuffer:4096e4},(function(n,i){const s=i.toString();r=function(e){const t=[];return e&&e.forEach((function(e){const r=e.RSSI;let n=[],i=[],s=e.SSID_STR||"";if(e.WPA_IE&&(n.push("WPA"),e.WPA_IE.IE_KEY_WPA_UCIPHERS&&e.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach((function(e){0===e&&-1===i.indexOf("unknown/TKIP")&&i.push("unknown/TKIP"),2===e&&-1===i.indexOf("PSK/TKIP")&&i.push("PSK/TKIP"),4===e&&-1===i.indexOf("PSK/AES")&&i.push("PSK/AES")}))),e.RSN_IE&&(n.push("WPA2"),e.RSN_IE.IE_KEY_RSN_UCIPHERS&&e.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach((function(e){0===e&&-1===i.indexOf("unknown/TKIP")&&i.push("unknown/TKIP"),2===e&&-1===i.indexOf("TKIP/TKIP")&&i.push("TKIP/TKIP"),4===e&&-1===i.indexOf("PSK/AES")&&i.push("PSK/AES")}))),e.SSID&&""===s)try{s=Buffer.from(e.SSID,"base64").toString("utf8")}catch(e){Rn.noop()}t.push({ssid:s,bssid:e.BSSID||"",mode:"",channel:e.CHANNEL,frequency:Hn(e.CHANNEL),signalLevel:r?parseInt(r,10):null,quality:$n(r),security:n,wpaFlags:i,rsnFlags:[]})})),t}(Rn.plistParser(s)),e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show networks mode=Bssid";Rn.powerShell(n).then((n=>{const i=n.toString("utf8").split(Dn.EOL+Dn.EOL+"SSID ");i.shift(),i.forEach((e=>{const t=e.split(Dn.EOL);if(t&&t.length>=8&&t[0].indexOf(":")>=0){const n=e.split(" BSSID");n.shift(),n.forEach((e=>{const n=e.split(Dn.EOL),i=n[0].split(":");i.shift();const s=i.join(":").trim().toLowerCase(),a=n[3].split(":").pop().trim(),o=n[1].split(":").pop().trim();r.push({ssid:t[0].split(":").pop().trim(),bssid:s,mode:"",channel:a?parseInt(a,10):null,frequency:Hn(a),signalLevel:Un(o),quality:o?parseInt(o,10):null,security:[t[2].split(":").pop().trim()],wpaFlags:[t[3].split(":").pop().trim()],rsnFlags:[]})}))}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))},Nn.wifiConnections=function(e){return new Promise((t=>{process.nextTick((()=>{const r=[];if(Fn){const n=zn(),i=Yn();n.forEach((e=>{let t="";const n=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(e.iface,!0),s=Rn.mathMin(n.length,2e3);for(let e=0;e<=s;e++)void 0!==n[e]&&(t+=n[e]);const a=Kn(t),o=function(e){if(!e)return{};const t=`wpa_cli -i ${e} status 2>&1`;try{const e=Mn(t).toString().split("\n"),r=Rn.toInt(Rn.getValue(e,"freq","="));return{ssid:Rn.getValue(e,"ssid","="),uuid:Rn.getValue(e,"uuid","="),security:Rn.getValue(e,"key_mgmt","="),freq:r,channel:Xn(r),bssid:Rn.getValue(e,"bssid","=").toLowerCase()}}catch(e){return{}}}(t),l=a.ssid||o.ssid,c=i.filter((e=>e.ssid===l));let u="";const p=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(l,!0),f=Rn.mathMin(p.length,2e3);for(let e=0;e<=f;e++)void 0!==p[e]&&(u+=p[e]);const d=function(e){const t=`nmcli -t --show-secrets connection show ${e} 2>/dev/null`;try{const r=Mn(t).toString().split("\n"),n=Rn.getValue(r,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:"--"!==e?e:null,uuid:Rn.getValue(r,"connection.uuid"),type:Rn.getValue(r,"connection.type"),autoconnect:"yes"===Rn.getValue(r,"connection.autoconnect"),security:Rn.getValue(r,"802-11-wireless-security.key-mgmt"),bssid:"--"!==n?n:null}}catch(e){return{}}}(u),m=c&&c.length&&c[0].channel?c[0].channel:o.channel?o.channel:null,h=c&&c.length&&c[0].bssid?c[0].bssid:o.bssid?o.bssid:null;l&&h&&r.push({id:e.id,iface:e.iface,model:a.product,ssid:l,bssid:c&&c.length&&c[0].bssid?c[0].bssid:o.bssid?o.bssid:null,channel:m,frequency:m?Hn(m):null,type:d.type?d.type:"802.11",security:d.security?d.security:o.security?o.security:null,signalLevel:c&&c.length&&c[0].signalLevel?c[0].signalLevel:null,txRate:null})})),e&&e(r),t(r)}else if(Gn){let n="system_profiler SPNetworkDataType";kn(n,(function(i,s){const a=s.toString().split("\n\n Wi-Fi:\n\n");if(a.length>1){const i=a[1].split("\n\n")[0].split("\n"),s=Rn.getValue(i,"BSD Device Name",":",!0),o=Rn.getValue(i,"hardware",":",!0);n="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I",kn(n,(function(n,a){const l=a.toString().split("\n");if(i.length>10){const e=Rn.getValue(l,"ssid",":",!0),t=Rn.getValue(l,"bssid",":",!0),n=Rn.getValue(l,"link auth",":",!0),i=Rn.getValue(l,"lastTxRate",":",!0),a=Rn.getValue(l,"channel",":",!0).split(",")[0],c="802.11",u=Rn.toInt(Rn.getValue(l,"agrCtlRSSI",":",!0))-Rn.toInt(Rn.getValue(l,"agrCtlNoise",":",!0));(e||t)&&r.push({id:"Wi-Fi",iface:s,model:o,ssid:e,bssid:t,channel:Rn.toInt(a),frequency:a?Hn(a):null,type:c,security:n,signalLevel:u,txRate:i})}e&&e(r),t(r)}))}else e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show interfaces";Rn.powerShell(n).then((function(n){const i=n.toString().split("\r\n");for(let e=0;e<i.length;e++)i[e]=i[e].trim();const s=i.join("\r\n").split(":\r\n\r\n");s.shift(),s.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",n=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",s=Rn.getValue(t,"SSID",":",!0),a=Rn.getValue(t,"BSSID",":",!0),o=Rn.getValue(t,"Signal",":",!0),l=Rn.getValue(t,"Radio type",":",!0)||Rn.getValue(t,"Type de radio",":",!0)||Rn.getValue(t,"Funktyp",":",!0)||null,c=Rn.getValue(t,"authentication",":",!0)||Rn.getValue(t,"Authentification",":",!0)||Rn.getValue(t,"Authentifizierung",":",!0)||null,u=Rn.getValue(t,"Channel",":",!0)||Rn.getValue(t,"Canal",":",!0)||Rn.getValue(t,"Kanal",":",!0)||null,p=Rn.getValue(t,"Transmit rate (mbps)",":",!0)||Rn.getValue(t,"Transmission (mbit/s)",":",!0)||Rn.getValue(t,"Empfangsrate (MBit/s)",":",!0)||null;n&&i&&s&&a&&r.push({id:i,iface:e,model:n,ssid:s,bssid:a,channel:Rn.toInt(u),frequency:u?Hn(u):null,type:l,security:c,signalLevel:o,txRate:Rn.toInt(p)||null})}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))},Nn.wifiInterfaces=function(e){return new Promise((t=>{process.nextTick((()=>{const r=[];if(Fn){zn().forEach((e=>{const t=Kn(e.iface);r.push({id:e.id,iface:e.iface,model:t.product?t.product:null,vendor:t.vendor?t.vendor:null,mac:e.mac})})),e&&e(r),t(r)}else if(Gn){kn("system_profiler SPNetworkDataType",(function(n,i){const s=i.toString().split("\n\n Wi-Fi:\n\n");if(s.length>1){const e=s[1].split("\n\n")[0].split("\n"),t=Rn.getValue(e,"BSD Device Name",":",!0),n=Rn.getValue(e,"MAC Address",":",!0),i=Rn.getValue(e,"hardware",":",!0);r.push({id:"Wi-Fi",iface:t,model:i,vendor:"",mac:n})}e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show interfaces";Rn.powerShell(n).then((function(n){const i=n.toString().split("\r\n");for(let e=0;e<i.length;e++)i[e]=i[e].trim();const s=i.join("\r\n").split(":\r\n\r\n");s.shift(),s.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",n=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",s=t[3].indexOf(":")>=0?t[3].split(":"):[];s.shift();const a=s.join(":").trim(),o=function(e){let t="";return(e=e.toLowerCase()).indexOf("intel")>=0?t="Intel":e.indexOf("realtek")>=0?t="Realtek":e.indexOf("qualcom")>=0?t="Qualcom":e.indexOf("broadcom")>=0?t="Broadcom":e.indexOf("cavium")>=0?t="Cavium":e.indexOf("cisco")>=0?t="Cisco":e.indexOf("marvel")>=0?t="Marvel":e.indexOf("zyxel")>=0?t="Zyxel":e.indexOf("melanox")>=0?t="Melanox":e.indexOf("d-link")>=0?t="D-Link":e.indexOf("tp-link")>=0?t="TP-Link":e.indexOf("asus")>=0?t="Asus":e.indexOf("linksys")>=0&&(t="Linksys"),t}(n);e&&n&&i&&a&&r.push({id:i,iface:e,model:n,vendor:o,mac:a})}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))};var Jn={};const Qn=m.default,Zn=h.default,ei=g.default,ti=y.default.exec,ri=y.default.execSync,ni=L;let ii=process.platform;const si="linux"===ii||"android"===ii,ai="darwin"===ii,oi="win32"===ii,li="freebsd"===ii,ci="openbsd"===ii,ui="netbsd"===ii,pi="sunos"===ii,fi={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},di={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},mi={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},hi={0:"unknown",1:"other",2:"ready",3:"running",4:"blocked",5:"suspended blocked",6:"suspended ready",7:"terminated",8:"stopped",9:"growing"};function gi(e){let t=e.replace(/ +/g," ").split(" ");return(t.length>=2?parseInt(t[1]):0)+(t.length>=3?parseInt(t[2]):0)+(t.length>=4?parseInt(t[3]):0)+(t.length>=5?parseInt(t[4]):0)+(t.length>=6?parseInt(t[5]):0)+(t.length>=7?parseInt(t[6]):0)+(t.length>=8?parseInt(t[7]):0)+(t.length>=9?parseInt(t[8]):0)+(t.length>=10?parseInt(t[9]):0)+(t.length>=11?parseInt(t[10]):0)}function yi(e,t,r){let n=e.replace(/ +/g," ").split(")");if(n.length>=2){let e=n[1].split(" ");if(e.length>=16){let i=parseInt(n[0].split(" ")[0]),s=parseInt(e[12]),a=parseInt(e[13]),o=parseInt(e[14]),l=parseInt(e[15]),c=0,u=0;return r.all>0&&r.list[i]?(c=(s+o-r.list[i].utime-r.list[i].cutime)/(t-r.all)*100,u=(a+l-r.list[i].stime-r.list[i].cstime)/(t-r.all)*100):(c=(s+o)/t*100,u=(a+l)/t*100),{pid:i,utime:s,stime:a,cutime:o,cstime:l,cpuu:c,cpus:u}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}function vi(e,t,r){let n=0,i=0;return r.all>0&&r.list[e.pid]?(n=(e.utime-r.list[e.pid].utime)/(t-r.all)*100,i=(e.stime-r.list[e.pid].stime)/(t-r.all)*100):(n=e.utime/t*100,i=e.stime/t*100),{pid:e.pid,utime:e.utime,stime:e.stime,cpuu:n>0?n:0,cpus:i>0?i:0}}Jn.services=function(e,t){return ni.isFunction(e)&&!t&&(t=e,e=""),new Promise((r=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t([]),r([]);if(e){let n="";n.__proto__.toLowerCase=ni.stringToLower,n.__proto__.replace=ni.stringReplace,n.__proto__.trim=ni.stringTrim;const i=ni.sanitizeShellString(e),s=ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)void 0!==i[e]&&(n+=i[e]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===n&&(n="*"),ni.isPrototypePolluted()&&"*"!==n&&(n="------");let a=n.split("|"),o=[],l=[];if(si||li||ci||ui||ai){if((si||li||ci||ui)&&"*"===n)try{const e=ri("systemctl --all --type=service --no-legend 2> /dev/null").toString().split("\n");a=[];for(const t of e){const e=t.split(".service")[0];e&&-1===t.indexOf(" not-found ")&&a.push(e.trim())}n=a.join("|")}catch(e){try{n="";const e=ri("service --status-all 2> /dev/null").toString().split("\n");for(const t of e){const e=t.split("]");2===e.length&&(n+=(""!==n?"|":"")+e[1].trim())}a=n.split("|")}catch(e){try{const e=ri("ls /etc/init.d/ -m 2> /dev/null").toString().split("\n").join("");if(n="",e){const t=e.split(",");for(const e of t){const t=e.trim();t&&(n+=(""!==n?"|":"")+t)}a=n.split("|")}}catch(e){n="",a=[]}}}ai&&"*"===n&&(t&&t(o),r(o));let e=ai?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];""!==n&&a.length>0?ni.execSafe("ps",e).then((n=>{if(n){let e=n.replace(/ +/g," ").replace(/,+/g,".").split("\n");if(a.forEach((function(t){let r;r=ai?e.filter((function(e){return-1!==e.toLowerCase().indexOf(t)})):e.filter((function(e){return-1!==e.toLowerCase().indexOf(" "+t.toLowerCase()+":")||-1!==e.toLowerCase().indexOf("/"+t.toLowerCase())}));const n=[];for(const e of r){const t=e.trim().split(" ")[2];t&&n.push(parseInt(t,10))}o.push({name:t,running:r.length>0,startmode:"",pids:n,cpu:parseFloat(r.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[0])}),0).toFixed(2)),mem:parseFloat(r.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[1])}),0).toFixed(2))})})),si){let e='cat /proc/stat | grep "cpu "';for(let t in o)for(let r in o[t].pids)e+=";cat /proc/"+o[t].pids[r]+"/stat";ti(e,{maxBuffer:2048e4},(function(e,n){let i=n.toString().split("\n"),s=gi(i.shift()),a={},l={};i.forEach((e=>{if(l=yi(e,s,di),l.pid){let e=-1;for(let t in o)for(let r in o[t].pids)parseInt(o[t].pids[r])===parseInt(l.pid)&&(e=t);e>=0&&(o[e].cpu+=l.cpuu+l.cpus),a[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),di.all=s,di.list=Object.assign({},a),di.ms=Date.now()-di.ms,di.result=Object.assign({},o),t&&t(o),r(o)}))}else t&&t(o),r(o)}else e=["-o","comm"],ni.execSafe("ps",e).then((e=>{if(e){let n=e.replace(/ +/g," ").replace(/,+/g,".").split("\n");a.forEach((function(e){let t=n.filter((function(t){return-1!==t.indexOf(e)}));o.push({name:e,running:t.length>0,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o)}else a.forEach((function(e){o.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o)}))})):(t&&t(o),r(o))}if(oi)try{let e="Get-CimInstance Win32_Service";"*"!==a[0]&&(e+=' -Filter "',a.forEach((t=>{e+=`Name='${t}' or `})),e=`${e.slice(0,-4)}"`),e+=" | select Name,Caption,Started,StartMode,ProcessId | fl",ni.powerShell(e).then(((e,i)=>{if(i)a.forEach((function(e){o.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o);else{if(e.split(/\n\s*\n/).forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=ni.getValue(t,"Name",":",!0).toLowerCase(),i=ni.getValue(t,"Caption",":",!0).toLowerCase(),s=ni.getValue(t,"Started",":",!0),c=ni.getValue(t,"StartMode",":",!0),u=ni.getValue(t,"ProcessId",":",!0);("*"===n||a.indexOf(r)>=0||a.indexOf(i)>=0)&&(o.push({name:r,running:"true"===s.toLowerCase(),startmode:c,pids:[u],cpu:0,mem:0}),l.push(r),l.push(i))}})),"*"!==n){a.filter((function(e){return-1===l.indexOf(e)})).forEach((function(e){o.push({name:e,running:!1,startmode:"",pids:[],cpu:0,mem:0})}))}t&&t(o),r(o)}}))}catch(e){t&&t(o),r(o)}}else t&&t([]),r([])}))}))},Jn.processes=function(e){let t=[];function r(e){let t=(e=e||"").split(" ")[0];if(":"===t.substr(-1)&&(t=t.substr(0,t.length-1)),"["!==t.substr(0,1)){let e=t.split("/");t=isNaN(parseInt(e[e.length-1]))?e[e.length-1]:e[0]}return t}function n(e){let n=0,i=0;function s(r){n=i,i=t[r]?e.substring(t[r].to+n,1e4).indexOf(" "):1e4}s(0);const a=parseInt(e.substring(t[0].from+n,t[0].to+i));s(1);const o=parseInt(e.substring(t[1].from+n,t[1].to+i));s(2);const l=parseFloat(e.substring(t[2].from+n,t[2].to+i).replace(/,/g,"."));s(3);const c=parseFloat(e.substring(t[3].from+n,t[3].to+i).replace(/,/g,"."));s(4);const u=parseInt(e.substring(t[4].from+n,t[4].to+i));s(5);const p=parseInt(e.substring(t[5].from+n,t[5].to+i));s(6);const f=parseInt(e.substring(t[6].from+n,t[6].to+i));s(7);const d=parseInt(e.substring(t[7].from+n,t[7].to+i))||0;s(8);const m=pi?function(e){let t=e,r=e.replace(/ +/g," ").split(" ");return 5===r.length&&(t=r[4]+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(r[1].toUpperCase())/3+1)).slice(-2)+"-"+("0"+r[2]).slice(-2)+" "+r[3]),t}(e.substring(t[8].from+n,t[8].to+i).trim()):function(e){let t=new Date;t=new Date(t.getTime()-6e4*t.getTimezoneOffset());const r=e.split("-"),n=r.length-1,i=n>0?parseInt(r[n-1]):0,s=r[n].split(":"),a=1e3*(60*(60*(24*i+(3===s.length?parseInt(s[0]||0):0))+parseInt(s[3===s.length?1:0]||0))+parseInt(s[3===s.length?2:1]||0));let o=new Date(t.getTime()),l=o.toISOString().substring(0,10)+" "+o.toISOString().substring(11,19);try{o=new Date(t.getTime()-a),l=o.toISOString().substring(0,10)+" "+o.toISOString().substring(11,19)}catch(e){ni.noop()}return l}(e.substring(t[8].from+n,t[8].to+i).trim());s(9);let h=e.substring(t[9].from+n,t[9].to+i).trim();h="R"===h[0]?"running":"S"===h[0]?"sleeping":"T"===h[0]?"stopped":"W"===h[0]?"paging":"X"===h[0]?"dead":"Z"===h[0]?"zombie":"D"===h[0]||"U"===h[0]?"blocked":"unknown",s(10);let g=e.substring(t[10].from+n,t[10].to+i).trim();"?"!==g&&"??"!==g||(g=""),s(11);const y=e.substring(t[11].from+n,t[11].to+i).trim();s(12);let v="",S="",w="",x=e.substring(t[12].from+n,t[12].to+i).trim();if("]"===x.substr(x.length-1)&&(x=x.slice(0,-1)),"["===x.substr(0,1))S=x.substring(1);else{const e=x.indexOf("("),t=x.indexOf(")"),r=x.indexOf("/"),n=x.indexOf(":");if(e<t&&e<r&&r<t)S=x.split(" ")[0],S=S.replace(/:/g,"");else if(n>0&&(-1===r||r>3))S=x.split(" ")[0],S=S.replace(/:/g,"");else{let e=x.indexOf(" -"),t=x.indexOf(" /");e=e>=0?e:1e4,t=t>=0?t:1e4;const r=Math.min(e,t);let n=x.substr(0,r);const i=x.substr(r),s=n.lastIndexOf("/");if(s>=0&&(v=n.substr(0,s),n=n.substr(s+1)),1e4===r&&n.indexOf(" ")>-1){const e=n.split(" ");Zn.existsSync(ei.join(v,e[0]))?(S=e.shift(),w=(e.join(" ")+" "+i).trim()):(S=n.trim(),w=i.trim())}else S=n.trim(),w=i.trim()}}return{pid:a,parentPid:o,name:si?r(S):S,cpu:l,cpuu:0,cpus:0,mem:c,priority:u,memVsz:p,memRss:f,nice:d,started:m,state:h,tty:g,user:y,command:S,params:w,path:v}}function i(e){function t(e){const t=("0"+(e.getMonth()+1).toString()).slice(-2);return e.getFullYear().toString()+"-"+t+"-"+("0"+e.getDate().toString()).slice(-2)+" "+("0"+e.getHours().toString()).slice(-2)+":"+("0"+e.getMinutes().toString()).slice(-2)+":"+("0"+e.getSeconds().toString()).slice(-2)}let n=[];return e.forEach((function(e){if(""!==e.trim()){const i=(e=e.trim().replace(/ +/g," ").replace(/,+/g,".")).split(" "),s=i.slice(9).join(" "),a=parseFloat((1*parseInt(i[3])*1024/Qn.totalmem()).toFixed(1)),o=function(e){let r="";if(e.indexOf("d")>=0){const n=e.split("d");r=t(new Date(Date.now()-60*(24*n[0]+1*n[1])*60*1e3))}else if(e.indexOf("h")>=0){const n=e.split("h");r=t(new Date(Date.now()-60*(60*n[0]+1*n[1])*1e3))}else if(e.indexOf(":")>=0){const n=e.split(":");r=t(new Date(Date.now()-(n.length>1?1e3*(60*n[0]+n[1]):1e3*n[0])))}return r}(i[5]);n.push({pid:parseInt(i[0]),parentPid:parseInt(i[1]),name:r(s),cpu:0,cpuu:0,cpus:0,mem:a,priority:0,memVsz:parseInt(i[2]),memRss:parseInt(i[3]),nice:parseInt(i[4]),started:o,state:"R"===i[6]?"running":"S"===i[6]?"sleeping":"T"===i[6]?"stopped":"W"===i[6]?"paging":"X"===i[6]?"dead":"Z"===i[6]?"zombie":"D"===i[6]||"U"===i[6]?"blocked":"unknown",tty:i[7],user:i[8],command:s})}})),n}return new Promise((r=>{process.nextTick((()=>{let s={all:0,running:0,blocked:0,sleeping:0,unknown:0,list:[]},a="";if(fi.ms&&Date.now()-fi.ms>=500||0===fi.ms)if(si||li||ci||ui||ai||pi)si&&(a="export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"),(li||ci||ui)&&(a="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"),ai&&(a="ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"),pi&&(a="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),ti(a,{maxBuffer:2048e4},(function(o,l){!o&&l.toString().trim()?(s.list=function(e){let r=[];if(e.length>1){let i=e[0];t=ni.parseHead(i,8),e.shift(),e.forEach((function(e){""!==e.trim()&&r.push(n(e))}))}return r}(l.toString().split("\n")).slice(),s.all=s.list.length,s.running=s.list.filter((function(e){return"running"===e.state})).length,s.blocked=s.list.filter((function(e){return"blocked"===e.state})).length,s.sleeping=s.list.filter((function(e){return"sleeping"===e.state})).length,si?(a='cat /proc/stat | grep "cpu "',s.list.forEach((e=>{a+=";cat /proc/"+e.pid+"/stat"})),ti(a,{maxBuffer:2048e4},(function(t,n){let i=n.toString().split("\n"),a=gi(i.shift()),o={},l={};i.forEach((e=>{if(l=yi(e,a,fi),l.pid){let e=s.list.map((function(e){return e.pid})).indexOf(l.pid);e>=0&&(s.list[e].cpu=l.cpuu+l.cpus,s.list[e].cpuu=l.cpuu,s.list[e].cpus=l.cpus),o[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),fi.all=a,fi.list=Object.assign({},o),fi.ms=Date.now()-fi.ms,fi.result=Object.assign({},s),e&&e(s),r(s)}))):(e&&e(s),r(s))):(a="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",pi&&(a="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),ti(a,{maxBuffer:2048e4},(function(t,n){if(t)e&&e(s),r(s);else{let t=n.toString().split("\n");t.shift(),s.list=i(t).slice(),s.all=s.list.length,s.running=s.list.filter((function(e){return"running"===e.state})).length,s.blocked=s.list.filter((function(e){return"blocked"===e.state})).length,s.sleeping=s.list.filter((function(e){return"sleeping"===e.state})).length,e&&e(s),r(s)}})))}));else if(oi)try{ni.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then(((t,n)=>{if(!n){let e=t.split(/\n\s*\n/),r=[],n=[],i={},a=0,o=0;e.forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),i=parseInt(ni.getValue(t,"ProcessId",":",!0),10),l=parseInt(ni.getValue(t,"ParentProcessId",":",!0),10),c=ni.getValue(t,"ExecutionState",":"),u=ni.getValue(t,"Caption",":",!0),p=ni.getValue(t,"CommandLine",":",!0),f=!1;t.forEach((e=>{f&&e.toLowerCase().startsWith(" ")?p+=" "+e.trim():f=!1,e.toLowerCase().startsWith("commandline")&&(f=!0)}));let d=ni.getValue(t,"ExecutablePath",":",!0),m=parseInt(ni.getValue(t,"UserModeTime",":",!0),10),h=parseInt(ni.getValue(t,"KernelModeTime",":",!0),10),g=parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10);a+=m,o+=h,s.all++,c||s.unknown++,"3"===c&&s.running++,"4"!==c&&"5"!==c||s.blocked++,n.push({pid:i,utime:m,stime:h,cpu:0,cpuu:0,cpus:0}),r.push({pid:i,parentPid:l,name:u,cpu:0,cpuu:0,cpus:0,mem:g/Qn.totalmem()*100,priority:parseInt(ni.getValue(t,"Priority",":",!0),10),memVsz:parseInt(ni.getValue(t,"PageFileUsage",":",!0),10),memRss:Math.floor(parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10)/1024),nice:0,started:ni.getValue(t,"CreationDate",":",!0),state:c?hi[c]:hi[0],tty:"",user:"",command:p||u,path:d,params:""})}})),s.sleeping=s.all-s.running-s.blocked-s.unknown,s.list=r,n.forEach((e=>{let t=vi(e,a+o,fi),r=s.list.map((function(e){return e.pid})).indexOf(t.pid);r>=0&&(s.list[r].cpu=t.cpuu+t.cpus,s.list[r].cpuu=t.cpuu,s.list[r].cpus=t.cpus),i[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}})),fi.all=a+o,fi.all_utime=a,fi.all_stime=o,fi.list=Object.assign({},i),fi.ms=Date.now()-fi.ms,fi.result=Object.assign({},s)}e&&e(s),r(s)}))}catch(t){e&&e(s),r(s)}else e&&e(s),r(s);else e&&e(fi.result),r(fi.result)}))}))},Jn.processLoad=function(e,t){return ni.isFunction(e)&&!t&&(t=e,e=""),new Promise((r=>{process.nextTick((()=>{if("string"!=typeof(e=e||""))return t&&t([]),r([]);let n="";n.__proto__.toLowerCase=ni.stringToLower,n.__proto__.replace=ni.stringReplace,n.__proto__.trim=ni.stringTrim;const i=ni.sanitizeShellString(e),s=ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)void 0!==i[e]&&(n+=i[e]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===n&&(n="*"),ni.isPrototypePolluted()&&"*"!==n&&(n="------");let a=n.split("|"),o=[];if((ni.isPrototypePolluted()?"":ni.sanitizeShellString(e))&&a.length&&"------"!==a[0]){if(oi)try{ni.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then(((e,i)=>{if(!i){let i=e.split(/\n\s*\n/),s=[],l={},c=0,u=0;if(i.forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=parseInt(ni.getValue(t,"ProcessId",":",!0),10),i=ni.getValue(t,"Caption",":",!0),l=parseInt(ni.getValue(t,"UserModeTime",":",!0),10),p=parseInt(ni.getValue(t,"KernelModeTime",":",!0),10),f=parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10);c+=l,u+=p,s.push({pid:r,name:i,utime:l,stime:p,cpu:0,cpuu:0,cpus:0,mem:f});let d="",m=!1;if(a.forEach((function(e){i.toLowerCase().indexOf(e.toLowerCase())>=0&&!m&&(m=!0,d=e)})),"*"===n||m){let e=!1;o.forEach((function(t){t.proc.toLowerCase()===d.toLowerCase()&&(t.pids.push(r),t.mem+=f/Qn.totalmem()*100,e=!0)})),e||o.push({proc:d,pid:r,pids:[r],cpu:0,mem:f/Qn.totalmem()*100})}}})),"*"!==n){let e=a.filter((function(e){return 0===s.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length}));e.forEach((function(e){o.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}s.forEach((e=>{let t=vi(e,c+u,mi),r=-1;for(let e=0;e<o.length;e++)(o[e].pid===t.pid||o[e].pids.indexOf(t.pid)>=0)&&(r=e);r>=0&&(o[r].cpu+=t.cpuu+t.cpus),l[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}})),mi.all=c+u,mi.all_utime=c,mi.all_stime=u,mi.list=Object.assign({},l),mi.ms=Date.now()-mi.ms,mi.result=JSON.parse(JSON.stringify(o)),t&&t(o),r(o)}}))}catch(e){t&&t(o),r(o)}if(ai||si||li||ci||ui){const e=["-axo","pid,ppid,pcpu,pmem,comm"];ni.execSafe("ps",e).then((e=>{if(e){let i=[];if(e.toString().split("\n").filter((function(e){if("*"===n)return!0;if(-1!==e.toLowerCase().indexOf("grep"))return!1;let t=!1;return a.forEach((function(r){t=t||e.toLowerCase().indexOf(r.toLowerCase())>=0})),t})).forEach((function(e){let t=e.trim().replace(/ +/g," ").split(" ");t.length>4&&i.push({name:t[4].substring(t[4].lastIndexOf("/")+1),pid:parseInt(t[0])||0,ppid:parseInt(t[1])||0,cpu:parseFloat(t[2].replace(",",".")),mem:parseFloat(t[3].replace(",","."))})})),i.forEach((function(e){let t=-1,r=!1,i="";for(let r=0;r<o.length;r++)e.name.toLowerCase().indexOf(o[r].proc.toLowerCase())>=0&&(t=r);a.forEach((function(t){e.name.toLowerCase().indexOf(t.toLowerCase())>=0&&!r&&(r=!0,i=t)})),("*"===n||r)&&(t<0?o.push({proc:i,pid:e.pid,pids:[e.pid],cpu:e.cpu,mem:e.mem}):(e.ppid<10&&(o[t].pid=e.pid),o[t].pids.push(e.pid),o[t].cpu+=e.cpu,o[t].mem+=e.mem))})),"*"!==n){let e=a.filter((function(e){return 0===i.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length}));e.forEach((function(e){o.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}if(si){o.forEach((function(e){e.cpu=0}));let e='cat /proc/stat | grep "cpu "';for(let t in o)for(let r in o[t].pids)e+=";cat /proc/"+o[t].pids[r]+"/stat";ti(e,{maxBuffer:2048e4},(function(e,n){let i=n.toString().split("\n"),s=gi(i.shift()),a={},l={};i.forEach((e=>{if(l=yi(e,s,mi),l.pid){let e=-1;for(let t in o)o[t].pids.indexOf(l.pid)>=0&&(e=t);e>=0&&(o[e].cpu+=l.cpuu+l.cpus),a[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),o.forEach((function(e){e.cpu=Math.round(100*e.cpu)/100})),mi.all=s,mi.list=Object.assign({},a),mi.ms=Date.now()-mi.ms,mi.result=Object.assign({},o),t&&t(o),r(o)}))}else t&&t(o),r(o)}else t&&t(o),r(o)}))}}}))}))};var Si={};const wi=y.default.exec,xi=L;let Ci=process.platform;const Oi="linux"===Ci||"android"===Ci,Ii="darwin"===Ci,bi="win32"===Ci,Ei="freebsd"===Ci,Li="openbsd"===Ci,_i="netbsd"===Ci,Pi="sunos"===Ci;function Ti(e,t){let r=[],n=[],i={},s=!0,a=[],o=[],l={},c=!0;return e.forEach((function(e){if("---"===e)c=!1;else{let t=e.replace(/ +/g," ").split(" ");c?n.push({user:t[0],tty:t[1],date:t[2],time:t[3],ip:t&&t.length>4?t[4].replace(/\(/g,"").replace(/\)/g,""):""}):s?(a=t,a.forEach((function(t){o.push(e.indexOf(t))})),s=!1):(i.user=e.substring(o[0],o[1]-1).trim(),i.tty=e.substring(o[1],o[2]-1).trim(),i.ip=e.substring(o[2],o[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=e.substring(o[7],1e3).trim(),l=n.filter((function(e){return e.user.substring(0,8).trim()===i.user&&e.tty===i.tty})),1===l.length&&r.push({user:l[0].user,tty:l[0].tty,date:l[0].date,time:l[0].time,ip:l[0].ip,command:i.command}))}})),0===r.length&&2===t?n:r}function Vi(e){let t=[],r=[],n={},i={},s=!0;return e.forEach((function(e){if("---"===e)s=!1;else{let a=e.replace(/ +/g," ").split(" ");s?r.push({user:a[0],tty:a[1],date:(new Date).getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2),time:a[4]}):(n.user=a[0],n.tty=a[1],n.ip="-"!==a[2]?a[2]:"",n.command=a.slice(5,1e3).join(" "),i=r.filter((function(e){return e.user===n.user&&(e.tty.substring(3,1e3)===n.tty||e.tty===n.tty)})),1===i.length&&t.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:n.ip,command:n.command}))}})),t}Si.users=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Oi&&wi('who --ips; echo "---"; w | tail -n +2',(function(n,i){if(n)e&&e(r),t(r);else{let n=i.toString().split("\n");r=Ti(n,1),0===r.length?wi('who; echo "---"; w | tail -n +2',(function(i,s){i||(n=s.toString().split("\n"),r=Ti(n,2)),e&&e(r),t(r)})):(e&&e(r),t(r))}})),(Ei||Li||_i)&&wi('who; echo "---"; w -ih',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),Pi&&wi('who; echo "---"; w -h',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),Ii&&wi('who; echo "---"; w -ih',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),bi)try{let n='Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo \'#-#-#-#\';';n+="Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';",n+="$process = (Get-CimInstance Win32_Process -Filter \"name = 'explorer.exe'\"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';",n+="query user",xi.powerShell(n).then((n=>{if(n){let e=function(e){const t={};return e.forEach((e=>{const r=e.split("\r\n"),n=xi.getValue(r,"LogonId"),i=xi.getValue(r,"starttime");n&&(t[n]=i)})),t}(((n=n.split("#-#-#-#"))[0]||"").split(/\n\s*\n/)),t=function(e){const t={};return e.forEach((e=>{const r=e.split("\r\n");let n=xi.getValue(r,"antecedent",":",!0).split("=");const i=n.length>2?n[1].split(",")[0].replace(/"/g,"").trim():"",s=n.length>2?n[2].replace(/"/g,"").replace(/\)/g,"").trim():"";n=xi.getValue(r,"dependent",":",!0).split("=");const a=n.length>1?n[1].replace(/"/g,"").replace(/\)/g,"").trim():"";a&&(t[a]={domain:s,user:i})})),t}((n[1]||"").split(/\n\s*\n/)),i=function(e){e=e.filter((e=>e));let t=[];const r=e[0],n=[];if(r){const i=" "===r[0]?1:0;n.push(i-1);let s=0;for(let e=i+1;e<r.length;e++)" "!==r[e]||" "!==r[e-1]&&"."!==r[e-1]?s&&(n.push(s),s=0):s=e;for(let r=1;r<e.length;r++)if(e[r].trim()){const i=e[r].substring(n[0]+1,n[1]).trim()||"",s=e[r].substring(n[1]+1,n[2]-2).trim()||"";t.push({user:i,tty:s})}}return t}((n[3]||"").split("\r\n")),s=function(e,t){const r=[];return e.forEach((e=>{const n=e.split("\r\n"),i=xi.getValue(n,"domain",":",!0),s=xi.getValue(n,"user",":",!0),a=xi.getValue(n,"sessionid",":",!0);if(s){const e=t.filter((e=>function(e,t){e=e.toLowerCase(),t=t.toLowerCase();let r=0,n=e.length;t.length>n&&(n=t.length);for(let i=0;i<n;i++){(e[i]||"")===(t[i]||"")&&r++}return n>10?r/n>.9:n>0&&r/n>.8}(e.user,s)));r.push({domain:i,user:s,tty:e&&e[0]&&e[0].tty?e[0].tty:a})}})),r}((n[2]||"").split(/\n\s*\n/),i);for(let r in t)({}).hasOwnProperty.call(t,r)&&(t[r].dateTime={}.hasOwnProperty.call(e,r)?e[r]:"");s.forEach((e=>{let n="";for(let r in t)({}).hasOwnProperty.call(t,r)&&t[r].user===e.user&&(!n||n<t[r].dateTime)&&(n=t[r].dateTime);r.push({user:e.user,tty:e.tty,date:`${n.substring(0,10)}`,time:`${n.substring(11,19)}`,ip:"",command:""})}))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))};var Ai={};const Ni=L;let Di=process.platform;const ki="linux"===Di||"android"===Di,Mi="darwin"===Di,Ri="win32"===Di,Bi="freebsd"===Di,Fi="openbsd"===Di,Gi="netbsd"===Di,Wi="sunos"===Di;Ai.inetChecksite=function(e,t){return new Promise((r=>{process.nextTick((()=>{let n={url:e,ok:!1,status:404,ms:null};if("string"!=typeof e)return t&&t(n),r(n);let i="";const s=Ni.sanitizeShellString(e,!0),a=Ni.mathMin(s.length,2e3);for(let e=0;e<=a;e++)if(void 0!==s[e]){s[e].__proto__.toLowerCase=Ni.stringToLower;const t=s[e].toLowerCase();t&&t[0]&&!t[1]&&1===t[0].length&&(i+=t[0])}n.url=i;try{if(i&&!Ni.isPrototypePolluted()){if(i.__proto__.startsWith=Ni.stringStartWith,i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return t&&t(n),r(n);let e=Date.now();if(ki||Bi||Fi||Gi||Mi||Wi){let s=["-I","--connect-timeout","5","-m","5"];s.push(i);let a="curl";Ni.execSafe(a,s).then((i=>{const s=i.split("\n");let a=s[0]&&s[0].indexOf(" ")>=0?parseInt(s[0].split(" ")[1],10):404;n.status=a||404,n.ok=200===a||301===a||302===a||304===a,n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)}))}if(Ri){const s=i.startsWith("https:")?require("https"):require("http");try{s.get(i,(i=>{const s=i.statusCode;n.status=s||404,n.ok=200===s||301===s||302===s||304===s,200!==s?(i.resume(),n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)):(i.on("data",(()=>{})),i.on("end",(()=>{n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)})))})).on("error",(()=>{t&&t(n),r(n)}))}catch(e){t&&t(n),r(n)}}}else t&&t(n),r(n)}catch(e){t&&t(n),r(n)}}))}))},Ai.inetLatency=function(e,t){return Ni.isFunction(e)&&!t&&(t=e,e=""),e=e||"8.8.8.8",new Promise((r=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t(null),r(null);let n="";const i=(Ni.isPrototypePolluted()?"8.8.8.8":Ni.sanitizeShellString(e,!0)).trim(),s=Ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)if(void 0!==i[e]){i[e].__proto__.toLowerCase=Ni.stringToLower;const t=i[e].toLowerCase();t&&t[0]&&!t[1]&&(n+=t[0])}if(n.__proto__.startsWith=Ni.stringStartWith,n.startsWith("file:")||n.startsWith("gopher:")||n.startsWith("telnet:")||n.startsWith("mailto:")||n.startsWith("news:")||n.startsWith("nntp:"))return t&&t(null),r(null);let a;if((ki||Bi||Fi||Gi||Mi)&&(ki&&(a=["-c","2","-w","3",n]),(Bi||Fi||Gi)&&(a=["-c","2","-t","3",n]),Mi&&(a=["-c2","-t3",n]),Ni.execSafe("ping",a).then((e=>{let n=null;if(e){const t=e.split("\n").filter((e=>e.indexOf("rtt")>=0||e.indexOf("round-trip")>=0||e.indexOf("avg")>=0)).join("\n"),r=t.split("=");if(r.length>1){const e=r[1].split("/");e.length>1&&(n=parseFloat(e[1]))}}t&&t(n),r(n)}))),Wi){const e=["-s","-a",n,"56","2"],i="avg";Ni.execSafe("ping",e,{timeout:3e3}).then((e=>{let n=null;if(e){const t=e.split("\n").filter((e=>e.indexOf(i)>=0)).join("\n"),r=t.split("=");if(r.length>1){const e=r[1].split("/");e.length>1&&(n=parseFloat(e[1].replace(",",".")))}}t&&t(n),r(n)}))}if(Ri){let e=null;try{const i=[n,"-n","1"];Ni.execSafe("ping",i,Ni.execOptsWin).then((n=>{if(n){let t=n.split("\r\n");t.shift(),t.forEach((function(t){if(3===(t.toLowerCase().match(/ms/g)||[]).length){let r=t.replace(/ +/g," ").split(" ");r.length>6&&(e=parseFloat(r[r.length-1]))}}))}t&&t(e),r(e)}))}catch(n){t&&t(e),r(e)}}}))}))};var Ui={};const $i=S.default,ji="Windows_NT"===m.default.type()?"//./pipe/docker_engine":"/var/run/docker.sock";const Hi=L,Xi=class{getInfo(e){try{let t,r=$i.createConnection({path:ji}),n="";r.on("connect",(()=>{r.write("GET http:/info HTTP/1.0\r\n\r\n")})),r.on("data",(e=>{n+=e.toString()})),r.on("error",(()=>{r=!1,e({})})),r.on("end",(()=>{let i=n.indexOf("\r\n\r\n");n=n.substring(i+4),r=!1;try{t=JSON.parse(n),e(t)}catch(t){e({})}}))}catch(t){e({})}}listImages(e,t){try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/images/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}}inspectImage(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/images/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}listContainers(e,t){try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}}getStats(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/stats?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}getInspect(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}getProcesses(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}listVolumes(e){try{let t,r=$i.createConnection({path:ji}),n="";r.on("connect",(()=>{r.write("GET http:/volumes HTTP/1.0\r\n\r\n")})),r.on("data",(e=>{n+=e.toString()})),r.on("error",(()=>{r=!1,e({})})),r.on("end",(()=>{let i=n.indexOf("\r\n\r\n");n=n.substring(i+4),r=!1;try{t=JSON.parse(n),e(t)}catch(t){e({})}}))}catch(t){e({})}}};const zi="win32"===process.platform;let Ki,Yi={},qi=0;function Ji(e,t){function r(e,t){return e.filter((e=>e.Id&&e.Id===t)).length>0}Hi.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let n=[];return new Promise((i=>{process.nextTick((()=>{Ki||(Ki=new Xi);const s=[];Ki.listContainers(e,(e=>{let a={};try{if(a=e,a&&"[object Array]"===Object.prototype.toString.call(a)&&a.length>0){for(let e in Yi)({}).hasOwnProperty.call(Yi,e)&&(r(a,e)||delete Yi[e]);a.forEach((function(e){var t,r;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),s.push((t=e.Id.trim(),r=e,new Promise((e=>{process.nextTick((()=>{if("string"!=typeof(t=t||""))return e();const n=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(t,!0)).trim();n?(Ki||(Ki=new Xi),Ki.getInspect(n.trim(),(t=>{try{e({id:r.Id,name:r.Name,image:r.Image,imageID:r.ImageID,command:r.Command,created:r.Created,started:t.State&&t.State.StartedAt?Math.round(new Date(t.State.StartedAt).getTime()/1e3):0,finished:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(t.State.FinishedAt).getTime()/1e3):0,createdAt:t.Created?t.Created:"",startedAt:t.State&&t.State.StartedAt?t.State.StartedAt:"",finishedAt:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?t.State.FinishedAt:"",state:r.State,restartCount:t.RestartCount||0,platform:t.Platform||"",driver:t.Driver||"",ports:r.Ports,mounts:r.Mounts})}catch(t){e()}}))):e()}))}))))})),s.length?Promise.all(s).then((e=>{t&&t(e),i(e)})):(t&&t(n),i(n))}else t&&t(n),i(n)}catch(e){for(let e in Yi)({}).hasOwnProperty.call(Yi,e)&&(r(a,e)||delete Yi[e]);t&&t(n),i(n)}}))}))}))}function Qi(e,t){let r=[];return new Promise((n=>{process.nextTick((()=>{if(Hi.isFunction(e)&&!t)t=e,r=["*"];else{if("string"!=typeof(e=e||"*"))return t&&t([]),n([]);let i="";if(i.__proto__.toLowerCase=Hi.stringToLower,i.__proto__.replace=Hi.stringReplace,i.__proto__.trim=Hi.stringTrim,i=e,i=i.trim(),"*"!==i){i="";const t=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(e,!0)).trim(),r=Hi.mathMin(t.length,2e3);for(let e=0;e<=r;e++)if(void 0!==t[e]){t[e].__proto__.toLowerCase=Hi.stringToLower;const r=t[e].toLowerCase();r&&r[0]&&!r[1]&&(i+=r[0])}}i=i.trim().toLowerCase().replace(/,+/g,"|"),r=i.split("|")}const i=[],s=[];if(r.length&&"*"===r[0].trim())r=[],Ji().then((e=>{for(let t of e)r.push(t.id.substring(0,12));r.length?Qi(r.join(",")).then((e=>{t&&t(e),n(e)})):(t&&t(i),n(i))}));else{for(let e of r)s.push(Zi(e.trim()));s.length?Promise.all(s).then((e=>{t&&t(e),n(e)})):(t&&t(i),n(i))}}))}))}function Zi(e){let t={id:e=e||"",memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0},restartCount:0,cpuStats:{},precpuStats:{},memoryStats:{},networks:{}};return new Promise((r=>{process.nextTick((()=>{e?(Ki||(Ki=new Xi),Ki.getInspect(e,(n=>{try{Ki.getStats(e,(e=>{try{let r=e;r.message||(e.id&&(t.id=e.id),t.memUsage=r.memory_stats&&r.memory_stats.usage?r.memory_stats.usage:0,t.memLimit=r.memory_stats&&r.memory_stats.limit?r.memory_stats.limit:0,t.memPercent=r.memory_stats&&r.memory_stats.usage&&r.memory_stats.limit?r.memory_stats.usage/r.memory_stats.limit*100:0,t.cpuPercent=r.cpu_stats&&r.precpu_stats?function(e,t){if(zi){let r=Hi.nanoSeconds(),n=0;if(qi>0){let i=r-qi,s=e.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(n=100*s/i)}return qi=r,n}{let r=0,n=e.cpu_usage.total_usage-t.cpu_usage.total_usage,i=e.system_cpu_usage-t.system_cpu_usage;return i>0&&n>0&&(r=t.online_cpus?n/i*t.online_cpus*100:n/i*e.cpu_usage.percpu_usage.length*100),r}}(r.cpu_stats,r.precpu_stats):0,t.pids=r.pids_stats&&r.pids_stats.current?r.pids_stats.current:0,t.restartCount=n.RestartCount?n.RestartCount:0,r.networks&&(t.netIO=function(e){let t,r;for(let n in e){if(!{}.hasOwnProperty.call(e,n))continue;let i=e[n];t=+i.rx_bytes,r=+i.tx_bytes}return{rx:t,wx:r}}(r.networks)),r.blkio_stats&&(t.blockIO=function(e){let t={r:0,w:0};return e&&e.io_service_bytes_recursive&&"[object Array]"===Object.prototype.toString.call(e.io_service_bytes_recursive)&&e.io_service_bytes_recursive.length>0&&e.io_service_bytes_recursive.forEach((function(e){e.op&&"read"===e.op.toLowerCase()&&e.value&&(t.r+=e.value),e.op&&"write"===e.op.toLowerCase()&&e.value&&(t.w+=e.value)})),t}(r.blkio_stats)),t.cpuStats=r.cpu_stats?r.cpu_stats:{},t.precpuStats=r.precpu_stats?r.precpu_stats:{},t.memoryStats=r.memory_stats?r.memory_stats:{},t.networks=r.networks?r.networks:{})}catch(e){Hi.noop()}r(t)}))}catch(e){Hi.noop()}}))):r(t)}))}))}function es(e,t){let r=[];return new Promise((n=>{process.nextTick((()=>{if("string"!=typeof(e=e||""))return n(r);const i=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(e,!0)).trim();i?(Ki||(Ki=new Xi),Ki.getProcesses(i,(e=>{try{if(e&&e.Titles&&e.Processes){let t=e.Titles.map((function(e){return e.toUpperCase()})),n=t.indexOf("PID"),i=t.indexOf("PPID"),s=t.indexOf("PGID"),a=t.indexOf("VSZ"),o=t.indexOf("TIME"),l=t.indexOf("ELAPSED"),c=t.indexOf("NI"),u=t.indexOf("RUSER"),p=t.indexOf("USER"),f=t.indexOf("RGROUP"),d=t.indexOf("GROUP"),m=t.indexOf("STAT"),h=t.indexOf("RSS"),g=t.indexOf("COMMAND");e.Processes.forEach((e=>{r.push({pidHost:n>=0?e[n]:"",ppid:i>=0?e[i]:"",pgid:s>=0?e[s]:"",user:p>=0?e[p]:"",ruser:u>=0?e[u]:"",group:d>=0?e[d]:"",rgroup:f>=0?e[f]:"",stat:m>=0?e[m]:"",time:o>=0?e[o]:"",elapsed:l>=0?e[l]:"",nice:c>=0?e[c]:"",rss:h>=0?e[h]:"",vsz:a>=0?e[a]:"",command:g>=0?e[g]:""})}))}}catch(e){Hi.noop()}t&&t(r),n(r)}))):(t&&t(r),n(r))}))}))}Ui.dockerInfo=function(e){return new Promise((t=>{process.nextTick((()=>{Ki||(Ki=new Xi);const r={};Ki.getInfo((n=>{r.id=n.ID,r.containers=n.Containers,r.containersRunning=n.ContainersRunning,r.containersPaused=n.ContainersPaused,r.containersStopped=n.ContainersStopped,r.images=n.Images,r.driver=n.Driver,r.memoryLimit=n.MemoryLimit,r.swapLimit=n.SwapLimit,r.kernelMemory=n.KernelMemory,r.cpuCfsPeriod=n.CpuCfsPeriod,r.cpuCfsQuota=n.CpuCfsQuota,r.cpuShares=n.CPUShares,r.cpuSet=n.CPUSet,r.ipv4Forwarding=n.IPv4Forwarding,r.bridgeNfIptables=n.BridgeNfIptables,r.bridgeNfIp6tables=n.BridgeNfIp6tables,r.debug=n.Debug,r.nfd=n.NFd,r.oomKillDisable=n.OomKillDisable,r.ngoroutines=n.NGoroutines,r.systemTime=n.SystemTime,r.loggingDriver=n.LoggingDriver,r.cgroupDriver=n.CgroupDriver,r.nEventsListener=n.NEventsListener,r.kernelVersion=n.KernelVersion,r.operatingSystem=n.OperatingSystem,r.osType=n.OSType,r.architecture=n.Architecture,r.ncpu=n.NCPU,r.memTotal=n.MemTotal,r.dockerRootDir=n.DockerRootDir,r.httpProxy=n.HttpProxy,r.httpsProxy=n.HttpsProxy,r.noProxy=n.NoProxy,r.name=n.Name,r.labels=n.Labels,r.experimentalBuild=n.ExperimentalBuild,r.serverVersion=n.ServerVersion,r.clusterStore=n.ClusterStore,r.clusterAdvertise=n.ClusterAdvertise,r.defaultRuntime=n.DefaultRuntime,r.liveRestoreEnabled=n.LiveRestoreEnabled,r.isolation=n.Isolation,r.initBinary=n.InitBinary,r.productLicense=n.ProductLicense,e&&e(r),t(r)}))}))}))},Ui.dockerImages=function(e,t){Hi.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let r=[];return new Promise((n=>{process.nextTick((()=>{Ki||(Ki=new Xi);const i=[];Ki.listImages(e,(e=>{let s={};try{s=e,s&&"[object Array]"===Object.prototype.toString.call(s)&&s.length>0?(s.forEach((function(e){var t,r;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),i.push((t=e.Id.trim(),r=e,new Promise((e=>{process.nextTick((()=>{if("string"!=typeof(t=t||""))return e();const n=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(t,!0)).trim();n?(Ki||(Ki=new Xi),Ki.inspectImage(n.trim(),(t=>{try{e({id:r.Id,container:t.Container,comment:t.Comment,os:t.Os,architecture:t.Architecture,parent:t.Parent,dockerVersion:t.DockerVersion,size:t.Size,sharedSize:r.SharedSize,virtualSize:t.VirtualSize,author:t.Author,created:t.Created?Math.round(new Date(t.Created).getTime()/1e3):0,containerConfig:t.ContainerConfig?t.ContainerConfig:{},graphDriver:t.GraphDriver?t.GraphDriver:{},repoDigests:t.RepoDigests?t.RepoDigests:{},repoTags:t.RepoTags?t.RepoTags:{},config:t.Config?t.Config:{},rootFS:t.RootFS?t.RootFS:{}})}catch(t){e()}}))):e()}))}))))})),i.length?Promise.all(i).then((e=>{t&&t(e),n(e)})):(t&&t(r),n(r))):(t&&t(r),n(r))}catch(e){t&&t(r),n(r)}}))}))}))},Ui.dockerContainers=Ji,Ui.dockerContainerStats=Qi,Ui.dockerContainerProcesses=es,Ui.dockerVolumes=function(e){let t=[];return new Promise((r=>{process.nextTick((()=>{Ki||(Ki=new Xi),Ki.listVolumes((n=>{let i={};try{i=n,i&&i.Volumes&&"[object Array]"===Object.prototype.toString.call(i.Volumes)&&i.Volumes.length>0?(i.Volumes.forEach((function(e){t.push({name:e.Name,driver:e.Driver,labels:e.Labels,mountpoint:e.Mountpoint,options:e.Options,scope:e.Scope,created:e.CreatedAt?Math.round(new Date(e.CreatedAt).getTime()/1e3):0})})),e&&e(t),r(t)):(e&&e(t),r(t))}catch(n){e&&e(t),r(t)}}))}))}))},Ui.dockerAll=function(e){return new Promise((t=>{process.nextTick((()=>{Ji(!0).then((r=>{if(r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0){let n=r.length;r.forEach((function(i){Qi(i.id).then((s=>{i.memUsage=s[0].memUsage,i.memLimit=s[0].memLimit,i.memPercent=s[0].memPercent,i.cpuPercent=s[0].cpuPercent,i.pids=s[0].pids,i.netIO=s[0].netIO,i.blockIO=s[0].blockIO,i.cpuStats=s[0].cpuStats,i.precpuStats=s[0].precpuStats,i.memoryStats=s[0].memoryStats,i.networks=s[0].networks,es(i.id).then((s=>{i.processes=s,n-=1,0===n&&(e&&e(r),t(r))}))}))}))}else e&&e(r),t(r)}))}))}))};var ts={};const rs=m.default,ns=y.default.exec,is=L;ts.vboxInfo=function(e){let t=[];return new Promise((r=>{process.nextTick((()=>{try{ns(is.getVboxmanage()+" list vms --long",(function(n,i){let s=(rs.EOL+i.toString()).split(rs.EOL+"Name:");s.shift(),s.forEach((e=>{const r=("Name:"+e).split(rs.EOL),n=is.getValue(r,"State"),i=n.startsWith("running"),s=i?n.replace("running (since ","").replace(")","").trim():"";let a=0;try{if(i){const e=new Date(s),t=e.getTimezoneOffset();a=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){is.noop()}const o=i?"":n.replace("powered off (since","").replace(")","").trim();let l=0;try{if(!i){const e=new Date(o),t=e.getTimezoneOffset();l=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){is.noop()}t.push({id:is.getValue(r,"UUID"),name:is.getValue(r,"Name"),running:i,started:s,runningSince:a,stopped:o,stoppedSince:l,guestOS:is.getValue(r,"Guest OS"),hardwareUUID:is.getValue(r,"Hardware UUID"),memory:parseInt(is.getValue(r,"Memory size"," "),10),vram:parseInt(is.getValue(r,"VRAM size"),10),cpus:parseInt(is.getValue(r,"Number of CPUs"),10),cpuExepCap:is.getValue(r,"CPU exec cap"),cpuProfile:is.getValue(r,"CPUProfile"),chipset:is.getValue(r,"Chipset"),firmware:is.getValue(r,"Firmware"),pageFusion:"enabled"===is.getValue(r,"Page Fusion"),configFile:is.getValue(r,"Config file"),snapshotFolder:is.getValue(r,"Snapshot folder"),logFolder:is.getValue(r,"Log folder"),hpet:"enabled"===is.getValue(r,"HPET"),pae:"enabled"===is.getValue(r,"PAE"),longMode:"enabled"===is.getValue(r,"Long Mode"),tripleFaultReset:"enabled"===is.getValue(r,"Triple Fault Reset"),apic:"enabled"===is.getValue(r,"APIC"),x2Apic:"enabled"===is.getValue(r,"X2APIC"),acpi:"enabled"===is.getValue(r,"ACPI"),ioApic:"enabled"===is.getValue(r,"IOAPIC"),biosApicMode:is.getValue(r,"BIOS APIC mode"),bootMenuMode:is.getValue(r,"Boot menu mode"),bootDevice1:is.getValue(r,"Boot Device 1"),bootDevice2:is.getValue(r,"Boot Device 2"),bootDevice3:is.getValue(r,"Boot Device 3"),bootDevice4:is.getValue(r,"Boot Device 4"),timeOffset:is.getValue(r,"Time offset"),rtc:is.getValue(r,"RTC")})})),e&&e(t),r(t)}))}catch(n){e&&e(t),r(t)}}))}))};var ss={};const as=y.default.exec,os=L;let ls=process.platform;const cs="linux"===ls||"android"===ls,us="darwin"===ls,ps="win32"===ls,fs="freebsd"===ls,ds="openbsd"===ls,ms="netbsd"===ls,hs="sunos"===ls,gs={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function ys(e){const t={},r=os.getValue(e,"PrinterId"," ");return t.id=r?parseInt(r,10):null,t.name=os.getValue(e,"Info"," "),t.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",t.uri=os.getValue(e,"DeviceURI"," "),t.uuid=os.getValue(e,"UUID"," "),t.status=os.getValue(e,"State"," "),t.local=os.getValue(e,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=os.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),t}function vs(e,t){const r={};return r.id=t,r.name=os.getValue(e,"Description",":",!0),r.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",r.uri=null,r.uuid=null,r.status=e.length>0&&e[0]?e[0].indexOf(" idle")>0?"idle":e[0].indexOf(" printing")>0?"printing":"unknown":null,r.local=os.getValue(e,"Location",":",!0).toLowerCase().startsWith("local"),r.default=null,r.shared=os.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),r}function Ss(e,t){const r={},n=e.uri.split("/");return r.id=t,r.name=e._name,r.model=n.length?n[n.length-1]:"",r.uri=e.uri,r.uuid=null,r.status=e.status,r.local="local"===e.printserver,r.default="yes"===e.default,r.shared="yes"===e.shared,r}function ws(e,t){const r={},n=parseInt(os.getValue(e,"PrinterStatus",":"),10);return r.id=t,r.name=os.getValue(e,"name",":"),r.model=os.getValue(e,"DriverName",":"),r.uri=null,r.uuid=null,r.status=gs[n]?gs[n]:null,r.local="TRUE"===os.getValue(e,"Local",":").toUpperCase(),r.default="TRUE"===os.getValue(e,"Default",":").toUpperCase(),r.shared="TRUE"===os.getValue(e,"Shared",":").toUpperCase(),r}ss.printer=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(cs||fs||ds||ms){let n="cat /etc/cups/printers.conf 2>/dev/null";as(n,(function(i,s){if(!i){const e=s.toString().split("<Printer "),t=function(e){const t={};if(e&&e.length&&e[0].indexOf(" CUPS v")>0){const r=e[0].split(" CUPS v");t.cupsVersion=r[1]}return t}(e[0]);for(let n=1;n<e.length;n++){const i=ys(e[n].split("\n"));i.name&&(i.engine="CUPS",i.engineVersion=t.cupsVersion,r.push(i))}}0===r.length&&cs?(n="export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL",as(n,(function(e,t){const n=("\n"+t.toString()).split("\nprinter ");for(let e=1;e<n.length;e++){const t=vs(n[e].split("\n"),e);r.push(t)}})),e&&e(r),t(r)):(e&&e(r),t(r))}))}if(us){as("system_profiler SPPrintersDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPPrintersDataType&&e.SPPrintersDataType.length)for(let t=0;t<e.SPPrintersDataType.length;t++){const n=Ss(e.SPPrintersDataType[t],t);r.push(n)}}catch(e){os.noop()}e&&e(r),t(r)}))}ps&&os.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then(((n,i)=>{if(!i){const e=n.toString().split(/\n\s*\n/);for(let t=0;t<e.length;t++){const n=ws(e[t].split("\n"),t);(n.name||n.model)&&r.push(n)}}e&&e(r),t(r)})),hs&&t(null)}))}))};var xs={};const Cs=y.default.exec,Os=L;let Is=process.platform;const bs="linux"===Is||"android"===Is,Es="darwin"===Is,Ls="win32"===Is,_s="freebsd"===Is,Ps="openbsd"===Is,Ts="netbsd"===Is,Vs="sunos"===Is;function As(e){const t={},r=e.split("\n");if(r&&r.length&&r[0].indexOf("Device")>=0){const e=r[0].split(" ");t.bus=parseInt(e[0],10),e[2]?t.deviceId=parseInt(e[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;const n=Os.getValue(r,"idVendor"," ",!0).trim();let i=n.split(" ");i.shift();const s=i.join(" "),a=Os.getValue(r,"idProduct"," ",!0).trim();let o=a.split(" ");o.shift();const l=o.join(" ");let c=Os.getValue(r,"bInterfaceClass"," ",!0).trim().split(" ");c.shift();const u=c.join(" ");let p=Os.getValue(r,"iManufacturer"," ",!0).trim().split(" ");p.shift();const f=p.join(" ");return t.id=(n.startsWith("0x")?n.split(" ")[0].substr(2,10):"")+":"+(a.startsWith("0x")?a.split(" ")[0].substr(2,10):""),t.name=l,t.type=function(e,t){let r=e;const n=(t+" "+e).toLowerCase();return n.indexOf("camera")>=0?r="Camera":n.indexOf("hub")>=0?r="Hub":n.indexOf("keybrd")>=0||n.indexOf("keyboard")>=0?r="Keyboard":n.indexOf("mouse")>=0?r="Mouse":n.indexOf("stora")>=0?r="Storage":n.indexOf("mic")>=0?r="Microphone":(n.indexOf("headset")>=0||n.indexOf("audio")>=0)&&(r="Audio"),r}(u,l),t.removable=null,t.vendor=s,t.manufacturer=f,t.maxPower=Os.getValue(r,"MaxPower"," ",!0),t.serialNumber=null,t}function Ns(e,t){const r={};r.id=t;let n=(e=(e=e.replace(/ \|/g,"")).trim()).split("\n");n.shift();try{for(let e=0;e<n.length;e++){n[e]=n[e].trim(),n[e]=n[e].replace(/=/g,":"),"{"!==n[e]&&"}"!==n[e]&&n[e+1]&&"}"!==n[e+1].trim()&&(n[e]=n[e]+","),n[e]=n[e].replace(":Yes,",':"Yes",'),n[e]=n[e].replace(": Yes,",': "Yes",'),n[e]=n[e].replace(": Yes",': "Yes"'),n[e]=n[e].replace(":No,",':"No",'),n[e]=n[e].replace(": No,",': "No",'),n[e]=n[e].replace(": No",': "No"'),n[e]=n[e].replace("((","").replace("))","");const t=/<(\w+)>/.exec(n[e]);if(t){const r=t[0];n[e]=n[e].replace(r,`"${r}"`)}}const e=JSON.parse(n.join("\n")),t=!(e["Built-In"]&&"yes"===e["Built-In"].toLowerCase()||e["non-removable"]&&"no"!==e["non-removable"].toLowerCase());return r.bus=null,r.deviceId=null,r.id=e["USB Address"]||null,r.name=e.kUSBProductString||e["USB Product Name"]||null,r.type=function(e){let t="";return e.indexOf("camera")>=0?t="Camera":e.indexOf("touch bar")>=0?t="Touch Bar":e.indexOf("controller")>=0?t="Controller":e.indexOf("headset")>=0?t="Audio":e.indexOf("keyboard")>=0?t="Keyboard":e.indexOf("trackpad")>=0?t="Trackpad":e.indexOf("sensor")>=0?t="Sensor":e.indexOf("bthusb")>=0||e.indexOf("bth")>=0||e.indexOf("rfcomm")>=0?t="Bluetooth":e.indexOf("usbhub")>=0||e.indexOf(" hub")>=0?t="Hub":e.indexOf("mouse")>=0?t="Mouse":e.indexOf("mic")>=0?t="Microphone":e.indexOf("removable")>=0&&(t="Storage"),t}((e.kUSBProductString||e["USB Product Name"]||"").toLowerCase()+(t?" removable":"")),r.removable=!e["non-removable"]||(e["non-removable"].toLowerCase()||!1),r.vendor=e.kUSBVendorString||e["USB Vendor Name"]||null,r.manufacturer=e.kUSBVendorString||e["USB Vendor Name"]||null,r.maxPower=null,r.serialNumber=e.kUSBSerialNumberString||null,r.name?r:null}catch(e){return null}}function Ds(e,t){const r=function(e,t){let r="";return t.indexOf("storage")>=0||t.indexOf("speicher")>=0?r="Storage":e.indexOf("usbhub")>=0?r="Hub":e.indexOf("storage")>=0?r="Storage":e.indexOf("usbcontroller")>=0?r="Controller":e.indexOf("keyboard")>=0?r="Keyboard":e.indexOf("pointing")>=0?r="Mouse":e.indexOf("disk")>=0&&(r="Storage"),r}(Os.getValue(e,"CreationClassName",":").toLowerCase(),Os.getValue(e,"name",":").toLowerCase());if(r){const n={bus:null};return n.deviceId=Os.getValue(e,"deviceid",":"),n.id=t,n.name=Os.getValue(e,"name",":"),n.type=r,n.removable=null,n.vendor=null,n.manufacturer=Os.getValue(e,"Manufacturer",":"),n.maxPower=null,n.serialNumber=null,n}return null}xs.usb=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(bs){Cs("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:134217728},(function(n,i){if(!n){const e=("\n\n"+i.toString()).split("\n\nBus ");for(let t=1;t<e.length;t++){const n=As(e[t]);r.push(n)}}e&&e(r),t(r)}))}if(Es){Cs("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l",{maxBuffer:134217728},(function(n,i){if(!n){const n=i.toString().split(" +-o ");for(let e=1;e<n.length;e++){const t=Ns(n[e]);t&&r.push(t)}e&&e(r),t(r)}e&&e(r),t(r)}))}Ls&&Os.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then(((n,i)=>{if(!i){const e=n.toString().split(/\n\s*\n/);for(let t=0;t<e.length;t++){const n=Ds(e[t].split("\n"),t);n&&r.push(n)}}e&&e(r),t(r)})),(Vs||_s||Ps||Ts)&&t(null)}))}))};var ks={};const Ms=y.default.exec,Rs=y.default.execSync,Bs=L;let Fs=process.platform;const Gs="linux"===Fs||"android"===Fs,Ws="darwin"===Fs,Us="win32"===Fs,$s="freebsd"===Fs,js="openbsd"===Fs,Hs="netbsd"===Fs,Xs="sunos"===Fs;function zs(e,t,r){let n="";return(e=e.toLowerCase()).indexOf("input")>=0&&(n="Microphone"),e.indexOf("display audio")>=0&&(n="Speaker"),e.indexOf("speak")>=0&&(n="Speaker"),e.indexOf("laut")>=0&&(n="Speaker"),e.indexOf("loud")>=0&&(n="Speaker"),e.indexOf("head")>=0&&(n="Headset"),e.indexOf("mic")>=0&&(n="Microphone"),e.indexOf("mikr")>=0&&(n="Microphone"),e.indexOf("phone")>=0&&(n="Phone"),e.indexOf("controll")>=0&&(n="Controller"),e.indexOf("line o")>=0&&(n="Line Out"),e.indexOf("digital o")>=0&&(n="Digital Out"),e.indexOf("smart sound technology")>=0&&(n="Digital Signal Processor"),e.indexOf("high definition audio")>=0&&(n="Sound Driver"),!n&&r?n="Speaker":!n&&t&&(n="Microphone"),n}function Ks(e,t){const r={},n=((e.coreaudio_device_transport||"")+" "+(e._name||"")).toLowerCase();return r.id=t,r.name=e._name,r.manufacturer=e.coreaudio_device_manufacturer,r.revision=null,r.driver=null,r.default=!!e.coreaudio_default_audio_input_device||!!e.coreaudio_default_audio_output_device,r.channel=function(e){let t="";return e.indexOf("builtin")>=0&&(t="Built-In"),e.indexOf("extern")>=0&&(t="Audio-Jack"),e.indexOf("hdmi")>=0&&(t="HDMI"),e.indexOf("displayport")>=0&&(t="Display-Port"),e.indexOf("usb")>=0&&(t="USB"),e.indexOf("pci")>=0&&(t="PCIe"),t}(n),r.type=zs(r.name,!!e.coreaudio_device_input,!!e.coreaudio_device_output),r.in=!!e.coreaudio_device_input,r.out=!!e.coreaudio_device_output,r.status="online",r}ks.audio=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Gs||$s||js||Hs){Ms("lspci -vmm 2>/dev/null",(function(n,i){if(!n){const e=function(){let e=[];try{return Rs("lspci -v 2>/dev/null").toString().split("\n\n").forEach((t=>{const r=t.split("\n");if(r&&r.length&&r[0].toLowerCase().indexOf("audio")>=0){const t={};t.slotId=r[0].split(" ")[0],t.driver=Bs.getValue(r,"Kernel driver in use",":",!0)||Bs.getValue(r,"Kernel modules",":",!0),e.push(t)}})),e}catch(t){return e}}();i.toString().split("\n\n").forEach((t=>{const n=t.split("\n");if(Bs.getValue(n,"class",":",!0).toLowerCase().indexOf("audio")>=0){const t=function(e,t){const r={},n=Bs.getValue(e,"Slot"),i=t.filter((function(e){return e.slotId===n}));return r.id=n,r.name=Bs.getValue(e,"SDevice"),r.manufacturer=Bs.getValue(e,"SVendor"),r.revision=Bs.getValue(e,"Rev"),r.driver=i&&1===i.length&&i[0].driver?i[0].driver:"",r.default=null,r.channel="PCIe",r.type=zs(r.name,null,null),r.in=null,r.out=null,r.status="online",r}(n,e);r.push(t)}}))}e&&e(r),t(r)}))}if(Ws){Ms("system_profiler SPAudioDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPAudioDataType&&e.SPAudioDataType.length&&e.SPAudioDataType[0]&&e.SPAudioDataType[0]._items&&e.SPAudioDataType[0]._items.length)for(let t=0;t<e.SPAudioDataType[0]._items.length;t++){const n=Ks(e.SPAudioDataType[0]._items[t],t);r.push(n)}}catch(e){Bs.noop()}e&&e(r),t(r)}))}Us&&Bs.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then(((n,i)=>{if(!i){n.toString().split(/\n\s*\n/).forEach((e=>{const t=e.split("\n");Bs.getValue(t,"name",":")&&r.push(function(e){const t={},r=Bs.getValue(e,"StatusInfo",":");return t.id=Bs.getValue(e,"DeviceID",":"),t.name=Bs.getValue(e,"name",":"),t.manufacturer=Bs.getValue(e,"manufacturer",":"),t.revision=null,t.driver=null,t.default=null,t.channel=null,t.type=zs(t.name,null,null),t.in=null,t.out=null,t.status=r,t}(t))}))}e&&e(r),t(r)})),Xs&&t(null)}))}))};var Ys={};const qs=y.default.exec,Js=y.default.execSync,Qs=g.default,Zs=L,ea=h.default;let ta=process.platform;const ra="linux"===ta||"android"===ta,na="darwin"===ta,ia="win32"===ta,sa="freebsd"===ta,aa="openbsd"===ta,oa="netbsd"===ta,la="sunos"===ta;function ca(e){let t="";return e.indexOf("keyboard")>=0&&(t="Keyboard"),e.indexOf("mouse")>=0&&(t="Mouse"),e.indexOf("trackpad")>=0&&(t="Trackpad"),e.indexOf("speaker")>=0&&(t="Speaker"),e.indexOf("headset")>=0&&(t="Headset"),e.indexOf("phone")>=0&&(t="Phone"),e.indexOf("macbook")>=0&&(t="Computer"),e.indexOf("imac")>=0&&(t="Computer"),e.indexOf("ipad")>=0&&(t="Tablet"),e.indexOf("watch")>=0&&(t="Watch"),e.indexOf("headphone")>=0&&(t="Headset"),t}function ua(e,t){const r={},n=((e.device_minorClassOfDevice_string||e.device_majorClassOfDevice_string||e.device_minorType||"")+(e.device_name||"")).toLowerCase();return r.device=e.device_services||"",r.name=e.device_name||"",r.manufacturer=e.device_manufacturer||function(e){let t=e.split(" ")[0];return(e=e.toLowerCase()).indexOf("apple")>=0&&(t="Apple"),e.indexOf("ipad")>=0&&(t="Apple"),e.indexOf("imac")>=0&&(t="Apple"),e.indexOf("iphone")>=0&&(t="Apple"),e.indexOf("magic mouse")>=0&&(t="Apple"),e.indexOf("magic track")>=0&&(t="Apple"),e.indexOf("macbook")>=0&&(t="Apple"),t}(e.device_name||"")||"",r.macDevice=(e.device_addr||e.device_address||"").toLowerCase().replace(/-/g,":"),r.macHost=t,r.batteryPercent=e.device_batteryPercent||null,r.type=ca(n),r.connected="attrib_Yes"===e.device_isconnected||!1,r}Ys.bluetoothDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(ra){Zs.getFilesInPath("/var/lib/bluetooth/").forEach((e=>{const t=Qs.basename(e),n=e.split("/"),i=n.length>=6?n[n.length-2]:null,s=n.length>=7?n[n.length-3]:null;if("info"===t){const t=ea.readFileSync(e,{encoding:"utf8"}).split("\n");r.push(function(e,t,r){const n={device:null};return n.name=Zs.getValue(e,"name","="),n.manufacturer=null,n.macDevice=t,n.macHost=r,n.batteryPercent=null,n.type=ca(n.name.toLowerCase()),n.connected=!1,n}(t,i,s))}}));try{const e=Js("hcitool con").toString().toLowerCase();for(let t=0;t<r.length;t++)r[t].macDevice&&r[t].macDevice.length>10&&e.indexOf(r[t].macDevice.toLowerCase())>=0&&(r[t].connected=!0)}catch(e){Zs.noop()}e&&e(r),t(r)}if(na){qs("system_profiler SPBluetoothDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_title&&e.SPBluetoothDataType[0].device_title.length){let t=null;e.SPBluetoothDataType[0].local_device_title&&e.SPBluetoothDataType[0].local_device_title.general_address&&(t=e.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":")),e.SPBluetoothDataType[0].device_title.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0];const s=ua(e,t);r.push(s)}}))}if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_connected&&e.SPBluetoothDataType[0].device_connected.length){const t=e.SPBluetoothDataType[0].controller_properties&&e.SPBluetoothDataType[0].controller_properties.controller_address?e.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;e.SPBluetoothDataType[0].device_connected.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0],e.device_isconnected="attrib_Yes";const s=ua(e,t);r.push(s)}}))}if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_not_connected&&e.SPBluetoothDataType[0].device_not_connected.length){const t=e.SPBluetoothDataType[0].controller_properties&&e.SPBluetoothDataType[0].controller_properties.controller_address?e.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;e.SPBluetoothDataType[0].device_not_connected.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0],e.device_isconnected="attrib_No";const s=ua(e,t);r.push(s)}}))}}catch(e){Zs.noop()}e&&e(r),t(r)}))}ia&&Zs.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then(((n,i)=>{if(!i){n.toString().split(/\n\s*\n/).forEach((e=>{"Bluetooth"===Zs.getValue(e.split("\n"),"PNPClass",":")&&r.push(function(e){const t={device:null};return t.name=Zs.getValue(e,"name",":"),t.manufacturer=Zs.getValue(e,"manufacturer",":"),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=ca(t.name.toLowerCase()),t.connected=null,t}(e.split("\n")))}))}e&&e(r),t(r)})),(sa||oa||aa||la)&&t(null)}))}))},function(e){const t=E,r=L,n=ye,i=Ne,s=Je,a=Et,o=er,l=tr,c=Or,u=Xr,p=Nn,f=Jn,d=Si,m=Ai,h=Ui,g=ts,y=ss,v=xs,S=ks,w=Ys;let x=process.platform;const C="win32"===x,O="freebsd"===x,I="openbsd"===x,b="netbsd"===x,_="sunos"===x;function P(){return t}function T(e){return new Promise((t=>{process.nextTick((()=>{let r={};r.version=P(),Promise.all([n.system(),n.bios(),n.baseboard(),n.chassis(),i.osInfo(),i.uuid(),i.versions(),s.cpu(),s.cpuFlags(),l.graphics(),u.networkInterfaces(),a.memLayout(),c.diskLayout()]).then((n=>{r.system=n[0],r.bios=n[1],r.baseboard=n[2],r.chassis=n[3],r.os=n[4],r.uuid=n[5],r.versions=n[6],r.cpu=n[7],r.cpu.flags=n[8],r.graphics=n[9],r.net=n[10],r.memLayout=n[11],r.diskLayout=n[12],e&&e(r),t(r)}))}))}))}function V(e,t,n){return r.isFunction(t)&&(n=t,t=""),r.isFunction(e)&&(n=e,e=""),new Promise((r=>{process.nextTick((()=>{t=t||u.getDefaultNetworkInterface(),e=e||"";let l=function(){let e=15;return C&&(e=13),(O||I||b)&&(e=11),_&&(e=6),function(){0==--e&&(n&&n(h),r(h))}}(),h={};h.time=i.time(),h.node=process.versions.node,h.v8=process.versions.v8,s.cpuCurrentSpeed().then((e=>{h.cpuCurrentSpeed=e,l()})),d.users().then((e=>{h.users=e,l()})),f.processes().then((e=>{h.processes=e,l()})),s.currentLoad().then((e=>{h.currentLoad=e,l()})),_||s.cpuTemperature().then((e=>{h.temp=e,l()})),I||O||b||_||u.networkStats(t).then((e=>{h.networkStats=e,l()})),_||u.networkConnections().then((e=>{h.networkConnections=e,l()})),a.mem().then((e=>{h.mem=e,l()})),_||o().then((e=>{h.battery=e,l()})),_||f.services(e).then((e=>{h.services=e,l()})),_||c.fsSize().then((e=>{h.fsSize=e,l()})),C||I||O||b||_||c.fsStats().then((e=>{h.fsStats=e,l()})),C||I||O||b||_||c.disksIO().then((e=>{h.disksIO=e,l()})),I||O||b||_||p.wifiNetworks().then((e=>{h.wifiNetworks=e,l()})),m.inetLatency().then((e=>{h.inetLatency=e,l()}))}))}))}function A(t,r){return new Promise((n=>{process.nextTick((()=>{const i=Object.keys(t).filter((t=>({}.hasOwnProperty.call(e,t)))).map((r=>{const n=t[r].substring(t[r].lastIndexOf("(")+1,t[r].lastIndexOf(")"));let i=r.indexOf(")")>=0?r.split(")")[1].trim():r;return i=r.indexOf("|")>=0?r.split("|")[0].trim():i,n?e[i](n):e[i]("")}));Promise.all(i).then((i=>{const s={};let a=0;for(let r in t)if({}.hasOwnProperty.call(t,r)&&{}.hasOwnProperty.call(e,r)&&i.length>a){if("*"===t[r]||"all"===t[r])s[r]=i[a];else{let e=t[r],n="",o=[];if(e.indexOf(")")>=0&&(e=e.split(")")[1].trim()),e.indexOf("|")>=0&&(n=e.split("|")[1].trim(),o=n.split(":"),e=e.split("|")[0].trim()),e=e.replace(/,/g," ").replace(/ +/g," ").split(" "),i[a])if(Array.isArray(i[a])){const t=[];i[a].forEach((r=>{let i={};if(1!==e.length||"*"!==e[0]&&"all"!==e[0]?e.forEach((e=>{({}).hasOwnProperty.call(r,e)&&(i[e]=r[e])})):i=r,n&&2===o.length){if({}.hasOwnProperty.call(i,o[0].trim())){const e=i[o[0].trim()];"number"==typeof e?e===parseFloat(o[1].trim())&&t.push(i):"string"==typeof e&&e.toLowerCase()===o[1].trim().toLowerCase()&&t.push(i)}}else t.push(i)})),s[r]=t}else{const t={};e.forEach((e=>{({}).hasOwnProperty.call(i[a],e)&&(t[e]=i[a][e])})),s[r]=t}else s[r]={}}a++}r&&r(s),n(s)}))}))}))}C&&r.getCodepage(),e.version=P,e.system=n.system,e.bios=n.bios,e.baseboard=n.baseboard,e.chassis=n.chassis,e.time=i.time,e.osInfo=i.osInfo,e.versions=i.versions,e.shell=i.shell,e.uuid=i.uuid,e.cpu=s.cpu,e.cpuFlags=s.cpuFlags,e.cpuCache=s.cpuCache,e.cpuCurrentSpeed=s.cpuCurrentSpeed,e.cpuTemperature=s.cpuTemperature,e.currentLoad=s.currentLoad,e.fullLoad=s.fullLoad,e.mem=a.mem,e.memLayout=a.memLayout,e.battery=o,e.graphics=l.graphics,e.fsSize=c.fsSize,e.fsOpenFiles=c.fsOpenFiles,e.blockDevices=c.blockDevices,e.fsStats=c.fsStats,e.disksIO=c.disksIO,e.diskLayout=c.diskLayout,e.networkInterfaceDefault=u.networkInterfaceDefault,e.networkGatewayDefault=u.networkGatewayDefault,e.networkInterfaces=u.networkInterfaces,e.networkStats=u.networkStats,e.networkConnections=u.networkConnections,e.wifiNetworks=p.wifiNetworks,e.wifiInterfaces=p.wifiInterfaces,e.wifiConnections=p.wifiConnections,e.services=f.services,e.processes=f.processes,e.processLoad=f.processLoad,e.users=d.users,e.inetChecksite=m.inetChecksite,e.inetLatency=m.inetLatency,e.dockerInfo=h.dockerInfo,e.dockerImages=h.dockerImages,e.dockerContainers=h.dockerContainers,e.dockerContainerStats=h.dockerContainerStats,e.dockerContainerProcesses=h.dockerContainerProcesses,e.dockerVolumes=h.dockerVolumes,e.dockerAll=h.dockerAll,e.vboxInfo=g.vboxInfo,e.printer=y.printer,e.usb=v.usb,e.audio=S.audio,e.bluetoothDevices=w.bluetoothDevices,e.getStaticData=T,e.getDynamicData=V,e.getAllData=function(e,t,n){return new Promise((i=>{process.nextTick((()=>{let s={};t&&r.isFunction(t)&&!n&&(n=t,t=""),e&&r.isFunction(e)&&!t&&!n&&(n=e,e="",t=""),T().then((r=>{s=r,V(e,t).then((e=>{for(let t in e)({}).hasOwnProperty.call(e,t)&&(s[t]=e[t]);n&&n(s),i(s)}))}))}))}))},e.get=A,e.observe=function(e,t,r){let n=null;return setInterval((()=>{A(e).then((e=>{JSON.stringify(n)!==JSON.stringify(e)&&(n=Object.assign({},e),r(e))}))}),t)},e.powerShellStart=r.powerShellStart,e.powerShellRelease=r.powerShellRelease}(b);var pa={},fa={exports:{}};
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("crypto"),require("os"),require("fs"),require("path"),require("child_process"),require("util"),require("net"),require("buffer"),require("stream")):"function"==typeof define&&define.amd?define(["exports","crypto","os","fs","path","child_process","util","net","buffer","stream"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["jwt-license-verifier"]={},e.require$$2$1,e.require$$0$1,e.require$$1$1,e.require$$2,e.require$$1,e.require$$4,e.require$$0$2,e.require$$0$3,e.require$$3)}(this,(function(e,t,r,n,i,s,a,o,l,c){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var f=u(t),d=p(t),m=u(r),h=u(n),g=u(i),y=u(s),v=u(a),S=u(o),w=u(l),x=u(c);function C(){C=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var s=t&&t.prototype instanceof y?t:y,a=Object.create(s.prototype),o=new V(n||[]);return i(a,"_invoke",{value:L(e,r,o)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",d="suspendedYield",m="executing",h="completed",g={};function y(){}function v(){}function S(){}var w={};c(w,a,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var I=S.prototype=y.prototype=Object.create(w);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,s,a,o){var l=p(e[i],e,s);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(l.arg)}var s;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return s=s?s.then(i,i):i()}})}function L(t,r,n){var i=f;return function(s,a){if(i===m)throw new Error("Generator is already running");if(i===h){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var o=n.delegate;if(o){var l=_(o,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?h:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=h,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var s=p(i,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,g;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return s.next=s}}throw new TypeError(typeof t+" is not iterable")}return v.prototype=S,i(I,"constructor",{value:S,configurable:!0}),i(S,"constructor",{value:v,configurable:!0}),v.displayName=c(S,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,c(e,l,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},b(E.prototype),c(E.prototype,o,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var a=new E(u(e,r,n,i),s);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(I),c(I,l,"Generator"),c(I,a,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,V.prototype={constructor:V,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return o.type="throw",o.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function O(e,t,r,n,i,s,a){try{var o=e[s](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,i)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function a(e){O(s,n,i,a,o,"next",e)}function o(e){O(s,n,i,a,o,"throw",e)}a(void 0)}))}}var b={},E="5.21.24",L={};const _=m.default,P=h.default,T=g.default,V=y.default.spawn,A=y.default.exec,N=y.default.execSync,D=v.default;let k=process.platform;const M="linux"===k||"android"===k,R="darwin"===k,B="win32"===k,F="freebsd"===k,G="openbsd"===k,W="netbsd"===k;let U=0,$="",j="",H=null,X=null;const z=process.env.WINDIR||"C:\\Windows";let K,Y="",q=[],J=!1;const Q="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",Z="--###START###--",ee="--ERROR--",te="--###ENDCMD###--",re="--##ID##--",ne={windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})};const ie=(new String).replace,se=(new String).toLowerCase,ae=(new String).toString,oe=(new String).substr,le=(new String).trim,ce=(new String).startsWith,ue=Math.min;function pe(e,t,r,n,i){r=r||":",t=t.toLowerCase(),n=n||!1,i=i||!1;let s="";return e.some((e=>{let a=e.toLowerCase().replace(/\t/g,"");if(n&&(a=a.trim()),a.startsWith(t)&&(!i||(a.match(t+r)||a.match(t+" "+r)))){const t=n?e.trim().split(r):e.split(r);if(t.length>=2)return t.shift(),s=t.join(r).trim(),!0}})),s}function fe(){if("Windows_NT"===_.type()&&!$&&($=z+"\\system32\\wbem\\wmic.exe",!P.existsSync($)))try{const e=N("WHERE WMIC",ne).toString().split("\r\n");$=e&&e.length?e[0]:"wmic"}catch(e){$="wmic"}return $}function de(e){let t,r="",n="";if(e.indexOf(Z)>=0){t=e.split(Z);const n=t[1].split(re);r=n[0],n.length>1&&(e=n.slice(1).join(re))}e.indexOf(te)>=0&&(t=e.split(te),n=t[0]);let i=-1;for(let e=0;e<q.length;e++)q[e].id===r&&(i=e,q[e].callback(n));i>=0&&q.splice(i,1)}function me(e){if(J){const t=Math.random().toString(36).substring(2,12);return new Promise((r=>{process.nextTick((()=>{q.push({id:t,cmd:e,callback:function(e){r(e)},start:new Date});try{K&&K.pid&&K.stdin.write(Q+"echo "+Z+t+re+"; "+_.EOL+e+_.EOL+"echo "+te+_.EOL)}catch(e){r("")}}))}))}{let t="";return new Promise((r=>{process.nextTick((()=>{try{const n=V("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-ExecutionPolicy","Unrestricted","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})});if(n&&!n.pid&&n.on("error",(function(){r(t)})),n&&n.pid){n.stdout.on("data",(function(e){t+=e.toString("utf8")})),n.stderr.on("data",(function(){n.kill(),r(t)})),n.on("close",(function(){n.kill(),r(t)})),n.on("error",(function(){n.kill(),r(t)}));try{n.stdin.write(Q+e+_.EOL),n.stdin.write("exit"+_.EOL),n.stdin.end()}catch(e){n.kill(),r(t)}}else r(t)}catch(e){r(t)}}))}))}}function he(e){null===X&&(X=e);const t={"0002":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0003":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0004":{type:"B",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0005":{type:"B",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"0006":{type:"B",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0007":{type:"A",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0008":{type:"A",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0009":{type:"A",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"000d":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"000e":{type:"B",revision:"2.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"000f":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"0010":{type:"B+",revision:"1.2",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0011":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0012":{type:"A+",revision:"1.1",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0013":{type:"B+",revision:"1.2",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0014":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0015":{type:"A+",revision:"1.1",memory:256,manufacturer:"512MB\tEmbest",processor:"BCM2835"}},r=["BCM2835","BCM2836","BCM2837","BCM2711","BCM2712"],n=["Sony UK","Egoman","Embest","Sony Japan","Embest","Stadium"],i={"00":"A","01":"B","02":"A+","03":"B+","04":"2B","05":"Alpha (early prototype)","06":"CM1","08":"3B","09":"Zero","0a":"CM3","0c":"Zero W","0d":"3B+","0e":"3A+","0f":"Internal use only",10:"CM3+",11:"4B",12:"Zero 2 W",13:"400",14:"CM4",15:"CM4S",17:"5"},s=pe(e,"revision",":",!0),a=pe(e,"model:",":",!0),o=pe(e,"serial",":",!0);let l={};if({}.hasOwnProperty.call(t,s))l={model:a,serial:o,revisionCode:s,memory:t[s].memory,manufacturer:t[s].manufacturer,processor:t[s].processor,type:t[s].type,revision:t[s].revision};else{const t=("00000000"+pe(e,"revision",":",!0).toLowerCase()).substr(-8),u=parseInt((c=t.substr(2,1),("00000000"+parseInt(c,16).toString(2)).substr(-8)).substr(5,3),2)||0,p=n[parseInt(t.substr(3,1),10)],f=r[parseInt(t.substr(4,1),10)],d=t.substr(5,2);l={model:a,serial:o,revisionCode:s,memory:256*Math.pow(2,u),manufacturer:p,processor:f,type:{}.hasOwnProperty.call(i,d)?i[d]:"",revision:"1."+t.substr(7,1)}}var c;return l}function ge(e){return"string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))}L.toInt=function(e){let t=parseInt(e,10);return isNaN(t)&&(t=0),t},L.execOptsWin=ne,L.getCodepage=function(){if(B){if(!j)try{const e=N("chcp",ne),t=e.toString().split("\r\n")[0].split(":");j=t.length>1?t[1].replace(".","").trim():""}catch(e){j="437"}return j}if(M||R||F||G||W){if(!j)try{const e=N("echo $LANG"),t=e.toString().split("\r\n")[0].split(".");j=t.length>1?t[1].trim():"",j||(j="UTF-8")}catch(e){j="UTF-8"}return j}},L.execWin=function(e,t,r){r||(r=t,t=ne),A("chcp 65001 > nul && cmd /C "+e+" && chcp "+j+" > nul",t,(function(e,t){r(e,t)}))},L.isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},L.unique=function(e){let t=[],r={};for(let n=0;n<e.length;n++){let i=Object.keys(e[n]);i.sort((function(e,t){return e-t}));let s="";for(let t=0;t<i.length;t++)s+=JSON.stringify(i[t]),s+=JSON.stringify(e[n][i[t]]);({}).hasOwnProperty.call(r,s)||(t.push(e[n]),r[s]=!0)}return t},L.sortByKey=function(e,t){return e.sort((function(e,r){let n="",i="";return t.forEach((function(t){n+=e[t],i+=r[t]})),n<i?-1:n>i?1:0}))},L.cores=function(){return 0===U&&(U=_.cpus().length),U},L.getValue=pe,L.decodeEscapeSequence=function(e,t){return t=t||16,e.replace(/\\x([0-9A-Fa-f]{2})/g,(function(){return String.fromCharCode(parseInt(arguments[1],t))}))},L.parseDateTime=function(e,t){const r={date:"",time:""};let n=((t=t||{}).dateFormat||"").toLowerCase(),i=t.pmDesignator||"";const s=e.split(" ");if(s[0]){if(s[0].indexOf("/")>=0){const t=s[0].split("/");if(3===t.length)if(4===t[0].length)r.date=t[0]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[2]).substr(-2);else if(2===t[2].length)n.indexOf("/d/")>-1||n.indexOf("/dd/"),r.date="20"+t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2);else{(e.toLowerCase().indexOf("pm")>-1||e.toLowerCase().indexOf("p.m.")>-1||e.toLowerCase().indexOf("p. m.")>-1||e.toLowerCase().indexOf("am")>-1||e.toLowerCase().indexOf("a.m.")>-1||e.toLowerCase().indexOf("a. m.")>-1||n.indexOf("/d/")>-1||n.indexOf("/dd/")>-1)&&0!==n.indexOf("dd/")?r.date=t[2]+"-"+("0"+t[0]).substr(-2)+"-"+("0"+t[1]).substr(-2):r.date=t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2)}}if(s[0].indexOf(".")>=0){const e=s[0].split(".");3===e.length&&(n.indexOf(".d.")>-1||n.indexOf(".dd.")>-1?r.date=e[2]+"-"+("0"+e[0]).substr(-2)+"-"+("0"+e[1]).substr(-2):r.date=e[2]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[0]).substr(-2))}if(s[0].indexOf("-")>=0){const e=s[0].split("-");3===e.length&&(r.date=e[0]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[2]).substr(-2))}}if(s[1]){s.shift();let e=s.join(" ");r.time=function(e,t){t=t||"";let r=0,n=0,i=function(e){let t="",r=0;return e.split("").forEach((e=>{e>="0"&&e<="9"?1===r&&r++:(0===r&&r++,1===r&&(t+=e))})),t}(e=e.toUpperCase()),s=e.split(i);if(s.length>=2){s[2]&&(s[1]+=s[2]);let e=s[1]&&s[1].toLowerCase().indexOf("pm")>-1||s[1].toLowerCase().indexOf("p.m.")>-1||s[1].toLowerCase().indexOf("p. m.")>-1||s[1].toLowerCase().indexOf("n")>-1||s[1].toLowerCase().indexOf("ch")>-1||s[1].toLowerCase().indexOf("ös")>-1||t&&s[1].toLowerCase().indexOf(t)>-1;return r=parseInt(s[0],10),n=parseInt(s[1],10),r=e&&r<12?r+12:r,("0"+r).substr(-2)+":"+("0"+n).substr(-2)}}(e,i)}return r},L.parseHead=function(e,t){let r=t>0,n=1,i=0,s=0,a=[];for(let o=0;o<e.length;o++)n<=t?(/\s/.test(e[o])&&!r&&(s=o-1,a.push({from:i,to:s+1,cap:e.substring(i,s+1)}),i=s+2,n++),r=" "===e[o]):(!/\s/.test(e[o])&&r&&(s=o-1,i<s&&a.push({from:i,to:s,cap:e.substring(i,s)}),i=s+1,n++),r=" "===e[o]);s=5e3,a.push({from:i,to:s,cap:e.substring(i,s)});let o=a.length;for(let e=0;e<o;e++)0===a[e].cap.replace(/\s/g,"").length&&e+1<o&&(a[e].to=a[e+1].to,a[e].cap=a[e].cap+a[e+1].cap,a.splice(e+1,1),o-=1);return a},L.findObjectByKey=function(e,t,r){for(let n=0;n<e.length;n++)if(e[n][t]===r)return n;return-1},L.getWmic=fe,L.wmic=function(e){return new Promise((t=>{process.nextTick((()=>{try{me(fe()+" "+e).then((e=>{t(e,"")}))}catch(e){t("",e)}}))}))},L.darwinXcodeExists=function(){const e=P.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),t=P.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),r=P.existsSync("/Library/Developer/Xcode/");return e||r||t},L.getVboxmanage=function(){return B?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"},L.powerShell=me,L.powerShellStart=function(){K||(K=V("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:D._extend({},process.env,{LANG:"en_US.UTF-8"})}),K&&K.pid&&(J=!0,K.stdout.on("data",(function(e){Y+=e.toString("utf8"),e.indexOf(te)>=0&&(de(Y),Y="")})),K.stderr.on("data",(function(){de(Y+ee)})),K.on("error",(function(){de(Y+ee)})),K.on("close",(function(){K.kill()}))))},L.powerShellRelease=function(){try{K&&(K.stdin.write("exit"+_.EOL),K.stdin.end(),J=!1)}catch(e){K&&K.kill()}K=null},L.execSafe=function(e,t,r){let n="";return r=r||{},new Promise((i=>{process.nextTick((()=>{try{const s=V(e,t,r);s&&!s.pid&&s.on("error",(function(){i(n)})),s&&s.pid?(s.stdout.on("data",(function(e){n+=e.toString()})),s.on("close",(function(){s.kill(),i(n)})),s.on("error",(function(){s.kill(),i(n)}))):i(n)}catch(e){i(n)}}))}))},L.nanoSeconds=function(){const e=process.hrtime();return Array.isArray(e)&&2===e.length?1e9*+e[0]+ +e[1]:0},L.countUniqueLines=function(e,t){t=t||"";const r=[];return e.forEach((e=>{e.startsWith(t)&&-1===r.indexOf(e)&&r.push(e)})),r.length},L.countLines=function(e,t){t=t||"";const r=[];return e.forEach((e=>{e.startsWith(t)&&r.push(e)})),r.length},L.noop=function(){},L.isRaspberry=function(){let e=[];if(null!==X)e=X;else try{e=P.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),X=e}catch(e){return!1}const t=pe(e,"hardware");return t&&["BCM2708","BCM2709","BCM2710","BCM2711","BCM2712","BCM2835","BCM2836","BCM2837","BCM2837B0"].indexOf(t)>-1},L.isRaspbian=function(){let e=[];try{e=P.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split("\n")}catch(e){return!1}const t=pe(e,"id","=");return t&&t.indexOf("raspbian")>-1},L.sanitizeShellString=function(e,t){void 0===t&&(t=!1);const r=e||"";let n="";const i=ue(r.length,2e3);for(let e=0;e<=i;e++)void 0===r[e]||">"===r[e]||"<"===r[e]||"*"===r[e]||"?"===r[e]||"["===r[e]||"]"===r[e]||"|"===r[e]||"˚"===r[e]||"$"===r[e]||";"===r[e]||"&"===r[e]||"]"===r[e]||"#"===r[e]||"\\"===r[e]||"\t"===r[e]||"\n"===r[e]||"\r"===r[e]||"'"===r[e]||"`"===r[e]||'"'===r[e]||r[e].length>1||t&&"("===r[e]||t&&")"===r[e]||t&&"@"===r[e]||t&&" "===r[e]||t&&"{"==r[e]||t&&";"==r[e]||t&&"}"==r[e]||(n+=r[e]);return n},L.isPrototypePolluted=function(){const e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let t=!0,r="";r.__proto__.replace=ie,r.__proto__.toLowerCase=se,r.__proto__.toString=ae,r.__proto__.substr=oe,t=t||!1;const n=Date.now();if("number"==typeof n&&n>16e11){const i=n%100+15;for(let n=0;n<i;n++){const n=61.99999999*Math.random()+1,i=parseInt(Math.floor(n).toString(),10),s=parseInt(n.toString().split(".")[0],10),a=61.99999999*Math.random()+1,o=parseInt(Math.floor(a).toString(),10),l=parseInt(a.toString().split(".")[0],10);t=t&&n!==a,t=t&&i===s&&o===l,r+=e[i-1]}t=t&&r.length===i;let s=Math.random()*i*.9999999999,a=r.substr(0,s)+" "+r.substr(s,2e3);a.__proto__.replace=ie;let o=a.replace(/ /g,"");t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"{"+r.substr(s,2e3),o=a.replace(/{/g,""),t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"*"+r.substr(s,2e3),o=a.replace(/\*/g,""),t=t&&r===o,s=Math.random()*i*.9999999999,a=r.substr(0,s)+"$"+r.substr(s,2e3),o=a.replace(/\$/g,""),t=t&&r===o;const l=r.toLowerCase();t=t&&l.length===i&&l[i-1]&&!l[i];for(let e=0;e<i;e++){const n=r[e];n.__proto__.toLowerCase=se;const i=l?l[e]:"",s=n.toLowerCase();t=t&&s[0]===i&&s[0]&&!s[1]}}return!t},L.decodePiCpuinfo=he,L.getRpiGpu=function(){let e=null;if(null!==X)e=X;else try{e=P.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),X=e}catch(e){return!1}const t=he(e);return"4B"===t.type||"CM4"===t.type||"CM4S"===t.type||"400"===t.type?"VideoCore VI":"5"===t.type?"VideoCore VII":"VideoCore IV"},L.promiseAll=function(e){const t=e.map((function(e){return new Promise((function(t){let r=new Array(2);e.then((function(e){r[0]=e})).catch((function(e){r[1]=e})).then((function(){t(r)}))}))})),r=[],n=[];return Promise.all(t).then((function(e){return e.forEach((function(e){e[1]?(r.push(e[1]),n.push(null)):(r.push(null),n.push(e[0]))})),{errors:r,results:n}}))},L.promisify=function(e){return function(){const t=Array.prototype.slice.call(arguments);return new Promise((function(r,n){t.push((function(e,t){e?n(e):r(t)})),e.apply(null,t)}))}},L.promisifySave=function(e){return function(){const t=Array.prototype.slice.call(arguments);return new Promise((function(r){t.push((function(e,t){r(t)})),e.apply(null,t)}))}},L.smartMonToolsInstalled=function(){if(null!==H)return H;if(H=!1,B)try{const e=N("WHERE smartctl 2>nul",ne).toString().split("\r\n");H=!(!e||!e.length)&&e[0].indexOf(":\\")>=0}catch(e){H=!1}if(M||R||F||G||W)try{const e=N("which smartctl 2>/dev/null",ne).toString().split("\r\n");H=e.length>0}catch(e){D.noop()}return H},L.linuxVersion=function(){let e="";if(M)try{e=N("uname -v").toString()}catch(t){e=""}return e},L.plistParser=function(e){const t=["array","dict","key","string","integer","date","real","data","boolean","arrayEmpty"];let r=e.indexOf("<plist version"),n=e.length;for(;">"!==e[r]&&r<n;)r++;let i=0,s=!1,a=!1,o=!1,l=[{tagStart:"",tagEnd:"",tagContent:"",key:"",data:null}],c="",u=e[r];for(;r<n;)c=u,r+1<n&&(u=e[r+1]),"<"===c?(a=!1,"/"===u?o=!0:l[i].tagStart?(l[i].tagContent="",l[i].data||(l[i].data="array"===l[i].tagStart?[]:{}),i++,l.push({tagStart:"",tagEnd:"",tagContent:"",key:null,data:null}),s=!0,a=!1):s||(s=!0)):">"===c?("true/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/boolean",l[i].data=!0),"false/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/boolean",l[i].data=!1),"array/"===l[i].tagStart&&(s=!1,o=!0,l[i].tagStart="",l[i].tagEnd="/arrayEmpty",l[i].data=[]),a&&(a=!1),s&&(s=!1,a=!0,"array"===l[i].tagStart&&(l[i].data=[]),"dict"===l[i].tagStart&&(l[i].data={})),o&&(o=!1,l[i].tagEnd&&t.indexOf(l[i].tagEnd.substr(1))>=0&&("/dict"===l[i].tagEnd||"/array"===l[i].tagEnd?(i>1&&"array"===l[i-2].tagStart&&l[i-2].data.push(l[i-1].data),i>1&&"dict"===l[i-2].tagStart&&(l[i-2].data[l[i-1].key]=l[i-1].data),i--,l.pop(),l[i].tagContent="",l[i].tagStart="",l[i].tagEnd=""):("/key"===l[i].tagEnd&&l[i].tagContent?l[i].key=l[i].tagContent:("/real"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=parseFloat(l[i].tagContent)||0),"/integer"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=parseInt(l[i].tagContent)||0),"/string"===l[i].tagEnd&&l[i].tagContent&&(l[i].data=l[i].tagContent||""),"/boolean"===l[i].tagEnd&&(l[i].data=l[i].tagContent||!1),"/arrayEmpty"===l[i].tagEnd&&(l[i].data=l[i].tagContent||[]),i>0&&"array"===l[i-1].tagStart&&l[i-1].data.push(l[i].data),i>0&&"dict"===l[i-1].tagStart&&(l[i-1].data[l[i].key]=l[i].data)),l[i].tagContent="",l[i].tagStart="",l[i].tagEnd="")),l[i].tagEnd="",s=!1,a=!1)):(s&&(l[i].tagStart+=c),o&&(l[i].tagEnd+=c),a&&(l[i].tagContent+=c)),r++;return l[0].data},L.plistReader=function(e){const t=e.split("\n");for(let e=0;e<t.length;e++){if(t[e].indexOf(" = ")>=0){const r=t[e].split(" = ");if(r[0]=r[0].trim(),r[0].startsWith('"')||(r[0]='"'+r[0]+'"'),r[1]=r[1].trim(),-1===r[1].indexOf('"')&&r[1].endsWith(";")){const e=r[1].substring(0,r[1].length-1);ge(e)||(r[1]=`"${e}";`)}if(r[1].indexOf('"')>=0&&r[1].endsWith(";")){const e=r[1].substring(0,r[1].length-1).replace(/"/g,"");ge(e)&&(r[1]=`${e};`)}t[e]=r.join(" : ")}t[e]=t[e].replace(/\(/g,"[").replace(/\)/g,"]").replace(/;/g,",").trim(),t[e].startsWith("}")&&t[e-1]&&t[e-1].endsWith(",")&&(t[e-1]=t[e-1].substring(0,t[e-1].length-1))}e=t.join("");let r={};try{r=JSON.parse(e)}catch(e){}return r},L.stringReplace=ie,L.stringToLower=se,L.stringToString=ae,L.stringSubstr=oe,L.stringTrim=le,L.stringStartWith=ce,L.mathMin=ue,L.WINDIR=z,L.getFilesInPath=function(e){const t=P.lstatSync,r=P.readdirSync,n=T.join;function i(e){return t(e).isDirectory()}function s(e){return t(e).isFile()}return P.existsSync(e)?function e(t){try{let a=function(e){return r(e).map((function(t){return n(e,t)})).filter(i)}(t);return a.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)}),[]).concat(function(e){return r(e).map((function(t){return n(e,t)})).filter(s)}(t))}catch(e){return[]}}(e):[]},L.semverCompare=function(e,t){let r=0;const n=e.split("."),i=t.split(".");return n[0]<i[0]?r=1:n[0]>i[0]?r=-1:n[0]===i[0]&&n.length>=2&&i.length>=2&&(n[1]<i[1]?r=1:n[1]>i[1]?r=-1:n[1]===i[1]&&(n.length>=3&&i.length>=3?n[2]<i[2]?r=1:n[2]>i[2]&&(r=-1):i.length>=3&&(r=1))),r};var ye={};const ve=h.default,Se=m.default,we=L,xe=y.default.exec,Ce=y.default.execSync,Oe=we.promisify(y.default.exec);let Ie=process.platform;const be="linux"===Ie||"android"===Ie,Ee="darwin"===Ie,Le="win32"===Ie,_e="freebsd"===Ie,Pe="openbsd"===Ie,Te="netbsd"===Ie,Ve="sunos"===Ie;function Ae(e){const t=e.toLowerCase();return-1===t.indexOf("o.e.m.")&&-1===t.indexOf("default string")&&"default"!==t&&e||""}ye.system=function(e){return new Promise((t=>{process.nextTick((()=>{let r={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((be||_e||Pe||Te)&&xe("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",(function(n,i){let s=i.toString().split("\n");r.manufacturer=we.getValue(s,"manufacturer"),r.model=we.getValue(s,"product name"),r.version=we.getValue(s,"version"),r.serial=we.getValue(s,"serial number"),r.uuid=we.getValue(s,"uuid").toLowerCase(),r.sku=we.getValue(s,"sku number");try{s=Ce('echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;\n echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;\n echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;\n echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;\n echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;').toString().split("\n"),r.manufacturer=""===r.manufacturer?we.getValue(s,"sys_vendor"):r.manufacturer,r.model=""===r.model?we.getValue(s,"product_name"):r.model,r.version=""===r.version?we.getValue(s,"product_version"):r.version,r.serial=""===r.serial?we.getValue(s,"product_serial"):r.serial,r.uuid=""===r.uuid?we.getValue(s,"product_uuid").toLowerCase():r.uuid}catch(e){we.noop()}if(r.serial&&-1===r.serial.toLowerCase().indexOf("o.e.m.")||(r.serial="-"),r.manufacturer&&-1===r.manufacturer.toLowerCase().indexOf("o.e.m.")||(r.manufacturer=""),r.model&&-1===r.model.toLowerCase().indexOf("o.e.m.")||(r.model="Computer"),r.version&&-1===r.version.toLowerCase().indexOf("o.e.m.")||(r.version=""),r.sku&&-1===r.sku.toLowerCase().indexOf("o.e.m.")||(r.sku="-"),"virtualbox"===r.model.toLowerCase()||"kvm"===r.model.toLowerCase()||"virtual machine"===r.model.toLowerCase()||"bochs"===r.model.toLowerCase()||r.model.toLowerCase().startsWith("vmware")||r.model.toLowerCase().startsWith("droplet"))switch(r.virtual=!0,r.model.toLowerCase()){case"virtualbox":r.virtualHost="VirtualBox";break;case"vmware":r.virtualHost="VMware";break;case"kvm":r.virtualHost="KVM";break;case"bochs":r.virtualHost="bochs"}if(r.manufacturer.toLowerCase().startsWith("vmware")||"xen"===r.manufacturer.toLowerCase())switch(r.virtual=!0,r.manufacturer.toLowerCase()){case"vmware":r.virtualHost="VMware";break;case"xen":r.virtualHost="Xen"}if(!r.virtual)try{const e=Ce("ls -1 /dev/disk/by-id/ 2>/dev/null").toString();e.indexOf("_QEMU_")>=0&&(r.virtual=!0,r.virtualHost="QEMU"),e.indexOf("_VBOX_")>=0&&(r.virtual=!0,r.virtualHost="VirtualBox")}catch(e){we.noop()}if(!r.virtual&&(Se.release().toLowerCase().indexOf("microsoft")>=0||Se.release().toLowerCase().endsWith("wsl2"))){const e=parseFloat(Se.release().toLowerCase());r.virtual=!0,r.manufacturer="Microsoft",r.model="WSL",r.version=e<4.19?"1":"2"}if((_e||Pe||Te)&&!r.virtualHost)try{const e=Ce("dmidecode -t 4").toString().split("\n");switch(we.getValue(e,"manufacturer",":",!0).toLowerCase()){case"virtualbox":r.virtualHost="VirtualBox";break;case"vmware":r.virtualHost="VMware";break;case"kvm":r.virtualHost="KVM";break;case"bochs":r.virtualHost="bochs"}}catch(e){we.noop()}(ve.existsSync("/.dockerenv")||ve.existsSync("/.dockerinit"))&&(r.model="Docker Container");try{const e=Ce('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');e.toString().split("\n").length>0&&("Computer"===r.model&&(r.model="Virtual machine"),r.virtual=!0,e.toString().toLowerCase().indexOf("vmware")>=0&&!r.virtualHost&&(r.virtualHost="VMware"),e.toString().toLowerCase().indexOf("qemu")>=0&&!r.virtualHost&&(r.virtualHost="QEMU"),e.toString().toLowerCase().indexOf("xen")>=0&&!r.virtualHost&&(r.virtualHost="Xen"),e.toString().toLowerCase().indexOf("kvm")>=0&&!r.virtualHost&&(r.virtualHost="KVM"))}catch(e){we.noop()}""===r.manufacturer&&"Computer"===r.model&&""===r.version?ve.readFile("/proc/cpuinfo",(function(n,i){if(!n){let e=i.toString().split("\n");r.model=we.getValue(e,"hardware",":",!0).toUpperCase(),r.version=we.getValue(e,"revision",":",!0).toLowerCase(),r.serial=we.getValue(e,"serial",":",!0);const t=we.getValue(e,"model:",":",!0);if(("BCM2835"===r.model||"BCM2708"===r.model||"BCM2709"===r.model||"BCM2710"===r.model||"BCM2711"===r.model||"BCM2836"===r.model||"BCM2837"===r.model)&&t.toLowerCase().indexOf("raspberry")>=0){const t=we.decodePiCpuinfo(e);r.model=t.model,r.version=t.revisionCode,r.manufacturer="Raspberry Pi Foundation",r.raspberry={manufacturer:t.manufacturer,processor:t.processor,type:t.type,revision:t.revision}}}e&&e(r),t(r)})):(e&&e(r),t(r))})),Ee&&xe("ioreg -c IOPlatformExpertDevice -d 2",(function(n,i){if(!n){let e=i.toString().replace(/[<>"]/g,"").split("\n");r.manufacturer=we.getValue(e,"manufacturer","=",!0),r.model=we.getValue(e,"model","=",!0,!0),r.version=we.getValue(e,"version","=",!0),r.serial=we.getValue(e,"ioplatformserialnumber","=",!0),r.uuid=we.getValue(e,"ioplatformuuid","=",!0).toLowerCase(),r.sku=we.getValue(e,"board-id","=",!0)}e&&e(r),t(r)})),Ve&&(e&&e(r),t(r)),Le)try{we.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then(((n,i)=>{if(i)e&&e(r),t(r);else{let i=n.split("\r\n");r.manufacturer=we.getValue(i,"vendor",":"),r.model=we.getValue(i,"name",":"),r.version=we.getValue(i,"version",":"),r.serial=we.getValue(i,"identifyingnumber",":"),r.uuid=we.getValue(i,"uuid",":").toLowerCase();const s=r.model.toLowerCase();("virtualbox"===s||"kvm"===s||"virtual machine"===s||"bochs"===s||s.startsWith("vmware")||s.startsWith("qemu")||s.startsWith("parallels"))&&(r.virtual=!0,s.startsWith("virtualbox")&&(r.virtualHost="VirtualBox"),s.startsWith("vmware")&&(r.virtualHost="VMware"),s.startsWith("kvm")&&(r.virtualHost="KVM"),s.startsWith("bochs")&&(r.virtualHost="bochs"),s.startsWith("qemu")&&(r.virtualHost="KVM"),s.startsWith("parallels")&&(r.virtualHost="Parallels"));const a=r.manufacturer.toLowerCase();(a.startsWith("vmware")||a.startsWith("qemu")||"xen"===a||a.startsWith("parallels"))&&(r.virtual=!0,a.startsWith("vmware")&&(r.virtualHost="VMware"),a.startsWith("xen")&&(r.virtualHost="Xen"),a.startsWith("qemu")&&(r.virtualHost="KVM"),a.startsWith("parallels")&&(r.virtualHost="Parallels")),we.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then(((n,i)=>{if(!i){let e=n.split("\r\n");r.sku=we.getValue(e,"systemsku",":")}r.virtual?(e&&e(r),t(r)):we.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then(((n,i)=>{if(i)e&&e(r),t(r);else{let i=n.toString();(i.indexOf("VRTUAL")>=0||i.indexOf("A M I ")>=0||i.indexOf("VirtualBox")>=0||i.indexOf("VMWare")>=0||i.indexOf("Xen")>=0||i.indexOf("Parallels")>=0)&&(r.virtual=!0,i.indexOf("VirtualBox")>=0&&!r.virtualHost&&(r.virtualHost="VirtualBox"),i.indexOf("VMware")>=0&&!r.virtualHost&&(r.virtualHost="VMware"),i.indexOf("Xen")>=0&&!r.virtualHost&&(r.virtualHost="Xen"),i.indexOf("VRTUAL")>=0&&!r.virtualHost&&(r.virtualHost="Hyper-V"),i.indexOf("A M I")>=0&&!r.virtualHost&&(r.virtualHost="Virtual PC"),i.indexOf("Parallels")>=0&&!r.virtualHost&&(r.virtualHost="Parallels")),e&&e(r),t(r)}}))}))}}))}catch(n){e&&e(r),t(r)}}))}))},ye.bios=function(e){return new Promise((t=>{process.nextTick((()=>{let r={vendor:"",version:"",releaseDate:"",revision:""},n="";if((be||_e||Pe||Te)&&(n="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL",xe(n,(function(n,i){let s=i.toString().split("\n");r.vendor=we.getValue(s,"Vendor"),r.version=we.getValue(s,"Version");let a=we.getValue(s,"Release Date");r.releaseDate=we.parseDateTime(a).date,r.revision=we.getValue(s,"BIOS Revision"),r.serial=we.getValue(s,"SerialNumber");let o=we.getValue(s,"Currently Installed Language").split("|")[0];if(o&&(r.language=o),s.length&&i.toString().indexOf("Characteristics:")>=0){const e=[];s.forEach((t=>{if(t.indexOf(" is supported")>=0){const r=t.split(" is supported")[0].trim();e.push(r)}})),r.features=e}try{s=Ce('echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;\n echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;\n echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;').toString().split("\n"),r.vendor=r.vendor?r.vendor:we.getValue(s,"bios_vendor"),r.version=r.version?r.version:we.getValue(s,"bios_version"),a=we.getValue(s,"bios_date"),r.releaseDate=r.releaseDate?r.releaseDate:we.parseDateTime(a).date}catch(e){we.noop()}e&&e(r),t(r)}))),Ee&&(r.vendor="Apple Inc.",xe("system_profiler SPHardwareDataType -json",(function(n,i){try{const e=JSON.parse(i.toString());if(e&&e.SPHardwareDataType&&e.SPHardwareDataType.length){let t=e.SPHardwareDataType[0].boot_rom_version;t=t?t.split("(")[0].trim():null,r.version=t}}catch(e){we.noop()}e&&e(r),t(r)}))),Ve&&(r.vendor="Sun Microsystems",e&&e(r),t(r)),Le)try{we.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then(((n,i)=>{if(!i){let e=n.toString().split("\r\n");const t=we.getValue(e,"description",":"),i=we.getValue(e,"SMBIOSBIOSVersion",":");-1!==t.indexOf(" Version ")?(r.vendor=t.split(" Version ")[0].trim(),r.version=t.split(" Version ")[1].trim()):-1!==t.indexOf(" Ver: ")?(r.vendor=we.getValue(e,"manufacturer",":"),r.version=t.split(" Ver: ")[1].trim()):(r.vendor=we.getValue(e,"manufacturer",":"),r.version=i||we.getValue(e,"version",":")),r.releaseDate=we.getValue(e,"releasedate",":"),r.revision=we.getValue(e,"buildnumber",":"),r.serial=Ae(we.getValue(e,"serialnumber",":"))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},ye.baseboard=function(e){return new Promise((t=>{process.nextTick((()=>{let r={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},n="";if(be||_e||Pe||Te){n="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";const i=[];i.push(Oe(n)),i.push(Oe("export LC_ALL=C; dmidecode -t memory 2>/dev/null")),we.promiseAll(i).then((n=>{let i=n.results[0]?n.results[0].toString().split("\n"):[""];r.manufacturer=we.getValue(i,"Manufacturer"),r.model=we.getValue(i,"Product Name"),r.version=we.getValue(i,"Version"),r.serial=we.getValue(i,"Serial Number"),r.assetTag=we.getValue(i,"Asset Tag");try{i=Ce('echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;\n echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;\n echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;\n echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;\n echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;').toString().split("\n"),r.manufacturer=r.manufacturer?r.manufacturer:we.getValue(i,"board_vendor"),r.model=r.model?r.model:we.getValue(i,"board_name"),r.version=r.version?r.version:we.getValue(i,"board_version"),r.serial=r.serial?r.serial:we.getValue(i,"board_serial"),r.assetTag=r.assetTag?r.assetTag:we.getValue(i,"board_asset_tag")}catch(e){we.noop()}-1!==r.serial.toLowerCase().indexOf("o.e.m.")&&(r.serial="-"),-1!==r.assetTag.toLowerCase().indexOf("o.e.m.")&&(r.assetTag="-"),i=n.results[1]?n.results[1].toString().split("\n"):[""],r.memMax=1024*we.toInt(we.getValue(i,"Maximum Capacity"))*1024*1024||null,r.memSlots=we.toInt(we.getValue(i,"Number Of Devices"))||null;let s="";try{s=ve.readFileSync("/proc/cpuinfo").toString().split("\n")}catch(e){we.noop()}if(s){if(we.getValue(s,"hardware").startsWith("BCM")){const e=we.decodePiCpuinfo(s);r.manufacturer=e.manufacturer,r.model="Raspberry Pi",r.serial=e.serial,r.version=e.type+" - "+e.revision,r.memMax=Se.totalmem(),r.memSlots=0}}e&&e(r),t(r)}))}if(Ee){const n=[];n.push(Oe("ioreg -c IOPlatformExpertDevice -d 2")),n.push(Oe("system_profiler SPMemoryDataType")),we.promiseAll(n).then((n=>{let i=n.results[0]?n.results[0].toString().replace(/[<>"]/g,"").split("\n"):[""];r.manufacturer=we.getValue(i,"manufacturer","=",!0),r.model=we.getValue(i,"model","=",!0),r.version=we.getValue(i,"version","=",!0),r.serial=we.getValue(i,"ioplatformserialnumber","=",!0),r.assetTag=we.getValue(i,"board-id","=",!0);let s=n.results[1]?n.results[1].toString().split(" BANK "):[""];1===s.length&&(s=n.results[1]?n.results[1].toString().split(" DIMM"):[""]),s.shift(),r.memSlots=s.length,"arm64"===Se.arch()&&(r.memSlots=0,r.memMax=Se.totalmem()),e&&e(r),t(r)}))}if(Ve&&(e&&e(r),t(r)),Le)try{const n=[],i=parseInt(Se.release())>=10,s=i?"MaxCapacityEx":"MaxCapacity";n.push(we.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")),n.push(we.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${s}, MemoryDevices | fl`)),we.promiseAll(n).then((n=>{let a=n.results[0]?n.results[0].toString().split("\r\n"):[""];r.manufacturer=Ae(we.getValue(a,"manufacturer",":")),r.model=Ae(we.getValue(a,"model",":")),r.model||(r.model=Ae(we.getValue(a,"product",":"))),r.version=Ae(we.getValue(a,"version",":")),r.serial=Ae(we.getValue(a,"serialnumber",":")),r.assetTag=Ae(we.getValue(a,"partnumber",":")),r.assetTag||(r.assetTag=Ae(we.getValue(a,"sku",":"))),a=n.results[1]?n.results[1].toString().split("\r\n"):[""],r.memMax=we.toInt(we.getValue(a,s,":"))*(i?1024:1)||null,r.memSlots=we.toInt(we.getValue(a,"MemoryDevices",":"))||null,e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},ye.chassis=function(e){const t=["Other","Unknown","Desktop","Low Profile Desktop","Pizza Box","Mini Tower","Tower","Portable","Laptop","Notebook","Hand Held","Docking Station","All in One","Sub Notebook","Space-Saving","Lunch Box","Main System Chassis","Expansion Chassis","SubChassis","Bus Expansion Chassis","Peripheral Chassis","Storage Chassis","Rack Mount Chassis","Sealed-Case PC","Multi-System Chassis","Compact PCI","Advanced TCA","Blade","Blade Enclosure","Tablet","Convertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise((r=>{process.nextTick((()=>{let n={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if(be||_e||Pe||Te){xe('echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;\n echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;\n echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;\n echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;\n echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;',(function(i,s){let a=s.toString().split("\n");n.manufacturer=we.getValue(a,"chassis_vendor");const o=parseInt(we.getValue(a,"chassis_type").replace(/\D/g,""));n.type=o&&!isNaN(o)&&o<t.length?t[o-1]:"",n.version=we.getValue(a,"chassis_version"),n.serial=we.getValue(a,"chassis_serial"),n.assetTag=we.getValue(a,"chassis_asset_tag"),-1!==n.manufacturer.toLowerCase().indexOf("o.e.m.")&&(n.manufacturer="-"),-1!==n.version.toLowerCase().indexOf("o.e.m.")&&(n.version="-"),-1!==n.serial.toLowerCase().indexOf("o.e.m.")&&(n.serial="-"),-1!==n.assetTag.toLowerCase().indexOf("o.e.m.")&&(n.assetTag="-"),e&&e(n),r(n)}))}if(Ee&&xe("ioreg -c IOPlatformExpertDevice -d 2",(function(t,i){if(!t){let e=i.toString().replace(/[<>"]/g,"").split("\n");n.manufacturer=we.getValue(e,"manufacturer","=",!0),n.model=we.getValue(e,"model","=",!0),n.version=we.getValue(e,"version","=",!0),n.serial=we.getValue(e,"ioplatformserialnumber","=",!0),n.assetTag=we.getValue(e,"board-id","=",!0)}e&&e(n),r(n)})),Ve&&(e&&e(n),r(n)),Le)try{we.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then(((i,s)=>{if(!s){let e=i.toString().split("\r\n");n.manufacturer=Ae(we.getValue(e,"manufacturer",":")),n.model=Ae(we.getValue(e,"model",":"));const r=parseInt(we.getValue(e,"ChassisTypes",":").replace(/\D/g,""));n.type=r&&!isNaN(r)&&r<t.length?t[r-1]:"",n.version=Ae(we.getValue(e,"version",":")),n.serial=Ae(we.getValue(e,"serialnumber",":")),n.assetTag=Ae(we.getValue(e,"partnumber",":")),n.assetTag||(n.assetTag=Ae(we.getValue(e,"SMBIOSAssetTag",":"))),n.sku=Ae(we.getValue(e,"sku",":"))}e&&e(n),r(n)}))}catch(t){e&&e(n),r(n)}}))}))};var Ne={};const De=m.default,ke=h.default,Me=L,Re=y.default.exec,Be=y.default.execSync;let Fe=process.platform;const Ge="linux"===Fe||"android"===Fe,We="darwin"===Fe,Ue="win32"===Fe,$e="freebsd"===Fe,je="openbsd"===Fe,He="netbsd"===Fe,Xe="sunos"===Fe;function ze(e){e=(e=e||"").toLowerCase();let t=Fe;return Ue?t="windows":-1!==e.indexOf("mac os")?t="apple":-1!==e.indexOf("arch")?t="arch":-1!==e.indexOf("centos")?t="centos":-1!==e.indexOf("coreos")?t="coreos":-1!==e.indexOf("debian")?t="debian":-1!==e.indexOf("deepin")?t="deepin":-1!==e.indexOf("elementary")?t="elementary":-1!==e.indexOf("fedora")?t="fedora":-1!==e.indexOf("gentoo")?t="gentoo":-1!==e.indexOf("mageia")?t="mageia":-1!==e.indexOf("mandriva")?t="mandriva":-1!==e.indexOf("manjaro")?t="manjaro":-1!==e.indexOf("mint")?t="mint":-1!==e.indexOf("mx")?t="mx":-1!==e.indexOf("openbsd")?t="openbsd":-1!==e.indexOf("freebsd")?t="freebsd":-1!==e.indexOf("opensuse")?t="opensuse":-1!==e.indexOf("pclinuxos")?t="pclinuxos":-1!==e.indexOf("puppy")?t="puppy":-1!==e.indexOf("raspbian")?t="raspbian":-1!==e.indexOf("reactos")?t="reactos":-1!==e.indexOf("redhat")?t="redhat":-1!==e.indexOf("slackware")?t="slackware":-1!==e.indexOf("sugar")?t="sugar":-1!==e.indexOf("steam")?t="steam":-1!==e.indexOf("suse")?t="suse":-1!==e.indexOf("mate")?t="ubuntu-mate":-1!==e.indexOf("lubuntu")?t="lubuntu":-1!==e.indexOf("xubuntu")?t="xubuntu":-1!==e.indexOf("ubuntu")?t="ubuntu":-1!==e.indexOf("solaris")?t="solaris":-1!==e.indexOf("tails")?t="tails":-1!==e.indexOf("feren")?t="ferenos":-1!==e.indexOf("robolinux")?t="robolinux":Ge&&e&&(t=e.toLowerCase().trim().replace(/\s+/g,"-")),t}function Ke(){let e=De.hostname;if(Ge||We)try{const t=Be("hostnamectl --json short 2>/dev/null");e=JSON.parse(t.toString()).StaticHostname}catch(t){try{e=Be("hostname -f 2>/dev/null").toString().split(De.EOL)[0]}catch(e){Me.noop()}}if($e||je||He)try{e=Be("hostname 2>/dev/null").toString().split(De.EOL)[0]}catch(e){Me.noop()}if(Ue)try{e=Be("echo %COMPUTERNAME%.%USERDNSDOMAIN%",Me.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(De.EOL)[0]}catch(e){Me.noop()}return e}function Ye(){let e=[];try{const t=De.networkInterfaces();for(let r in t)({}).hasOwnProperty.call(t,r)&&t[r].forEach((function(t){if(t&&t.mac&&"00:00:00:00:00:00"!==t.mac){const r=t.mac.toLowerCase();-1===e.indexOf(r)&&e.push(r)}}));e=e.sort((function(e,t){return e<t?-1:e>t?1:0}))}catch(t){e.push("00:00:00:00:00:00")}return e}function qe(e){return new Promise((t=>{process.nextTick((()=>{let r,n={os:"",hardware:"",macs:Ye()};if(We&&Re("system_profiler SPHardwareDataType -json",(function(r,i){if(!r)try{const e=JSON.parse(i.toString());if(e.SPHardwareDataType&&e.SPHardwareDataType.length>0){const t=e.SPHardwareDataType[0];n.os=t.platform_UUID.toLowerCase(),n.hardware=t.serial_number}}catch(e){Me.noop()}e&&e(n),t(n)})),Ge){Re('echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null; echo;\necho -n "os: "; cat /etc/machine-id 2> /dev/null; echo;\necho -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;',(function(r,i){const s=i.toString().split("\n");if(n.os=Me.getValue(s,"os").toLowerCase(),n.hardware=Me.getValue(s,"hardware").toLowerCase(),!n.hardware){const e=ke.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),t=Me.getValue(e,"serial");n.hardware=t||""}e&&e(n),t(n)}))}if(($e||je||He)&&Re("sysctl -i kern.hostid kern.hostuuid",(function(r,i){const s=i.toString().split("\n");n.os=Me.getValue(s,"kern.hostid",":").toLowerCase(),n.hardware=Me.getValue(s,"kern.hostuuid",":").toLowerCase(),n.os.indexOf("unknown")>=0&&(n.os=""),n.hardware.indexOf("unknown")>=0&&(n.hardware=""),e&&e(n),t(n)})),Ue){let i="%windir%\\System32";"ia32"===process.arch&&Object.prototype.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")&&(i="%windir%\\sysnative\\cmd.exe /c %windir%\\System32"),Me.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then((s=>{let a=s.split("\r\n");n.hardware=Me.getValue(a,"uuid",":").toLowerCase(),Re(`${i}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`,Me.execOptsWin,(function(i,s){r=s.toString().split("\n\r")[0].split("REG_SZ"),n.os=r.length>1?r[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase():"",e&&e(n),t(n)}))}))}}))}))}Ne.time=function(){let e=(new Date).toString().split(" ");return{current:Date.now(),uptime:De.uptime(),timezone:e.length>=7?e[5]:"",timezoneName:Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:e.length>=7?e.slice(6).join(" ").replace(/\(/g,"").replace(/\)/g,""):""}},Ne.osInfo=function(e){return new Promise((t=>{process.nextTick((()=>{let r={platform:"win32"===Fe?"Windows":Fe,distro:"unknown",release:"unknown",codename:"",kernel:De.release(),arch:De.arch(),hostname:De.hostname(),fqdn:Ke(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(Ge&&Re("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",(function(n,i){let s={};i.toString().split("\n").forEach((function(e){-1!==e.indexOf("=")&&(s[e.split("=")[0].trim().toUpperCase()]=e.split("=")[1].trim())})),r.distro=(s.DISTRIB_ID||s.NAME||"unknown").replace(/"/g,""),r.logofile=ze(r.distro);let a=(s.VERSION||"").replace(/"/g,""),o=(s.DISTRIB_CODENAME||s.VERSION_CODENAME||"").replace(/"/g,"");const l=(s.PRETTY_NAME||"").replace(/"/g,"");0===l.indexOf(r.distro+" ")&&(a=l.replace(r.distro+" ","").trim()),a.indexOf("(")>=0&&(o=a.split("(")[1].replace(/[()]/g,"").trim(),a=a.split("(")[0].trim()),r.release=(a||s.DISTRIB_RELEASE||s.VERSION_ID||"unknown").replace(/"/g,""),r.codename=o,r.codepage=Me.getCodepage(),r.build=(s.BUILD_ID||"").replace(/"/g,"").trim(),new Promise((e=>{process.nextTick((()=>{ke.stat("/sys/firmware/efi",(function(t){if(!t)return e(!0);Re('dmesg | grep -E "EFI v"',(function(t,r){if(!t){const t=r.toString().split("\n");return e(t.length>0)}return e(!1)}))}))}))})).then((n=>{r.uefi=n,qe().then((n=>{r.serial=n.os,e&&e(r),t(r)}))}))})),($e||je||He)&&Re("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml",(function(n,i){let s=i.toString().split("\n");const a=Me.getValue(s,"kern.ostype"),o=ze(a),l=Me.getValue(s,"kern.osrelease").split("-")[0],c=Me.getValue(s,"kern.uuid"),u=Me.getValue(s,"machdep.bootmethod"),p=i.toString().indexOf("<type>efi</type>")>=0,f=u?u.toLowerCase().indexOf("uefi")>=0:p||null;r.distro=a||r.distro,r.logofile=o||r.logofile,r.release=l||r.release,r.serial=c||r.serial,r.codename="",r.codepage=Me.getCodepage(),r.uefi=f||null,e&&e(r),t(r)})),We&&Re("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",(function(n,i){let s=i.toString().split("\n");r.serial=Me.getValue(s,"kern.uuid"),r.distro=Me.getValue(s,"ProductName"),r.release=(Me.getValue(s,"ProductVersion",":",!0,!0)+" "+Me.getValue(s,"ProductVersionExtra",":",!0,!0)).trim(),r.build=Me.getValue(s,"BuildVersion"),r.logofile=ze(r.distro),r.codename="macOS",r.codename=r.release.indexOf("10.4")>-1?"Mac OS X Tiger":r.codename,r.codename=r.release.indexOf("10.5")>-1?"Mac OS X Leopard":r.codename,r.codename=r.release.indexOf("10.6")>-1?"Mac OS X Snow Leopard":r.codename,r.codename=r.release.indexOf("10.7")>-1?"Mac OS X Lion":r.codename,r.codename=r.release.indexOf("10.8")>-1?"OS X Mountain Lion":r.codename,r.codename=r.release.indexOf("10.9")>-1?"OS X Mavericks":r.codename,r.codename=r.release.indexOf("10.10")>-1?"OS X Yosemite":r.codename,r.codename=r.release.indexOf("10.11")>-1?"OS X El Capitan":r.codename,r.codename=r.release.indexOf("10.12")>-1?"macOS Sierra":r.codename,r.codename=r.release.indexOf("10.13")>-1?"macOS High Sierra":r.codename,r.codename=r.release.indexOf("10.14")>-1?"macOS Mojave":r.codename,r.codename=r.release.indexOf("10.15")>-1?"macOS Catalina":r.codename,r.codename=r.release.startsWith("11.")?"macOS Big Sur":r.codename,r.codename=r.release.startsWith("12.")?"macOS Monterey":r.codename,r.codename=r.release.startsWith("13.")?"macOS Ventura":r.codename,r.codename=r.release.startsWith("14.")?"macOS Sonoma":r.codename,r.uefi=!0,r.codepage=Me.getCodepage(),e&&e(r),t(r)})),Xe&&(r.release=r.kernel,Re("uname -o",(function(n,i){let s=i.toString().split("\n");r.distro=s[0],r.logofile=ze(r.distro),e&&e(r),t(r)}))),Ue){r.logofile=ze(),r.release=r.kernel;try{const n=[];n.push(Me.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")),n.push(Me.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),n.push(Me.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),Me.promiseAll(n).then((n=>{let i=n.results[0]?n.results[0].toString().split("\r\n"):[""];r.distro=Me.getValue(i,"Caption",":").trim(),r.serial=Me.getValue(i,"SerialNumber",":").trim(),r.build=Me.getValue(i,"BuildNumber",":").trim(),r.servicepack=Me.getValue(i,"ServicePackMajorVersion",":").trim()+"."+Me.getValue(i,"ServicePackMinorVersion",":").trim(),r.codepage=Me.getCodepage();const s=n.results[1]?n.results[1].toString().toLowerCase():"";r.hypervisor=-1!==s.indexOf("true");const a=n.results[2]?n.results[2].toString():"";r.remoteSession=a.toString().toLowerCase().indexOf("true")>=0,new Promise((e=>{process.nextTick((()=>{try{Re('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',Me.execOptsWin,(function(t,r){if(!t){const t=r.toString().split("\n\r")[0];return e(t.toLowerCase().indexOf("efi")>=0)}Re("echo %firmware_type%",Me.execOptsWin,(function(t,r){if(t)return e(!1);{const t=r.toString()||"";return e(t.toLowerCase().indexOf("efi")>=0)}}))}))}catch(t){return e(!1)}}))})).then((n=>{r.uefi=n,e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}}}))}))},Ne.versions=function(e,t){let r={kernel:De.release(),openssl:"",systemOpenssl:"",systemOpensslLib:"",node:process.versions.node,v8:process.versions.v8,npm:"",yarn:"",pm2:"",gulp:"",grunt:"",git:"",tsc:"",mysql:"",redis:"",mongodb:"",apache:"",nginx:"",php:"",docker:"",postfix:"",postgresql:"",perl:"",python:"",python3:"",pip:"",pip3:"",java:"",gcc:"",virtualbox:"",bash:"",zsh:"",fish:"",powershell:"",dotnet:""};return new Promise((n=>{process.nextTick((()=>{if(Me.isFunction(e)&&!t)t=e,e="*";else if("string"!=typeof(e=e||"*"))return t&&t({}),n({});const i=function(e){if("*"===e)return{versions:r,counter:30};if(!Array.isArray(e)){e=(e=e.trim().toLowerCase().replace(/,+/g,"|").replace(/ /g,"|")).split("|");const t={versions:{},counter:0};return e.forEach((e=>{if(e)for(let n in r)({}).hasOwnProperty.call(r,n)&&(n.toLowerCase()!==e.toLowerCase()||{}.hasOwnProperty.call(t.versions,n)||(t.versions[n]=r[n],"openssl"===n&&(t.versions.systemOpenssl="",t.versions.systemOpensslLib=""),t.versions[n]||t.counter++))})),t}}(e);let s=i.counter,a=function(){0==--s&&(t&&t(i.versions),n(i.versions))},o="";try{if({}.hasOwnProperty.call(i.versions,"openssl")&&(i.versions.openssl=process.versions.openssl,Re("openssl version",(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim().split(" ");i.versions.systemOpenssl=e.length>0?e[1]:e[0],i.versions.systemOpensslLib=e.length>0?e[0]:"openssl"}a()}))),{}.hasOwnProperty.call(i.versions,"npm")&&Re("npm -v",(function(e,t){e||(i.versions.npm=t.toString().split("\n")[0]),a()})),{}.hasOwnProperty.call(i.versions,"pm2")&&(o="pm2",Ue&&(o+=".cmd"),Re(`${o} -v`,(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim();e.startsWith("[PM2]")||(i.versions.pm2=e)}a()}))),{}.hasOwnProperty.call(i.versions,"yarn")&&Re("yarn --version",(function(e,t){e||(i.versions.yarn=t.toString().split("\n")[0]),a()})),{}.hasOwnProperty.call(i.versions,"gulp")&&(o="gulp",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.gulp=(e.toLowerCase().split("version")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"tsc")&&(o="tsc",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.tsc=(e.toLowerCase().split("version")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"grunt")&&(o="grunt",Ue&&(o+=".cmd"),Re(`${o} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.grunt=(e.toLowerCase().split("cli v")[1]||"").trim()}a()}))),{}.hasOwnProperty.call(i.versions,"git"))if(We){const e=ke.existsSync("/usr/local/Cellar/git")||ke.existsSync("/opt/homebrew/bin/git");Me.darwinXcodeExists()||e?Re("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),i.versions.git=(e.split(" ")[0]||"").trim()}a()})):a()}else Re("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),i.versions.git=(e.split(" ")[0]||"").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"apache")&&Re("apachectl -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(":");i.versions.apache=e.length>1?e[1].replace("Apache","").replace("/","").split("(")[0].trim():""}a()})),{}.hasOwnProperty.call(i.versions,"nginx")&&Re("nginx -v 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.nginx=(e.toLowerCase().split("/")[1]||"").trim()}a()})),{}.hasOwnProperty.call(i.versions,"mysql")&&Re("mysql -V",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";if(e=e.toLowerCase(),e.indexOf(",")>-1){e=(e.split(",")[0]||"").trim();const t=e.split(" ");i.versions.mysql=(t[t.length-1]||"").trim()}else e.indexOf(" ver ")>-1&&(e=e.split(" ver ")[1],i.versions.mysql=e.split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"php")&&Re("php -v",(function(e,t){if(!e){let e=(t.toString().split("\n")[0]||"").split("(");e[0].indexOf("-")&&(e=e[0].split("-")),i.versions.php=e[0].replace(/[^0-9.]/g,"")}a()})),{}.hasOwnProperty.call(i.versions,"redis")&&Re("redis-server --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.redis=Me.getValue(e,"v","=",!0)}a()})),{}.hasOwnProperty.call(i.versions,"docker")&&Re("docker --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.docker=e.length>2&&e[2].endsWith(",")?e[2].slice(0,-1):""}a()})),{}.hasOwnProperty.call(i.versions,"postfix")&&Re("postconf -d | grep mail_version",(function(e,t){if(!e){const e=t.toString().split("\n")||[];i.versions.postfix=Me.getValue(e,"mail_version","=",!0)}a()})),{}.hasOwnProperty.call(i.versions,"mongodb")&&Re("mongod --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.mongodb=(e.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}a()})),{}.hasOwnProperty.call(i.versions,"postgresql")&&(Ge?Re("locate bin/postgres",(function(e,t){if(e)Re("psql -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:"",i.versions.postgresql=i.versions.postgresql.split("-")[0]}a()}));else{const e=t.toString().split("\n").sort();e.length?Re(e[e.length-1]+" -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:""}a()})):a()}})):Ue?Me.powerShell("Get-CimInstance Win32_Service | select caption | fl").then((e=>{e.split(/\n\s*\n/).forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=Me.getValue(t,"caption",":",!0).toLowerCase();if(r.indexOf("postgresql")>-1){const e=r.split(" server ");e.length>1&&(i.versions.postgresql=e[1])}}})),a()})):Re("postgres -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];i.versions.postgresql=e.length?e[e.length-1]:""}a()}))),{}.hasOwnProperty.call(i.versions,"perl")&&Re("perl -v",(function(e,t){if(!e){const e=t.toString().split("\n")||"";for(;e.length>0&&""===e[0].trim();)e.shift();e.length>0&&(i.versions.perl=e[0].split("(").pop().split(")")[0].replace("v",""))}a()})),{}.hasOwnProperty.call(i.versions,"python"))if(We)try{const e=Be("sw_vers").toString().split("\n"),t=Me.getValue(e,"ProductVersion",":"),r=ke.existsSync("/usr/local/Cellar/python"),n=ke.existsSync("/opt/homebrew/bin/python");if(Me.darwinXcodeExists()&&Me.semverCompare("12.0.1",t)<0||r||n){Re(r?"/usr/local/Cellar/python -V 2>&1":n?"/opt/homebrew/bin/python -V 2>&1":"python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python=e.toLowerCase().replace("python","").trim()}a()}))}else a()}catch(e){a()}else Re("python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python=e.toLowerCase().replace("python","").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"python3"))if(We){const e=ke.existsSync("/usr/local/Cellar/python3")||ke.existsSync("/opt/homebrew/bin/python3");Me.darwinXcodeExists()||e?Re("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python3=e.toLowerCase().replace("python","").trim()}a()})):a()}else Re("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";i.versions.python3=e.toLowerCase().replace("python","").trim()}a()}));if({}.hasOwnProperty.call(i.versions,"pip"))if(We){const e=ke.existsSync("/usr/local/Cellar/pip")||ke.existsSync("/opt/homebrew/bin/pip");Me.darwinXcodeExists()||e?Re("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip=e.length>=2?e[1]:""}a()})):a()}else Re("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip=e.length>=2?e[1]:""}a()}));if({}.hasOwnProperty.call(i.versions,"pip3"))if(We){const e=ke.existsSync("/usr/local/Cellar/pip3")||ke.existsSync("/opt/homebrew/bin/pip3");Me.darwinXcodeExists()||e?Re("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip3=e.length>=2?e[1]:""}a()})):a()}else Re("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");i.versions.pip3=e.length>=2?e[1]:""}a()}));({}).hasOwnProperty.call(i.versions,"java")&&(We?Re("/usr/libexec/java_home -V 2>&1",(function(e,t){e||-1!==t.toString().toLowerCase().indexOf("no java runtime")?a():Re("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');i.versions.java=3===e.length?e[1].trim():""}a()}))})):Re("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');i.versions.java=3===e.length?e[1].trim():""}a()}))),{}.hasOwnProperty.call(i.versions,"gcc")&&(We&&Me.darwinXcodeExists()||!We?Re("gcc -dumpversion",(function(e,t){e||(i.versions.gcc=t.toString().split("\n")[0].trim()||""),i.versions.gcc.indexOf(".")>-1?a():Re("gcc --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].trim();if(e.indexOf("gcc")>-1&&e.indexOf(")")>-1){const t=e.split(")");i.versions.gcc=t[1].trim()||i.versions.gcc}}a()}))})):a()),{}.hasOwnProperty.call(i.versions,"virtualbox")&&Re(Me.getVboxmanage()+" -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split("r");i.versions.virtualbox=e[0]}a()})),{}.hasOwnProperty.call(i.versions,"bash")&&Re("bash --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(i.versions.bash=e[1].split(" ")[0].split("(")[0])}a()})),{}.hasOwnProperty.call(i.versions,"zsh")&&Re("zsh --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split("zsh ");e.length>1&&(i.versions.zsh=e[1].split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"fish")&&Re("fish --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(i.versions.fish=e[1].split(" ")[0])}a()})),{}.hasOwnProperty.call(i.versions,"powershell")&&(Ue?Me.powerShell("$PSVersionTable").then((e=>{const t=e.toString().split("\n").map((e=>e.replace(/ +/g," ").replace(/ +/g,":")));i.versions.powershell=Me.getValue(t,"psversion"),a()})):a()),{}.hasOwnProperty.call(i.versions,"dotnet")&&(Ue?Me.powerShell('gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release').then((e=>{const t=e.toString().split("\r\n");let r="";t.forEach((e=>{const t=(e=e.replace(/ +/g," ")).split(" ");r=r||(t[0].toLowerCase().startsWith("client")&&t.length>2||t[0].toLowerCase().startsWith("full")&&t.length>2?t[1].trim():"")})),i.versions.dotnet=r.trim(),a()})):a())}catch(e){t&&t(i.versions),n(i.versions)}}))}))},Ne.shell=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ue)t("cmd");else{let r="";Re("echo $SHELL",(function(n,i){n||(r=i.toString().split("\n")[0]),e&&e(r),t(r)}))}}))}))},Ne.uuid=qe;var Je={};const Qe=m.default,Ze=y.default.exec,et=y.default.execSync,tt=h.default,rt=L;let nt=process.platform;const it="linux"===nt||"android"===nt,st="darwin"===nt,at="win32"===nt,ot="freebsd"===nt,lt="openbsd"===nt,ct="netbsd"===nt,ut="sunos"===nt;let pt=0,ft={user:0,nice:0,system:0,idle:0,irq:0,steal:0,guest:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,currentLoadSteal:0,currentLoadGuest:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0,rawCurrentLoadSteal:0,rawCurrentLoadGuest:0},dt=[],mt=0;const ht={8346:"1.8",8347:"1.9",8350:"2.0",8354:"2.2","8356|SE":"2.4",8356:"2.3",8360:"2.5",2372:"2.1",2373:"2.1",2374:"2.2",2376:"2.3",2377:"2.3",2378:"2.4",2379:"2.4",2380:"2.5",2381:"2.5",2382:"2.6",2384:"2.7",2386:"2.8",2387:"2.8",2389:"2.9",2393:"3.1",8374:"2.2",8376:"2.3",8378:"2.4",8379:"2.4",8380:"2.5",8381:"2.5",8382:"2.6",8384:"2.7",8386:"2.8",8387:"2.8",8389:"2.9",8393:"3.1","2419EE":"1.8","2423HE":"2.0","2425HE":"2.1",2427:"2.2",2431:"2.4",2435:"2.6","2439SE":"2.8","8425HE":"2.1",8431:"2.4",8435:"2.6","8439SE":"2.8",4122:"2.2",4130:"2.6","4162EE":"1.7","4164EE":"1.8","4170HE":"2.1","4174HE":"2.3","4176HE":"2.4",4180:"2.6",4184:"2.8","6124HE":"1.8","6128HE":"2.0","6132HE":"2.2",6128:"2.0",6134:"2.3",6136:"2.4",6140:"2.6","6164HE":"1.7","6166HE":"1.8",6168:"1.9",6172:"2.1",6174:"2.2",6176:"2.3","6176SE":"2.3","6180SE":"2.5",3250:"2.5",3260:"2.7",3280:"2.4",4226:"2.7",4228:"2.8",4230:"2.9",4234:"3.1",4238:"3.3",4240:"3.4",4256:"1.6",4274:"2.5",4276:"2.6",4280:"2.8",4284:"3.0",6204:"3.3",6212:"2.6",6220:"3.0",6234:"2.4",6238:"2.6","6262HE":"1.6",6272:"2.1",6274:"2.2",6276:"2.3",6278:"2.4","6282SE":"2.6","6284SE":"2.7",6308:"3.5",6320:"2.8",6328:"3.2","6338P":"2.3",6344:"2.6",6348:"2.8",6366:"1.8","6370P":"2.0",6376:"2.3",6378:"2.4",6380:"2.5",6386:"2.8","FX|4100":"3.6","FX|4120":"3.9","FX|4130":"3.8","FX|4150":"3.8","FX|4170":"4.2","FX|6100":"3.3","FX|6120":"3.6","FX|6130":"3.6","FX|6200":"3.8","FX|8100":"2.8","FX|8120":"3.1","FX|8140":"3.2","FX|8150":"3.6","FX|8170":"3.9","FX|4300":"3.8","FX|4320":"4.0","FX|4350":"4.2","FX|6300":"3.5","FX|6350":"3.9","FX|8300":"3.3","FX|8310":"3.4","FX|8320":"3.5","FX|8350":"4.0","FX|8370":"4.0","FX|9370":"4.4","FX|9590":"4.7","FX|8320E":"3.2","FX|8370E":"3.3",1200:"3.1","Pro 1200":"3.1","1300X":"3.5","Pro 1300":"3.5",1400:"3.2","1500X":"3.5","Pro 1500":"3.5",1600:"3.2","1600X":"3.6","Pro 1600":"3.2",1700:"3.0","Pro 1700":"3.0","1700X":"3.4","Pro 1700X":"3.4","1800X":"3.6","1900X":"3.8",1920:"3.2","1920X":"3.5","1950X":"3.4","200GE":"3.2","Pro 200GE":"3.2","220GE":"3.4","240GE":"3.5","3000G":"3.5","300GE":"3.4","3050GE":"3.4","2200G":"3.5","Pro 2200G":"3.5","2200GE":"3.2","Pro 2200GE":"3.2","2400G":"3.6","Pro 2400G":"3.6","2400GE":"3.2","Pro 2400GE":"3.2","Pro 200U":"2.3","300U":"2.4","2200U":"2.5","3200U":"2.6","2300U":"2.0","Pro 2300U":"2.0","2500U":"2.0","Pro 2500U":"2.2","2600H":"3.2","2700U":"2.0","Pro 2700U":"2.2","2800H":"3.3",7351:"2.4","7351P":"2.4",7401:"2.0","7401P":"2.0","7551P":"2.0",7551:"2.0",7251:"2.1",7261:"2.5",7281:"2.1",7301:"2.2",7371:"3.1",7451:"2.3",7501:"2.0",7571:"2.2",7601:"2.2",V1500B:"2.2",V1780B:"3.35",V1202B:"2.3",V1404I:"2.0",V1605B:"2.0",V1756B:"3.25",V1807B:"3.35",3101:"2.1",3151:"2.7",3201:"1.5",3251:"2.5",3255:"2.5",3301:"2.0",3351:"1.9",3401:"1.85",3451:"2.15","1200|AF":"3.1","2300X":"3.5","2500X":"3.6",2600:"3.4","2600E":"3.1","1600|AF":"3.2","2600X":"3.6",2700:"3.2","2700E":"2.8","Pro 2700":"3.2","2700X":"3.7","Pro 2700X":"3.6","2920X":"3.5","2950X":"3.5","2970WX":"3.0","2990WX":"3.0","Pro 300GE":"3.4","Pro 3125GE":"3.4","3150G":"3.5","Pro 3150G":"3.5","3150GE":"3.3","Pro 3150GE":"3.3","3200G":"3.6","Pro 3200G":"3.6","3200GE":"3.3","Pro 3200GE":"3.3","3350G":"3.6","Pro 3350G":"3.6","3350GE":"3.3","Pro 3350GE":"3.3","3400G":"3.7","Pro 3400G":"3.7","3400GE":"3.3","Pro 3400GE":"3.3","3300U":"2.1","PRO 3300U":"2.1","3450U":"2.1","3500U":"2.1","PRO 3500U":"2.1","3500C":"2.1","3550H":"2.1","3580U":"2.1","3700U":"2.3","PRO 3700U":"2.3","3700C":"2.3","3750H":"2.3","3780U":"2.3",3100:"3.6","3300X":"3.8",3500:"3.6","3500X":"3.6",3600:"3.6","Pro 3600":"3.6","3600X":"3.8","3600XT":"3.8","Pro 3700":"3.6","3700X":"3.6","3800X":"3.9","3800XT":"3.9",3900:"3.1","Pro 3900":"3.1","3900X":"3.8","3900XT":"3.8","3950X":"3.5","3960X":"3.8","3970X":"3.7","3990X":"2.9","3945WX":"4.0","3955WX":"3.9","3975WX":"3.5","3995WX":"2.7","4300GE":"3.5","Pro 4300GE":"3.5","4300G":"3.8","Pro 4300G":"3.8","4600GE":"3.3","Pro 4650GE":"3.3","4600G":"3.7","Pro 4650G":"3.7","4700GE":"3.1","Pro 4750GE":"3.1","4700G":"3.6","Pro 4750G":"3.6","4300U":"2.7","4450U":"2.5","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4680U":"2.1","4600HS":"3.0","4600H":"3.0","4700U":"2.0","PRO 4750U":"1.7","4800U":"1.8","4800HS":"2.9","4800H":"2.9","4900HS":"3.0","4900H":"3.3","5300U":"2.6","5500U":"2.1","5700U":"1.8","7232P":"3.1","7302P":"3.0","7402P":"2.8","7502P":"2.5","7702P":"2.0",7252:"3.1",7262:"3.2",7272:"2.9",7282:"2.8",7302:"3.0",7352:"2.3",7402:"2.8",7452:"2.35",7502:"2.5",7532:"2.4",7542:"2.9",7552:"2.2",7642:"2.3",7662:"2.0",7702:"2.0",7742:"2.25","7H12":"2.6","7F32":"3.7","7F52":"3.5","7F72":"3.2","7773X":"2.2",7763:"2.45",7713:"2.0","7713P":"2.0",7663:"2.0",7643:"2.3","7573X":"2.8","75F3":"2.95",7543:"2.8","7543P":"2.8",7513:"2.6","7473X":"2.8",7453:"2.75","74F3":"3.2",7443:"2.85","7443P":"2.85",7413:"2.65","7373X":"3.05","73F3":"3.5",7343:"3.2",7313:"3.0","7313P":"3.0","72F3":"3.7","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4","5945WX":"4.1","5955WX":"4.0","5965WX":"3.8","5975WX":"3.6","5995WX":"2.7","7960X":"4.2","7970X":"4.0","7980X":"3.2","7965WX":"4.2","7975WX":"4.0","7985WX":"3.2","7995WX":"2.5",9754:"2.25","9754S":"2.25",9734:"2.2","9684X":"2.55","9384X":"3.1","9184X":"3.55","9654P":"2.4",9654:"2.4",9634:"2.25","9554P":"3.1",9554:"3.1",9534:"2.45","9474F":"3.6","9454P":"2.75",9454:"2.75","9374F":"3.85","9354P":"3.25",9354:"3.25",9334:"2.7","9274F":"4.05",9254:"2.9",9224:"2.5","9174F":"4.1",9124:"3.0"},gt={1:"Other",2:"Unknown",3:"Daughter Board",4:"ZIF Socket",5:"Replacement/Piggy Back",6:"None",7:"LIF Socket",8:"Slot 1",9:"Slot 2",10:"370 Pin Socket",11:"Slot A",12:"Slot M",13:"423",14:"A (Socket 462)",15:"478",16:"754",17:"940",18:"939",19:"mPGA604",20:"LGA771",21:"LGA775",22:"S1",23:"AM2",24:"F (1207)",25:"LGA1366",26:"G34",27:"AM3",28:"C32",29:"LGA1156",30:"LGA1567",31:"PGA988A",32:"BGA1288",33:"rPGA988B",34:"BGA1023",35:"BGA1224",36:"LGA1155",37:"LGA1356",38:"LGA2011",39:"FS1",40:"FS2",41:"FM1",42:"FM2",43:"LGA2011-3",44:"LGA1356-3",45:"LGA1150",46:"BGA1168",47:"BGA1234",48:"BGA1364",49:"AM4",50:"LGA1151",51:"BGA1356",52:"BGA1440",53:"BGA1515",54:"LGA3647-1",55:"SP3",56:"SP3r2",57:"LGA2066",58:"BGA1392",59:"BGA1510",60:"BGA1528",61:"LGA4189",62:"LGA1200",63:"LGA4677",64:"LGA1700",65:"BGA1744",66:"BGA1781",67:"BGA1211",68:"BGA2422",69:"LGA1211",70:"LGA2422",71:"LGA5773",72:"BGA5773"},yt={LGA1150:"i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",LGA1151:"i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",1155:"G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"};function vt(e){let t=e;return(e=e.toLowerCase()).indexOf("intel")>=0&&(t="Intel"),e.indexOf("amd")>=0&&(t="AMD"),e.indexOf("qemu")>=0&&(t="QEMU"),e.indexOf("hygon")>=0&&(t="Hygon"),e.indexOf("centaur")>=0&&(t="WinChip/Via"),e.indexOf("vmware")>=0&&(t="VMware"),e.indexOf("Xen")>=0&&(t="Xen Hypervisor"),e.indexOf("tcg")>=0&&(t="QEMU"),e.indexOf("apple")>=0&&(t="Apple"),t}function St(e){e.brand=e.brand.replace(/\(R\)+/g,"®").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(TM\)+/g,"™").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(C\)+/g,"©").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),e.manufacturer=vt(e.brand);let t=e.brand.split(" ");return t.shift(),e.brand=t.join(" "),e}function wt(e){let t="0";for(let r in ht)if({}.hasOwnProperty.call(ht,r)){let n=r.split("|"),i=0;n.forEach((t=>{e.indexOf(t)>-1&&i++})),i===n.length&&(t=ht[r])}return parseFloat(t)}function xt(){return new Promise((e=>{process.nextTick((()=>{const t="unknown";let r={manufacturer:t,brand:t,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:rt.cores(),physicalCores:rt.cores(),performanceCores:rt.cores(),efficiencyCores:0,processors:1,socket:"",flags:"",virtualization:!1,cache:{}};Ot().then((t=>{if(r.flags=t,r.virtualization=t.indexOf("vmx")>-1||t.indexOf("svm")>-1,st&&Ze("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",(function(t,n){let i=n.toString().split("\n");const s=rt.getValue(i,"machdep.cpu.brand_string").split("@");r.brand=s[0].trim();const a=s[1]?s[1].trim():"0";r.speed=parseFloat(a.replace(/GHz+/g,""));let o=rt.getValue(i,"hw.tbfrequency")/1e9;o=o<.1?100*o:o,r.speed=0===r.speed?o:r.speed,pt=r.speed,r=St(r),r.speedMin=rt.getValue(i,"hw.cpufrequency_min")?rt.getValue(i,"hw.cpufrequency_min")/1e9:r.speed,r.speedMax=rt.getValue(i,"hw.cpufrequency_max")?rt.getValue(i,"hw.cpufrequency_max")/1e9:r.speed,r.vendor=rt.getValue(i,"machdep.cpu.vendor")||"Apple",r.family=rt.getValue(i,"machdep.cpu.family")||rt.getValue(i,"hw.cpufamily"),r.model=rt.getValue(i,"machdep.cpu.model"),r.stepping=rt.getValue(i,"machdep.cpu.stepping")||rt.getValue(i,"hw.cpusubfamily"),r.virtualization=!0;const l=rt.getValue(i,"hw.packages"),c=rt.getValue(i,"hw.physicalcpu_max"),u=rt.getValue(i,"hw.ncpu");if("arm64"===Qe.arch()){r.socket="SOC";try{const e=et("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n"),t=e.filter((e=>e.indexOf('"E"')>=0)).length,n=e.filter((e=>e.indexOf('"P"')>=0)).length;r.efficiencyCores=t,r.performanceCores=n}catch(e){rt.noop()}}l&&(r.processors=parseInt(l)||1),c&&u&&(r.cores=parseInt(u)||rt.cores(),r.physicalCores=parseInt(c)||rt.cores()),It().then((t=>{r.cache=t,e(r)}))})),it){let t="",n=[];Qe.cpus()[0]&&Qe.cpus()[0].model&&(t=Qe.cpus()[0].model),Ze('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL',(function(i,s){i||(n=s.toString().split("\n")),t=rt.getValue(n,"model name")||t,t=rt.getValue(n,"bios model name")||t;const a=t.split("@");if(r.brand=a[0].trim(),r.speed=a[1]?parseFloat(a[1].trim()):0,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed){const e=Ct();0!==e.avg&&(r.speed=e.avg)}pt=r.speed,r.speedMin=Math.round(parseFloat(rt.getValue(n,"cpu min mhz").replace(/,/g,"."))/10)/100,r.speedMax=Math.round(parseFloat(rt.getValue(n,"cpu max mhz").replace(/,/g,"."))/10)/100,r=St(r),r.vendor=vt(rt.getValue(n,"vendor id")),r.family=rt.getValue(n,"cpu family"),r.model=rt.getValue(n,"model:"),r.stepping=rt.getValue(n,"stepping"),r.revision=rt.getValue(n,"cpu revision"),r.cache.l1d=rt.getValue(n,"l1d cache"),r.cache.l1d&&(r.cache.l1d=parseInt(r.cache.l1d)*(-1!==r.cache.l1d.indexOf("M")?1048576:-1!==r.cache.l1d.indexOf("K")?1024:1)),r.cache.l1i=rt.getValue(n,"l1i cache"),r.cache.l1i&&(r.cache.l1i=parseInt(r.cache.l1i)*(-1!==r.cache.l1i.indexOf("M")?1048576:-1!==r.cache.l1i.indexOf("K")?1024:1)),r.cache.l2=rt.getValue(n,"l2 cache"),r.cache.l2&&(r.cache.l2=parseInt(r.cache.l2)*(-1!==r.cache.l2.indexOf("M")?1048576:-1!==r.cache.l2.indexOf("K")?1024:1)),r.cache.l3=rt.getValue(n,"l3 cache"),r.cache.l3&&(r.cache.l3=parseInt(r.cache.l3)*(-1!==r.cache.l3.indexOf("M")?1048576:-1!==r.cache.l3.indexOf("K")?1024:1));const o=rt.getValue(n,"thread(s) per core")||"1",l=rt.getValue(n,"socket(s)")||"1",c=parseInt(o,10),u=parseInt(l,10)||1,p=parseInt(rt.getValue(n,"core(s) per socket"),10);if(r.physicalCores=p?p*u:r.cores/c,r.performanceCores=c>1?r.cores-r.physicalCores:r.cores,r.efficiencyCores=c>1?r.cores-c*r.performanceCores:0,r.processors=u,r.governor=rt.getValue(n,"governor")||"","ARM"===r.vendor){const e=tt.readFileSync("/proc/cpuinfo").toString().split("\n"),t=rt.decodePiCpuinfo(e);t.model.toLowerCase().indexOf("raspberry")>=0&&(r.family=r.manufacturer,r.manufacturer=t.manufacturer,r.brand=t.processor,r.revision=t.revisionCode,r.socket="SOC")}let f=[];Ze('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL',(function(t,n){f=n.toString().split("\n"),f&&f.length&&(r.socket=rt.getValue(f,"Upgrade").replace("Socket","").trim()||r.socket),e(r)}))}))}if(ot||lt||ct){let t="",n=[];Qe.cpus()[0]&&Qe.cpus()[0].model&&(t=Qe.cpus()[0].model),Ze("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL",(function(i,s){let a=[];if(!i){const e=s.toString().split("# dmidecode"),t=e.length>1?e[1]:"";a=e.length>2?e[2].split("Cache Information"):[],n=t.split("\n")}if(r.brand=t.split("@")[0].trim(),r.speed=t.split("@")[1]?parseFloat(t.split("@")[1].trim()):0,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed){const e=Ct();0!==e.avg&&(r.speed=e.avg)}pt=r.speed,r.speedMin=r.speed,r.speedMax=Math.round(parseFloat(rt.getValue(n,"max speed").replace(/Mhz/g,""))/10)/100,r=St(r),r.vendor=vt(rt.getValue(n,"manufacturer"));let o=rt.getValue(n,"signature");o=o.split(",");for(let e=0;e<o.length;e++)o[e]=o[e].trim();r.family=rt.getValue(o,"Family"," ",!0),r.model=rt.getValue(o,"Model"," ",!0),r.stepping=rt.getValue(o,"Stepping"," ",!0),r.revision="";const l=parseFloat(rt.getValue(n,"voltage"));r.voltage=isNaN(l)?"":l.toFixed(2);for(let e=0;e<a.length;e++){n=a[e].split("\n");let t=rt.getValue(n,"Socket Designation").toLowerCase().replace(" ","-").split("-");t=t.length?t[0]:"";const i=rt.getValue(n,"Installed Size").split(" ");let s=parseInt(i[0],10);const o=i.length>1?i[1]:"kb";s*="kb"===o?1024:"mb"===o?1048576:"gb"===o?1073741824:1,t&&("l1"===t?(r.cache[t+"d"]=s/2,r.cache[t+"i"]=s/2):r.cache[t]=s)}r.socket=rt.getValue(n,"Upgrade").replace("Socket","").trim();const c=rt.getValue(n,"thread count").trim(),u=rt.getValue(n,"core count").trim();u&&c&&(r.cores=parseInt(c,10),r.physicalCores=parseInt(u,10)),e(r)}))}if(ut&&e(r),at)try{const t=[];t.push(rt.powerShell("Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl")),t.push(rt.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),t.push(rt.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),Promise.all(t).then((t=>{let n=t[0].split("\r\n"),i=rt.getValue(n,"name",":")||"";i.indexOf("@")>=0?(r.brand=i.split("@")[0].trim(),r.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,pt=r.speed):(r.brand=i.trim(),r.speed=0),r=St(r),r.revision=rt.getValue(n,"revision",":"),r.vendor=rt.getValue(n,"manufacturer",":"),r.speedMax=Math.round(parseFloat(rt.getValue(n,"maxclockspeed",":").replace(/,/g,"."))/10)/100,0===r.speed&&(r.brand.indexOf("AMD")>-1||r.brand.toLowerCase().indexOf("ryzen")>-1)&&(r.speed=wt(r.brand)),0===r.speed&&(r.speed=r.speedMax),r.speedMin=r.speed;let s=rt.getValue(n,"description",":").split(" ");for(let e=0;e<s.length;e++)s[e].toLowerCase().startsWith("family")&&e+1<s.length&&s[e+1]&&(r.family=s[e+1]),s[e].toLowerCase().startsWith("model")&&e+1<s.length&&s[e+1]&&(r.model=s[e+1]),s[e].toLowerCase().startsWith("stepping")&&e+1<s.length&&s[e+1]&&(r.stepping=s[e+1]);const a=rt.getValue(n,"UpgradeMethod",":");gt[a]&&(r.socket=gt[a]);const o=function(e){let t="";for(const r in yt)yt[r].split(" ").forEach((n=>{e.indexOf(n)>=0&&(t=r)}));return t}(i);o&&(r.socket=o);const l=rt.countLines(n,"Caption"),c=rt.getValue(n,"NumberOfLogicalProcessors",":"),u=rt.getValue(n,"NumberOfCores",":");l&&(r.processors=parseInt(l)||1),u&&c&&(r.cores=parseInt(c)||rt.cores(),r.physicalCores=parseInt(u)||rt.cores()),l>1&&(r.cores=r.cores*l,r.physicalCores=r.physicalCores*l),r.cache=bt(t[0],t[1]);const p=t[2]?t[2].toString().toLowerCase():"";r.virtualization=-1!==p.indexOf("true"),e(r)}))}catch(t){e(r)}}))}))}))}function Ct(){let e=Qe.cpus(),t=999999999,r=0,n=0,i=[];if(e&&e.length){for(let s in e)if({}.hasOwnProperty.call(e,s)){let a=e[s].speed>100?(e[s].speed+1)/1e3:e[s].speed/10;n+=a,a>r&&(r=a),a<t&&(t=a),i.push(parseFloat(a.toFixed(2)))}return n/=e.length,{min:parseFloat(t.toFixed(2)),max:parseFloat(r.toFixed(2)),avg:parseFloat(n.toFixed(2)),cores:i}}return{min:0,max:0,avg:0,cores:i}}function Ot(e){return new Promise((t=>{process.nextTick((()=>{let r="";if(at)try{Ze('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet',rt.execOptsWin,(function(n,i){if(!n){let e=i.split("0x").pop().trim(),t=parseInt(e,16).toString(2),n="0".repeat(32-t.length)+t,s=["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","","sep","mtrr","pge","mca","cmov","pat","pse-36","psn","clfsh","","ds","acpi","mmx","fxsr","sse","sse2","ss","htt","tm","ia64","pbe"];for(let e=0;e<s.length;e++)"1"===n[e]&&""!==s[e]&&(r+=" "+s[e]);r=r.trim().toLowerCase()}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(it)try{Ze("export LC_ALL=C; lscpu; unset LC_ALL",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){-1!==e.split(":")[0].toUpperCase().indexOf("FLAGS")&&(r=e.split(":")[1].trim().toLowerCase())}))}r?(e&&e(r),t(r)):tt.readFile("/proc/cpuinfo",(function(n,i){if(!n){let e=i.toString().split("\n");r=rt.getValue(e,"features",":",!0).toLowerCase()}e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}(ot||lt||ct)&&Ze("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL",(function(n,i){let s=[];if(!n){let e=i.toString().split("\tFlags:");(e.length>1?e[1].split("\tVersion:")[0].split("\n"):[]).forEach((function(e){let t=(e.indexOf("(")?e.split("(")[0].toLowerCase():"").trim().replace(/\t/g,"");t&&s.push(t)}))}r=s.join(" ").trim().toLowerCase(),e&&e(r),t(r)})),st&&Ze("sysctl machdep.cpu.features",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&-1!==e[0].indexOf("machdep.cpu.features:")&&(r=e[0].split(":")[1].trim().toLowerCase())}e&&e(r),t(r)})),ut&&(e&&e(r),t(r))}))}))}function It(e){return new Promise((t=>{process.nextTick((()=>{let r={l1d:null,l1i:null,l2:null,l3:null};if(it)try{Ze("export LC_ALL=C; lscpu; unset LC_ALL",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toUpperCase().indexOf("L1D CACHE")&&(r.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L1I CACHE")&&(r.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L2 CACHE")&&(r.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L3 CACHE")&&(r.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("M")?1048576:-1!==t[1].indexOf("K")?1024:1))}))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if((ot||lt||ct)&&Ze("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL",(function(n,i){let s=[];if(!n){s=i.toString().split("Cache Information"),s.shift()}for(let e=0;e<s.length;e++){const t=s[e].split("\n");let n=rt.getValue(t,"Socket Designation").toLowerCase().replace(" ","-").split("-");n=n.length?n[0]:"";const i=rt.getValue(t,"Installed Size").split(" ");let a=parseInt(i[0],10);const o=i.length>1?i[1]:"kb";a*="kb"===o?1024:"mb"===o?1048576:"gb"===o?1073741824:1,n&&("l1"===n?(r.cache[n+"d"]=a/2,r.cache[n+"i"]=a/2):r.cache[n]=a)}e&&e(r),t(r)})),st&&Ze("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize",(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toLowerCase().indexOf("hw.l1icachesize")&&(r.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l1dcachesize")&&(r.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l2cachesize")&&(r.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l3cachesize")&&(r.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1))}))}e&&e(r),t(r)})),ut&&(e&&e(r),t(r)),at)try{const n=[];n.push(rt.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")),n.push(rt.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),Promise.all(n).then((n=>{r=bt(n[0],n[1]),e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))}function bt(e,t){let r={l1d:null,l1i:null,l2:null,l3:null},n=e.split("\r\n");r.l1d=0,r.l1i=0,r.l2=rt.getValue(n,"l2cachesize",":"),r.l3=rt.getValue(n,"l3cachesize",":"),r.l2?r.l2=1024*parseInt(r.l2,10):r.l2=0,r.l3?r.l3=1024*parseInt(r.l3,10):r.l3=0;const i=t.split(/\n\s*\n/);let s=0,a=0,o=0;return i.forEach((function(e){const t=e.split("\r\n"),n=rt.getValue(t,"CacheType"),i=rt.getValue(t,"Level"),l=rt.getValue(t,"InstalledSize");"3"===i&&"3"===n&&(r.l1i=r.l1i+1024*parseInt(l,10)),"3"===i&&"4"===n&&(r.l1d=r.l1d+1024*parseInt(l,10)),"3"===i&&"5"===n&&(s=parseInt(l,10)/2,a=parseInt(l,10)/2),"4"===i&&"5"===n&&(o+=1024*parseInt(l,10))})),r.l1i||r.l1d||(r.l1i=s,r.l1d=a),o&&(r.l2=o),r}Je.cpu=function(e){return new Promise((t=>{process.nextTick((()=>{xt().then((r=>{e&&e(r),t(r)}))}))}))},Je.cpuCurrentSpeed=function(e){return new Promise((t=>{process.nextTick((()=>{let r=Ct();if(0===r.avg&&0!==pt){const e=parseFloat(pt);r={min:e,max:e,avg:e,cores:[]}}e&&e(r),t(r)}))}))},Je.cpuTemperature=function(e){return new Promise((t=>{process.nextTick((()=>{let r={main:null,cores:[],max:null,socket:[],chipset:null};if(it){try{const e=et('cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;').toString().split("-----\n");if(2===e.length){const t=e[0].split("\n"),n=e[1].split("\n");for(let e=0;e<t.length;e++){const i=t[e].trim();i.startsWith("acpi")&&n[e]&&r.socket.push(Math.round(parseInt(n[e],10)/100)/10),i.startsWith("pch")&&n[e]&&(r.chipset=Math.round(parseInt(n[e],10)/100)/10)}}}catch(e){rt.noop()}const n='for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';try{Ze(n,(function(n,i){const s=(i=i.toString()).toLowerCase().indexOf("tdie");-1!==s&&(i=i.substring(s));let a=i.split("\n"),o=0;if(a.forEach((e=>{const t=e.split("___"),n=t[0],i=t.length>1&&t[1]?t[1]:"0";i&&n&&"tctl"===n.toLowerCase()&&(o=r.main=Math.round(parseInt(i,10)/100)/10),i&&(void 0===n||n&&n.toLowerCase().startsWith("core"))?r.cores.push(Math.round(parseInt(i,10)/100)/10):i&&n&&null===r.main&&(n.toLowerCase().indexOf("package")>=0||n.toLowerCase().indexOf("physical")>=0||"tccd1"===n.toLowerCase())&&(r.main=Math.round(parseInt(i,10)/100)/10)})),o&&null===r.main&&(r.main=o),r.cores.length>0){null===r.main&&(r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length));let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}if(null!==r.main)return null===r.max&&(r.max=r.main),e&&e(r),void t(r);Ze("sensors",(function(n,i){if(!n){let n=i.toString().split("\n"),s=null,a=!0,o="";if(n.forEach((function(e){""===e.trim()?a=!0:a&&(e.trim().toLowerCase().startsWith("acpi")&&(o="acpi"),e.trim().toLowerCase().startsWith("pch")&&(o="pch"),e.trim().toLowerCase().startsWith("core")&&(o="core"),a=!1);let t=e.match(/[+-]([^°]*)/g),n=e.split(":")[0].toUpperCase();"acpi"===o?-1!==n.indexOf("TEMP")&&r.socket.push(parseFloat(t)):"pch"===o&&(-1===n.indexOf("TEMP")||r.chipset||(r.chipset=parseFloat(t))),-1===n.indexOf("PHYSICAL")&&-1===n.indexOf("PACKAGE")||(r.main=parseFloat(t)),-1!==n.indexOf("CORE ")&&r.cores.push(parseFloat(t)),-1!==n.indexOf("TDIE")&&null===s&&(s=parseFloat(t))})),r.cores.length>0){r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length);let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}else null===r.main&&null!==s&&(r.main=s,r.max=s);if(null!==r.main||null!==r.max)return e&&e(r),void t(r)}tt.stat("/sys/class/thermal/thermal_zone0/temp",(function(n){null===n?tt.readFile("/sys/class/thermal/thermal_zone0/temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&(r.main=parseFloat(e[0])/1e3,r.max=r.main)}e&&e(r),t(r)})):Ze("/opt/vc/bin/vcgencmd measure_temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&e[0].indexOf("=")&&(r.main=parseFloat(e[0].split("=")[1]),r.max=r.main)}e&&e(r),t(r)}))}))}))}))}catch(n){e&&e(r),t(r)}}if((ot||lt||ct)&&Ze("sysctl dev.cpu | grep temp",(function(n,i){if(!n){let e=i.toString().split("\n"),t=0;e.forEach((function(e){const n=e.split(":");if(n.length>1){const e=parseFloat(n[1].replace(",","."));e>r.max&&(r.max=e),t+=e,r.cores.push(e)}})),r.cores.length&&(r.main=Math.round(t/r.cores.length*100)/100)}e&&e(r),t(r)})),st){let n=null;try{n=require("osx-temperature-sensor")}catch(e){n=null}if(n&&(r=n.cpuTemperature(),r.main&&(r.main=Math.round(100*r.main)/100),r.max&&(r.max=Math.round(100*r.max)/100),r.cores&&r.cores.length))for(let e=0;e<r.cores.length;e++)r.cores[e]=Math.round(100*r.cores[e])/100;e&&e(r),t(r)}if(ut&&(e&&e(r),t(r)),at)try{rt.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then(((n,i)=>{if(!i){let e=0;n.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(t){let n=(parseInt(t,10)-2732)/10;isNaN(n)||(e+=n,n>r.max&&(r.max=n),r.cores.push(n))})),r.cores.length&&(r.main=e/r.cores.length)}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},Je.cpuFlags=Ot,Je.cpuCache=It,Je.currentLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{let t=Qe.loadavg().map((function(e){return e/rt.cores()})),r=parseFloat(Math.max.apply(Math,t).toFixed(2)),n={};if(Date.now()-ft.ms>=200){ft.ms=Date.now();const e=Qe.cpus().map((function(e){return e.times.steal=0,e.times.guest=0,e}));let t=0,i=0,s=0,a=0,o=0,l=0,c=0,u=[];if(mt=e&&e.length?e.length:0,it)try{const t=et("cat /proc/stat 2>/dev/null | grep cpu",{encoding:"utf8"}).toString().split("\n");if(t.length>1&&(t.shift(),t.length===e.length))for(let r=0;r<t.length;r++){let n=t[r].split(" ");if(n.length>=10){const t=parseFloat(n[8])||0,i=parseFloat(n[9])||0;e[r].times.steal=t,e[r].times.guest=i}}}catch(e){rt.noop()}for(let r=0;r<mt;r++){const n=e[r].times;t+=n.user,i+=n.sys,s+=n.nice,o+=n.idle,a+=n.irq,l+=n.steal||0,c+=n.guest||0;let p=dt&&dt[r]&&dt[r].totalTick?dt[r].totalTick:0,f=dt&&dt[r]&&dt[r].totalLoad?dt[r].totalLoad:0,d=dt&&dt[r]&&dt[r].user?dt[r].user:0,m=dt&&dt[r]&&dt[r].sys?dt[r].sys:0,h=dt&&dt[r]&&dt[r].nice?dt[r].nice:0,g=dt&&dt[r]&&dt[r].idle?dt[r].idle:0,y=dt&&dt[r]&&dt[r].irq?dt[r].irq:0,v=dt&&dt[r]&&dt[r].steal?dt[r].steal:0,S=dt&&dt[r]&&dt[r].guest?dt[r].guest:0;dt[r]=n,dt[r].totalTick=dt[r].user+dt[r].sys+dt[r].nice+dt[r].irq+dt[r].steal+dt[r].guest+dt[r].idle,dt[r].totalLoad=dt[r].user+dt[r].sys+dt[r].nice+dt[r].irq+dt[r].steal+dt[r].guest,dt[r].currentTick=dt[r].totalTick-p,dt[r].load=dt[r].totalLoad-f,dt[r].loadUser=dt[r].user-d,dt[r].loadSystem=dt[r].sys-m,dt[r].loadNice=dt[r].nice-h,dt[r].loadIdle=dt[r].idle-g,dt[r].loadIrq=dt[r].irq-y,dt[r].loadSteal=dt[r].steal-v,dt[r].loadGuest=dt[r].guest-S,u[r]={},u[r].load=dt[r].load/dt[r].currentTick*100,u[r].loadUser=dt[r].loadUser/dt[r].currentTick*100,u[r].loadSystem=dt[r].loadSystem/dt[r].currentTick*100,u[r].loadNice=dt[r].loadNice/dt[r].currentTick*100,u[r].loadIdle=dt[r].loadIdle/dt[r].currentTick*100,u[r].loadIrq=dt[r].loadIrq/dt[r].currentTick*100,u[r].loadSteal=dt[r].loadSteal/dt[r].currentTick*100,u[r].loadGuest=dt[r].loadGuest/dt[r].currentTick*100,u[r].rawLoad=dt[r].load,u[r].rawLoadUser=dt[r].loadUser,u[r].rawLoadSystem=dt[r].loadSystem,u[r].rawLoadNice=dt[r].loadNice,u[r].rawLoadIdle=dt[r].loadIdle,u[r].rawLoadIrq=dt[r].loadIrq,u[r].rawLoadSteal=dt[r].loadSteal,u[r].rawLoadGuest=dt[r].loadGuest}let p=t+i+s+a+l+c+o,f=t+i+s+a+l+c,d=p-ft.tick;n={avgLoad:r,currentLoad:(f-ft.load)/d*100,currentLoadUser:(t-ft.user)/d*100,currentLoadSystem:(i-ft.system)/d*100,currentLoadNice:(s-ft.nice)/d*100,currentLoadIdle:(o-ft.idle)/d*100,currentLoadIrq:(a-ft.irq)/d*100,currentLoadSteal:(l-ft.steal)/d*100,currentLoadGuest:(c-ft.guest)/d*100,rawCurrentLoad:f-ft.load,rawCurrentLoadUser:t-ft.user,rawCurrentLoadSystem:i-ft.system,rawCurrentLoadNice:s-ft.nice,rawCurrentLoadIdle:o-ft.idle,rawCurrentLoadIrq:a-ft.irq,rawCurrentLoadSteal:l-ft.steal,rawCurrentLoadGuest:c-ft.guest,cpus:u},ft={user:t,nice:s,system:i,idle:o,irq:a,steal:l,guest:c,tick:p,load:f,ms:ft.ms,currentLoad:n.currentLoad,currentLoadUser:n.currentLoadUser,currentLoadSystem:n.currentLoadSystem,currentLoadNice:n.currentLoadNice,currentLoadIdle:n.currentLoadIdle,currentLoadIrq:n.currentLoadIrq,currentLoadSteal:n.currentLoadSteal,currentLoadGuest:n.currentLoadGuest,rawCurrentLoad:n.rawCurrentLoad,rawCurrentLoadUser:n.rawCurrentLoadUser,rawCurrentLoadSystem:n.rawCurrentLoadSystem,rawCurrentLoadNice:n.rawCurrentLoadNice,rawCurrentLoadIdle:n.rawCurrentLoadIdle,rawCurrentLoadIrq:n.rawCurrentLoadIrq,rawCurrentLoadSteal:n.rawCurrentLoadSteal,rawCurrentLoadGuest:n.rawCurrentLoadGuest}}else{let e=[];for(let t=0;t<mt;t++)e[t]={},e[t].load=dt[t].load/dt[t].currentTick*100,e[t].loadUser=dt[t].loadUser/dt[t].currentTick*100,e[t].loadSystem=dt[t].loadSystem/dt[t].currentTick*100,e[t].loadNice=dt[t].loadNice/dt[t].currentTick*100,e[t].loadIdle=dt[t].loadIdle/dt[t].currentTick*100,e[t].loadIrq=dt[t].loadIrq/dt[t].currentTick*100,e[t].rawLoad=dt[t].load,e[t].rawLoadUser=dt[t].loadUser,e[t].rawLoadSystem=dt[t].loadSystem,e[t].rawLoadNice=dt[t].loadNice,e[t].rawLoadIdle=dt[t].loadIdle,e[t].rawLoadIrq=dt[t].loadIrq,e[t].rawLoadSteal=dt[t].loadSteal,e[t].rawLoadGuest=dt[t].loadGuest;n={avgLoad:r,currentLoad:ft.currentLoad,currentLoadUser:ft.currentLoadUser,currentLoadSystem:ft.currentLoadSystem,currentLoadNice:ft.currentLoadNice,currentLoadIdle:ft.currentLoadIdle,currentLoadIrq:ft.currentLoadIrq,currentLoadSteal:ft.currentLoadSteal,currentLoadGuest:ft.currentLoadGuest,rawCurrentLoad:ft.rawCurrentLoad,rawCurrentLoadUser:ft.rawCurrentLoadUser,rawCurrentLoadSystem:ft.rawCurrentLoadSystem,rawCurrentLoadNice:ft.rawCurrentLoadNice,rawCurrentLoadIdle:ft.rawCurrentLoadIdle,rawCurrentLoadIrq:ft.rawCurrentLoadIrq,rawCurrentLoadSteal:ft.rawCurrentLoadSteal,rawCurrentLoadGuest:ft.rawCurrentLoadGuest,cpus:e}}e(n)}))})).then((r=>{e&&e(r),t(r)}))}))}))},Je.fullLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{const t=Qe.cpus();let r=0,n=0,i=0,s=0,a=0,o=0;if(t&&t.length){for(let e=0,o=t.length;e<o;e++){const o=t[e].times;r+=o.user,n+=o.sys,i+=o.nice,s+=o.irq,a+=o.idle}let e=a+s+i+n+r;o=(e-a)/e*100}e(o)}))})).then((r=>{e&&e(r),t(r)}))}))}))};var Et={};const Lt=m.default,_t=y.default.exec,Pt=y.default.execSync,Tt=L,Vt=h.default;let At=process.platform;const Nt="linux"===At||"android"===At,Dt="darwin"===At,kt="win32"===At,Mt="freebsd"===At,Rt="openbsd"===At,Bt="netbsd"===At,Ft="sunos"===At,Gt={"0x014F":"Transcend Information","0x2C00":"Micron Technology Inc.","0x802C":"Micron Technology Inc.","0x80AD":"Hynix Semiconductor Inc.","0x80CE":"Samsung Electronics Inc.","0xAD00":"Hynix Semiconductor Inc.","0xCE00":"Samsung Electronics Inc.","0x02FE":"Elpida","0x5105":"Qimonda AG i. In.","0x8551":"Qimonda AG i. In.","0x859B":"Crucial","0x04CD":"G-Skill"},Wt={"017A":"Apacer","0198":"HyperX","029E":"Corsair","04CB":"A-DATA","04CD":"G-Skill","059B":"Crucial","00CE":"Samsung",1315:"Crutial","014F":"Transcend Information","2C00":"Micron Technology Inc.","802C":"Micron Technology Inc.","80AD":"Hynix Semiconductor Inc.","80CE":"Samsung Electronics Inc.",AD00:"Hynix Semiconductor Inc.",CE00:"Samsung Electronics Inc.","02FE":"Elpida",5105:"Qimonda AG i. In.",8551:"Qimonda AG i. In.","859B":"Crucial"};Et.mem=function(e){return new Promise((t=>{process.nextTick((()=>{let r={total:Lt.totalmem(),free:Lt.freemem(),used:Lt.totalmem()-Lt.freemem(),active:Lt.totalmem()-Lt.freemem(),available:Lt.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0,writeback:null,dirty:null};if(Nt)try{Vt.readFile("/proc/meminfo",(function(n,i){if(!n){const e=i.toString().split("\n");r.total=parseInt(Tt.getValue(e,"memtotal"),10),r.total=r.total?1024*r.total:Lt.totalmem(),r.free=parseInt(Tt.getValue(e,"memfree"),10),r.free=r.free?1024*r.free:Lt.freemem(),r.used=r.total-r.free,r.buffers=parseInt(Tt.getValue(e,"buffers"),10),r.buffers=r.buffers?1024*r.buffers:0,r.cached=parseInt(Tt.getValue(e,"cached"),10),r.cached=r.cached?1024*r.cached:0,r.slab=parseInt(Tt.getValue(e,"slab"),10),r.slab=r.slab?1024*r.slab:0,r.buffcache=r.buffers+r.cached+r.slab;let t=parseInt(Tt.getValue(e,"memavailable"),10);r.available=t?1024*t:r.free+r.buffcache,r.active=r.total-r.available,r.swaptotal=parseInt(Tt.getValue(e,"swaptotal"),10),r.swaptotal=r.swaptotal?1024*r.swaptotal:0,r.swapfree=parseInt(Tt.getValue(e,"swapfree"),10),r.swapfree=r.swapfree?1024*r.swapfree:0,r.swapused=r.swaptotal-r.swapfree,r.writeback=parseInt(Tt.getValue(e,"writeback"),10),r.writeback=r.writeback?1024*r.writeback:0,r.dirty=parseInt(Tt.getValue(e,"dirty"),10),r.dirty=r.dirty?1024*r.dirty:0}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(Mt||Rt||Bt)try{_t("/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size",(function(n,i){if(!n){let e=i.toString().split("\n");const t=parseInt(Tt.getValue(e,"vm.stats.vm.v_page_size"),10),n=parseInt(Tt.getValue(e,"vm.stats.vm.v_inactive_count"),10)*t,s=parseInt(Tt.getValue(e,"vm.stats.vm.v_cache_count"),10)*t;r.total=parseInt(Tt.getValue(e,"hw.realmem"),10),isNaN(r.total)&&(r.total=parseInt(Tt.getValue(e,"hw.physmem"),10)),r.free=parseInt(Tt.getValue(e,"vm.stats.vm.v_free_count"),10)*t,r.buffcache=n+s,r.available=r.buffcache+r.free,r.active=r.total-r.free-r.buffcache,r.swaptotal=0,r.swapfree=0,r.swapused=0}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}if(Ft&&(e&&e(r),t(r)),Dt){let n=4096;try{let e=Tt.toInt(Pt("sysctl -n vm.pagesize").toString());n=e||n}catch(e){Tt.noop()}try{_t('vm_stat 2>/dev/null | grep "Pages active"',(function(i,s){if(!i){let e=s.toString().split("\n");r.active=parseInt(e[0].split(":")[1],10)*n,r.buffcache=r.used-r.active,r.available=r.free+r.buffcache}_t("sysctl -n vm.swapusage 2>/dev/null",(function(n,i){if(!n){let e=i.toString().split("\n");if(e.length>0){e[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach((e=>{-1!==e.toLowerCase().indexOf("total")&&(r.swaptotal=1024*parseFloat(e.split("=")[1].trim())*1024),-1!==e.toLowerCase().indexOf("used")&&(r.swapused=1024*parseFloat(e.split("=")[1].trim())*1024),-1!==e.toLowerCase().indexOf("free")&&(r.swapfree=1024*parseFloat(e.split("=")[1].trim())*1024)}))}}e&&e(r),t(r)}))}))}catch(n){e&&e(r),t(r)}}if(kt){let n=0,i=0;try{Tt.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then(((s,a)=>{if(!a){s.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(e){""!==e&&(e=e.trim().split(/\s\s+/),n+=parseInt(e[0],10)||0,i+=parseInt(e[1],10)||0)}))}r.swaptotal=1024*n*1024,r.swapused=1024*i*1024,r.swapfree=r.swaptotal-r.swapused,e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}}))}))},Et.memLayout=function(e){function t(e){const t=e.replace("0x","").toUpperCase();return 4===t.length&&{}.hasOwnProperty.call(Wt,t)?Wt[t]:e}return new Promise((r=>{process.nextTick((()=>{let n=[];if((Nt||Mt||Rt||Bt)&&_t('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',(function(i,s){if(!i){let e=s.toString().split("Memory Device");e.shift(),e.forEach((function(e){let r=e.split("\n");const i=Tt.getValue(r,"Size"),s=i.indexOf("GB")>=0?1024*parseInt(i,10)*1024*1024:1024*parseInt(i,10)*1024;let a=Tt.getValue(r,"Bank Locator");if(a.toLowerCase().indexOf("bad")>=0&&(a=""),parseInt(Tt.getValue(r,"Size"),10)>0){const e=Tt.toInt(Tt.getValue(r,"Total Width")),i=Tt.toInt(Tt.getValue(r,"Data Width"));n.push({size:s,bank:a,type:Tt.getValue(r,"Type:"),ecc:!(!i||!e)&&e>i,clockSpeed:Tt.getValue(r,"Configured Clock Speed:")?parseInt(Tt.getValue(r,"Configured Clock Speed:"),10):Tt.getValue(r,"Speed:")?parseInt(Tt.getValue(r,"Speed:"),10):null,formFactor:Tt.getValue(r,"Form Factor:"),manufacturer:t(Tt.getValue(r,"Manufacturer:")),partNum:Tt.getValue(r,"Part Number:"),serialNum:Tt.getValue(r,"Serial Number:"),voltageConfigured:parseFloat(Tt.getValue(r,"Configured Voltage:"))||null,voltageMin:parseFloat(Tt.getValue(r,"Minimum Voltage:"))||null,voltageMax:parseFloat(Tt.getValue(r,"Maximum Voltage:"))||null})}else n.push({size:0,bank:a,type:"Empty",ecc:null,clockSpeed:0,formFactor:Tt.getValue(r,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!n.length){n.push({size:Lt.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let e=Pt("cat /proc/cpuinfo 2>/dev/null"),t=e.toString().split("\n"),r=Tt.getValue(t,"hardware",":",!0).toUpperCase(),i=Tt.getValue(t,"revision",":",!0).toLowerCase();if("BCM2835"===r||"BCM2708"===r||"BCM2709"===r||"BCM2835"===r||"BCM2837"===r){const r={0:400,1:450,2:450,3:3200};n[0].type="LPDDR2",n[0].type=i&&i[2]&&"3"===i[2]?"LPDDR4":n[0].type,n[0].ecc=!1,n[0].clockSpeed=i&&i[2]&&r[i[2]]||400,n[0].clockSpeed=i&&i[4]&&"d"===i[4]?500:n[0].clockSpeed,n[0].formFactor="SoC",e=Pt("vcgencmd get_config sdram_freq 2>/dev/null"),t=e.toString().split("\n");let s=parseInt(Tt.getValue(t,"sdram_freq","=",!0),10)||0;s&&(n[0].clockSpeed=s),e=Pt("vcgencmd measure_volts sdram_p 2>/dev/null"),t=e.toString().split("\n");let a=parseFloat(Tt.getValue(t,"volt","=",!0))||0;a&&(n[0].voltageConfigured=a,n[0].voltageMin=a,n[0].voltageMax=a)}}catch(e){Tt.noop()}}e&&e(n),r(n)})),Dt&&_t("system_profiler SPMemoryDataType",(function(t,i){if(!t){const e=i.toString().split("\n"),t=Tt.getValue(e,"ecc",":",!0).toLowerCase();let r=i.toString().split(" BANK "),s=!0;1===r.length&&(r=i.toString().split(" DIMM"),s=!1),r.shift(),r.forEach((function(e){let r=e.split("\n");const i=(s?"BANK ":"DIMM")+r[0].trim().split("/")[0],a=parseInt(Tt.getValue(r," Size"));var o;a?n.push({size:1024*a*1024*1024,bank:i,type:Tt.getValue(r," Type:"),ecc:t?"enabled"===t:null,clockSpeed:parseInt(Tt.getValue(r," Speed:"),10),formFactor:"",manufacturer:(o=Tt.getValue(r," Manufacturer:"),{}.hasOwnProperty.call(Gt,o)?Gt[o]:o),partNum:Tt.getValue(r," Part Number:"),serialNum:Tt.getValue(r," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):n.push({size:0,bank:i,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!n.length){const e=i.toString().split("\n"),t=parseInt(Tt.getValue(e," Memory:")),r=Tt.getValue(e," Type:");t&&r&&n.push({size:1024*t*1024*1024,bank:"0",type:r,ecc:!1,clockSpeed:0,formFactor:"",manufacturer:"Apple",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}e&&e(n),r(n)})),Ft&&(e&&e(n),r(n)),kt){const t="Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"),i="Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");try{Tt.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl").then(((s,a)=>{if(!a){let e=s.toString().split(/\n\s*\n/);e.shift(),e.forEach((function(e){let r=e.split("\r\n");const s=Tt.toInt(Tt.getValue(r,"DataWidth",":")),a=Tt.toInt(Tt.getValue(r,"TotalWidth",":")),o=parseInt(Tt.getValue(r,"Capacity",":"),10)||0;o&&n.push({size:o,bank:Tt.getValue(r,"BankLabel",":"),type:t[parseInt(Tt.getValue(r,"MemoryType",":"),10)||parseInt(Tt.getValue(r,"SMBIOSMemoryType",":"),10)],ecc:!(!s||!a)&&a>s,clockSpeed:parseInt(Tt.getValue(r,"ConfiguredClockSpeed",":"),10)||parseInt(Tt.getValue(r,"Speed",":"),10)||0,formFactor:i[parseInt(Tt.getValue(r,"FormFactor",":"),10)||0],manufacturer:Tt.getValue(r,"Manufacturer",":"),partNum:Tt.getValue(r,"PartNumber",":"),serialNum:Tt.getValue(r,"SerialNumber",":"),voltageConfigured:(parseInt(Tt.getValue(r,"ConfiguredVoltage",":"),10)||0)/1e3,voltageMin:(parseInt(Tt.getValue(r,"MinVoltage",":"),10)||0)/1e3,voltageMax:(parseInt(Tt.getValue(r,"MaxVoltage",":"),10)||0)/1e3})}))}e&&e(n),r(n)}))}catch(t){e&&e(n),r(n)}}}))}))};const Ut=y.default.exec,$t=h.default,jt=L;let Ht=process.platform;const Xt="linux"===Ht||"android"===Ht,zt="darwin"===Ht,Kt="win32"===Ht,Yt="freebsd"===Ht,qt="openbsd"===Ht,Jt="netbsd"===Ht,Qt="sunos"===Ht;function Zt(e,t,r){const n={};let i=jt.getValue(e,"BatteryStatus",":").trim();if(i>=0){const s=i?parseInt(i):0;n.status=s,n.hasBattery=!0,n.maxCapacity=r||parseInt(jt.getValue(e,"DesignCapacity",":")||0),n.designedCapacity=parseInt(jt.getValue(e,"DesignCapacity",":")||t),n.voltage=parseInt(jt.getValue(e,"DesignVoltage",":")||0)/1e3,n.capacityUnit="mWh",n.percent=parseInt(jt.getValue(e,"EstimatedChargeRemaining",":")||0),n.currentCapacity=parseInt(n.maxCapacity*n.percent/100),n.isCharging=s>=6&&s<=9||11===s||3!==s&&1!==s&&n.percent<100,n.acConnected=n.isCharging||2===s,n.model=jt.getValue(e,"DeviceID",":")}else n.status=-1;return n}var er=function(e){return new Promise((t=>{process.nextTick((()=>{let r={hasBattery:!1,cycleCount:0,isCharging:!1,designedCapacity:0,maxCapacity:0,currentCapacity:0,voltage:0,capacityUnit:"",percent:0,timeRemaining:null,acConnected:!0,type:"",model:"",manufacturer:"",serial:""};if(Xt){let n="";$t.existsSync("/sys/class/power_supply/BAT1/uevent")?n="/sys/class/power_supply/BAT1/":$t.existsSync("/sys/class/power_supply/BAT0/uevent")&&(n="/sys/class/power_supply/BAT0/");let i=!1,s="";if($t.existsSync("/sys/class/power_supply/AC/online")?s="/sys/class/power_supply/AC/online":$t.existsSync("/sys/class/power_supply/AC0/online")&&(s="/sys/class/power_supply/AC0/online"),s){const e=$t.readFileSync(s);i="1"===e.toString().trim()}n?$t.readFile(n+"uevent",(function(n,s){if(n)e&&e(r),t(r);else{let n=s.toString().split("\n");r.isCharging="charging"===jt.getValue(n,"POWER_SUPPLY_STATUS","=").toLowerCase(),r.acConnected=i||r.isCharging,r.voltage=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,r.capacityUnit=r.voltage?"mWh":"mAh",r.cycleCount=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CYCLE_COUNT","="),10),r.maxCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_FULL","=",!0,!0),10)/1e3*(r.voltage||1));const a=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_VOLTAGE_MIN_DESIGN","="),10)/1e6;r.designedCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_FULL_DESIGN","=",!0,!0),10)/1e3*(a||r.voltage||1)),r.currentCapacity=Math.round(parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3*(r.voltage||1)),r.maxCapacity||(r.maxCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_FULL","=",!0,!0),10)/1e3,r.designedCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_FULL_DESIGN","=",!0,!0),10)/1e3|r.maxCapacity,r.currentCapacity=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);const o=jt.getValue(n,"POWER_SUPPLY_CAPACITY","="),l=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_ENERGY_NOW","="),10),c=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_POWER_NOW","="),10),u=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CURRENT_NOW","="),10),p=parseInt("0"+jt.getValue(n,"POWER_SUPPLY_CHARGE_NOW","="),10);r.percent=parseInt("0"+o,10),r.maxCapacity&&r.currentCapacity&&(r.hasBattery=!0,o||(r.percent=100*r.currentCapacity/r.maxCapacity)),r.isCharging&&(r.hasBattery=!0),l&&c?r.timeRemaining=Math.floor(l/c*60):u&&p?r.timeRemaining=Math.floor(p/u*60):u&&r.currentCapacity&&(r.timeRemaining=Math.floor(r.currentCapacity/u*60)),r.type=jt.getValue(n,"POWER_SUPPLY_TECHNOLOGY","="),r.model=jt.getValue(n,"POWER_SUPPLY_MODEL_NAME","="),r.manufacturer=jt.getValue(n,"POWER_SUPPLY_MANUFACTURER","="),r.serial=jt.getValue(n,"POWER_SUPPLY_SERIAL_NUMBER","="),e&&e(r),t(r)}})):(e&&e(r),t(r))}if((Yt||qt||Jt)&&Ut("sysctl -i hw.acpi.battery hw.acpi.acline",(function(n,i){let s=i.toString().split("\n");const a=parseInt("0"+jt.getValue(s,"hw.acpi.battery.units"),10),o=parseInt("0"+jt.getValue(s,"hw.acpi.battery.life"),10);r.hasBattery=a>0,r.cycleCount=null,r.isCharging="1"!==jt.getValue(s,"hw.acpi.acline"),r.acConnected=r.isCharging,r.maxCapacity=null,r.currentCapacity=null,r.capacityUnit="unknown",r.percent=a?o:null,e&&e(r),t(r)})),zt&&Ut('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %',(function(n,i){if(i){let e=i.toString().replace(/ +/g,"").replace(/"+/g,"").replace(/-/g,"").split("\n");r.cycleCount=parseInt("0"+jt.getValue(e,"cyclecount","="),10),r.voltage=parseInt("0"+jt.getValue(e,"voltage","="),10)/1e3,r.capacityUnit=r.voltage?"mWh":"mAh",r.maxCapacity=Math.round(parseInt("0"+jt.getValue(e,"applerawmaxcapacity","="),10)*(r.voltage||1)),r.currentCapacity=Math.round(parseInt("0"+jt.getValue(e,"applerawcurrentcapacity","="),10)*(r.voltage||1)),r.designedCapacity=Math.round(parseInt("0"+jt.getValue(e,"DesignCapacity","="),10)*(r.voltage||1)),r.manufacturer="Apple",r.serial=jt.getValue(e,"BatterySerialNumber","=");let t=null;let n=jt.getValue(e,"internal","Battery").split(";");if(n&&n[0]){let e=n[0].split("\t");e&&e[1]&&(t=parseFloat(e[1].trim().replace(/%/g,"")))}n&&n[1]?(r.isCharging="charging"===n[1].trim(),r.acConnected="discharging"!==n[1].trim()):(r.isCharging="yes"===jt.getValue(e,"ischarging","=").toLowerCase(),r.acConnected=r.isCharging),r.maxCapacity&&r.currentCapacity&&(r.hasBattery=!0,r.type="Li-ion",r.percent=null!==t?t:Math.round(100*r.currentCapacity/r.maxCapacity),r.isCharging||(r.timeRemaining=parseInt("0"+jt.getValue(e,"TimeRemaining","="),10)))}e&&e(r),t(r)})),Qt&&(e&&e(r),t(r)),Kt)try{const n=[];n.push(jt.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")),n.push(jt.powerShell("(Get-CimInstance -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")),n.push(jt.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")),jt.promiseAll(n).then((n=>{if(n){let e=n.results[0].split(/\n\s*\n/),t=[];const i=e=>/\S/.test(e);for(let r=0;r<e.length;r++)!i(e[r])||t.length&&i(e[r-1])||t.push([]),i(e[r])&&t[t.length-1].push(e[r]);let s=n.results[1].split("\r\n").filter((e=>e)),a=n.results[2].split("\r\n").filter((e=>e));if(t.length){let e=!1,n=[];for(let i=0;i<t.length;i++){const o=Zt(t[i][0].split("\r\n"),s&&s.length>=i+1&&s[i]?jt.toInt(s[i]):0,a&&a.length>=i+1&&a[i]?jt.toInt(a[i]):0);!e&&o.status>0&&10!==o.status?(r.hasBattery=o.hasBattery,r.maxCapacity=o.maxCapacity,r.designedCapacity=o.designedCapacity,r.voltage=o.voltage,r.capacityUnit=o.capacityUnit,r.percent=o.percent,r.currentCapacity=o.currentCapacity,r.isCharging=o.isCharging,r.acConnected=o.acConnected,r.model=o.model,e=!0):-1!==o.status&&n.push({hasBattery:o.hasBattery,maxCapacity:o.maxCapacity,designedCapacity:o.designedCapacity,voltage:o.voltage,capacityUnit:o.capacityUnit,percent:o.percent,currentCapacity:o.currentCapacity,isCharging:o.isCharging,timeRemaining:null,acConnected:o.acConnected,model:o.model,type:"",manufacturer:"",serial:""})}!e&&n.length&&(r=n[0],n.shift()),n.length&&(r.additionalBatteries=n)}}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},tr={};const rr=h.default,nr=y.default.exec,ir=y.default.execSync,sr=L;let ar=process.platform,or="";const lr="linux"===ar||"android"===ar,cr="darwin"===ar,ur="win32"===ar,pr="freebsd"===ar,fr="openbsd"===ar,dr="netbsd"===ar,mr="sunos"===ar;let hr=0,gr=0,yr=0,vr=0;const Sr={"-2":"UNINITIALIZED","-1":"OTHER",0:"HD15",1:"SVIDEO",2:"Composite video",3:"Component video",4:"DVI",5:"HDMI",6:"LVDS",8:"D_JPN",9:"SDI",10:"DP",11:"DP embedded",12:"UDI",13:"UDI embedded",14:"SDTVDONGLE",15:"MIRACAST",2147483648:"INTERNAL"};function wr(e){const t=[{pattern:"^LG.+",manufacturer:"LG"},{pattern:"^BENQ.+",manufacturer:"BenQ"},{pattern:"^ASUS.+",manufacturer:"Asus"},{pattern:"^DELL.+",manufacturer:"Dell"},{pattern:"^SAMSUNG.+",manufacturer:"Samsung"},{pattern:"^VIEWSON.+",manufacturer:"ViewSonic"},{pattern:"^SONY.+",manufacturer:"Sony"},{pattern:"^ACER.+",manufacturer:"Acer"},{pattern:"^AOC.+",manufacturer:"AOC Monitors"},{pattern:"^HP.+",manufacturer:"HP"},{pattern:"^EIZO.?",manufacturer:"Eizo"},{pattern:"^PHILIPS.?",manufacturer:"Philips"},{pattern:"^IIYAMA.?",manufacturer:"Iiyama"},{pattern:"^SHARP.?",manufacturer:"Sharp"},{pattern:"^NEC.?",manufacturer:"NEC"},{pattern:"^LENOVO.?",manufacturer:"Lenovo"},{pattern:"COMPAQ.?",manufacturer:"Compaq"},{pattern:"APPLE.?",manufacturer:"Apple"},{pattern:"INTEL.?",manufacturer:"Intel"},{pattern:"AMD.?",manufacturer:"AMD"},{pattern:"NVIDIA.?",manufacturer:"NVDIA"}];let r="";return e&&(e=e.toUpperCase(),t.forEach((t=>{RegExp(t.pattern).test(e)&&(r=t.manufacturer)}))),r}function xr(e){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[e]||""}function Cr(e){let t="";return(e=(e||"").toLowerCase()).indexOf("apple")>=0?t="0x05ac":e.indexOf("nvidia")>=0?t="0x10de":e.indexOf("intel")>=0?t="0x8086":(e.indexOf("ati")>=0||e.indexOf("amd")>=0)&&(t="0x1002"),t}tr.graphics=function(e){function t(e){const t=function(){if(or)return or;if(ur)try{const e=sr.WINDIR+"\\System32\\DriverStore\\FileRepository",t=rr.readdirSync(e).filter((t=>rr.readdirSync([e,t].join("/")).includes("nvidia-smi.exe"))).reduce(((t,r)=>{const n=rr.statSync([e,t,"nvidia-smi.exe"].join("/")),i=rr.statSync([e,r,"nvidia-smi.exe"].join("/"));return n.ctimeMs>i.ctimeMs?t:r}));t&&(or=[e,t,"nvidia-smi.exe"].join("/"))}catch(e){sr.noop()}else lr&&(or="nvidia-smi");return or}();if(e=e||sr.execOptsWin,t){const r=t+" "+"--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits"+(lr?" 2>/dev/null":"");try{return ir(r,e).toString()}catch(e){sr.noop()}}return""}function r(){function e(e){return[null,void 0].includes(e)?e:parseFloat(e)}const r=t();if(!r)return[];let n=r.split("\n").filter(Boolean).map((t=>{const r=t.split(", ").map((e=>e.includes("N/A")?void 0:e));return 16===r.length?{driverVersion:r[0],subDeviceId:r[1],name:r[2],pciBus:r[3],fanSpeed:e(r[4]),memoryTotal:e(r[5]),memoryUsed:e(r[6]),memoryFree:e(r[7]),utilizationGpu:e(r[8]),utilizationMemory:e(r[9]),temperatureGpu:e(r[10]),temperatureMemory:e(r[11]),powerDraw:e(r[12]),powerLimit:e(r[13]),clockCore:e(r[14]),clockMemory:e(r[15])}:{}}));return n=n.filter((e=>"pciBus"in e)),n}function n(e,t){return t.driverVersion&&(e.driverVersion=t.driverVersion),t.subDeviceId&&(e.subDeviceId=t.subDeviceId),t.name&&(e.name=t.name),t.pciBus&&(e.pciBus=t.pciBus),t.fanSpeed&&(e.fanSpeed=t.fanSpeed),t.memoryTotal&&(e.memoryTotal=t.memoryTotal,e.vram=t.memoryTotal,e.vramDynamic=!1),t.memoryUsed&&(e.memoryUsed=t.memoryUsed),t.memoryFree&&(e.memoryFree=t.memoryFree),t.utilizationGpu&&(e.utilizationGpu=t.utilizationGpu),t.utilizationMemory&&(e.utilizationMemory=t.utilizationMemory),t.temperatureGpu&&(e.temperatureGpu=t.temperatureGpu),t.temperatureMemory&&(e.temperatureMemory=t.temperatureMemory),t.powerDraw&&(e.powerDraw=t.powerDraw),t.powerLimit&&(e.powerLimit=t.powerLimit),t.clockCore&&(e.clockCore=t.clockCore),t.clockMemory&&(e.clockMemory=t.clockMemory),e}function i(e){let t={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},r=108;if("000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),"000000"===e.substr(r,6)&&(r+=36),t.resolutionX=parseInt("0x0"+e.substr(r+8,1)+e.substr(r+4,2)),t.resolutionY=parseInt("0x0"+e.substr(r+14,1)+e.substr(r+10,2)),t.sizeX=parseInt("0x0"+e.substr(r+28,1)+e.substr(r+24,2)),t.sizeY=parseInt("0x0"+e.substr(r+29,1)+e.substr(r+26,2)),r=e.indexOf("000000fc00"),r>=0){let n=e.substr(r+10,26);-1!==n.indexOf("0a")&&(n=n.substr(0,n.indexOf("0a")));try{n.length>2&&(t.model=n.match(/.{1,2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}catch(e){sr.noop()}}else t.model="";return t}return new Promise((t=>{process.nextTick((()=>{let s={controllers:[],displays:[]};if(cr){nr("system_profiler -xml -detailLevel full SPDisplaysDataType",(function(r,n){if(!r){try{const e=n.toString();s=function(e){const t={controllers:[],displays:[]};try{return e.forEach((function(e){const r=(e.sppci_bus||"").indexOf("builtin")>-1?"Built-In":(e.sppci_bus||"").indexOf("pcie")>-1?"PCIe":"",n=(parseInt(e.spdisplays_vram||"",10)||0)*((e.spdisplays_vram||"").indexOf("GB")>-1?1024:1),i=(parseInt(e.spdisplays_vram_shared||"",10)||0)*((e.spdisplays_vram_shared||"").indexOf("GB")>-1?1024:1);let s={spdisplays_mtlgpufamilymac1:"mac1",spdisplays_mtlgpufamilymac2:"mac2",spdisplays_mtlgpufamilyapple1:"apple1",spdisplays_mtlgpufamilyapple2:"apple2",spdisplays_mtlgpufamilyapple3:"apple3",spdisplays_mtlgpufamilyapple4:"apple4",spdisplays_mtlgpufamilyapple5:"apple5",spdisplays_mtlgpufamilyapple6:"apple6",spdisplays_mtlgpufamilyapple7:"apple7",spdisplays_metalfeaturesetfamily11:"family1_v1",spdisplays_metalfeaturesetfamily12:"family1_v2",spdisplays_metalfeaturesetfamily13:"family1_v3",spdisplays_metalfeaturesetfamily14:"family1_v4",spdisplays_metalfeaturesetfamily21:"family2_v1"}[e.spdisplays_metal||e.spdisplays_metalfamily||""]||"";t.controllers.push({vendor:wr(e.spdisplays_vendor||"")||e.spdisplays_vendor||"",model:e.sppci_model||"",bus:r,vramDynamic:"Built-In"===r,vram:n||i||null,deviceId:e["spdisplays_device-id"]||"",vendorId:e["spdisplays_vendor-id"]||Cr((e.spdisplays_vendor||"")+(e.sppci_model||"")),external:"spdisplays_egpu"===e.sppci_device_type,cores:e.sppci_cores||null,metalVersion:s}),e.spdisplays_ndrvs&&e.spdisplays_ndrvs.length&&e.spdisplays_ndrvs.forEach((function(e){const r=e.spdisplays_connection_type||"",n=(e._spdisplays_resolution||"").split("@"),i=n[0].split("x"),s=(e._spdisplays_pixels||"").split("x"),a=e.spdisplays_depth||"",o=e["_spdisplays_display-serial-number"]||e["_spdisplays_display-serial-number2"]||null;t.displays.push({vendor:xr(e["_spdisplays_display-vendor-id"]||"")||wr(e._name||""),vendorId:e["_spdisplays_display-vendor-id"]||"",model:e._name||"",productionYear:e["_spdisplays_display-year"]||null,serial:"0"!==o?o:null,displayId:e._spdisplays_displayID||null,main:!!e.spdisplays_main&&"spdisplays_yes"===e.spdisplays_main,builtin:(e.spdisplays_display_type||"").indexOf("built-in")>-1,connection:r.indexOf("_internal")>-1?"Internal":r.indexOf("_displayport")>-1?"Display Port":r.indexOf("_hdmi")>-1?"HDMI":null,sizeX:null,sizeY:null,pixelDepth:"CGSThirtyBitColor"===a?30:"CGSThirtytwoBitColor"===a?32:"CGSTwentyfourBitColor"===a?24:null,resolutionX:s.length>1?parseInt(s[0],10):null,resolutionY:s.length>1?parseInt(s[1],10):null,currentResX:i.length>1?parseInt(i[0],10):null,currentResY:i.length>1?parseInt(i[1],10):null,positionX:0,positionY:0,currentRefreshRate:n.length>1?parseInt(n[1],10):null})}))})),t}catch(e){return t}}(sr.plistParser(e)[0]._items)}catch(e){sr.noop()}try{const e=((n=ir('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""',{maxBuffer:2048e4}))||"").toString(),t=sr.plistReader(e);if(t.DisplayAnyUserSets&&t.DisplayAnyUserSets.Configs&&t.DisplayAnyUserSets.Configs[0]&&t.DisplayAnyUserSets.Configs[0].DisplayConfig){const e=t.DisplayAnyUserSets.Configs[0].DisplayConfig;let r=0;e.forEach((e=>{e.CurrentInfo&&void 0!==e.CurrentInfo.OriginX&&s.displays&&s.displays[r]&&(s.displays[r].positionX=e.CurrentInfo.OriginX),e.CurrentInfo&&void 0!==e.CurrentInfo.OriginY&&s.displays&&s.displays[r]&&(s.displays[r].positionY=e.CurrentInfo.OriginY),r++}))}if(t.DisplayAnyUserSets&&t.DisplayAnyUserSets.length>0&&t.DisplayAnyUserSets[0].length>0&&t.DisplayAnyUserSets[0][0].DisplayID){const e=t.DisplayAnyUserSets[0];let r=0;e.forEach((e=>{"OriginX"in e&&s.displays&&s.displays[r]&&(s.displays[r].positionX=e.OriginX),"OriginY"in e&&s.displays&&s.displays[r]&&(s.displays[r].positionY=e.OriginY),e.Mode&&void 0!==e.Mode.BitsPerPixel&&s.displays&&s.displays[r]&&(s.displays[r].pixelDepth=e.Mode.BitsPerPixel),r++}))}}catch(e){sr.noop()}}e&&e(s),t(s)}))}if(lr)if(sr.isRaspberry()&&sr.isRaspbian()){nr("fbset -s | grep 'mode \"'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;",(function(r,n){let i=n.toString().split("\n");if(i.length>3&&i[0].indexOf('mode "')>=-1&&i[2].indexOf("0x12000a")>-1){const e=i[0].replace("mode","").replace(/"/g,"").trim().split("x");2===e.length&&s.displays.push({vendor:"",model:sr.getValue(i,"device_name","="),main:!0,builtin:!1,connection:"HDMI",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:parseInt(e[0],10),resolutionY:parseInt(e[1],10),currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})}i.length>1&&n.toString().indexOf("gpu=")>=-1&&s.controllers.push({vendor:"Broadcom",model:sr.getRpiGpu(),bus:"",vram:sr.getValue(i,"gpu","=").replace("M",""),vramDynamic:!0}),e&&e(s),t(s)}))}else{nr("lspci -vvv 2>/dev/null",(function(a,o){if(!a){let e=o.toString().split("\n");s.controllers=function(e){let t=[],r={vendor:"",subVendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1,pciID:""},n=!1,i=[];try{i=ir('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split("\n");for(let e=0;e<i.length;e++)i[e]=i[e].replace("Bus Address:","").replace("0000:","").trim();i=i.filter((function(e){return null!=e&&e}))}catch(e){sr.noop()}let s=1;return e.forEach((a=>{let o="";if(s<e.length&&e[s]&&(o=e[s],o.indexOf(":")>0&&(o=o.split(":")[1])),""!==a.trim()){if(" "!==a[0]&&"\t"!==a[0]){let e=i.indexOf(a.split(" ")[0])>=0,s=a.toLowerCase().indexOf(" vga "),l=a.toLowerCase().indexOf("3d controller");if(-1!==s||-1!==l){-1!==l&&-1===s&&(s=l),(r.vendor||r.model||r.bus||null!==r.vram||r.vramDynamic)&&(t.push(r),r={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1});const c=a.split(" ")[0];/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(c)&&(r.busAddress=c),n=!0;let u=a.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),p=a.substr(s,u-s).split(":");if(r.busAddress=a.substr(0,s).trim(),p.length>1&&(p[1]=p[1].trim(),p[1].toLowerCase().indexOf("corporation")>=0?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("corporation")+11).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("corporation")+11,200).split("(")[0].trim(),r.bus=i.length>0&&e?"PCIe":"Onboard",r.vram=null,r.vramDynamic=!1):p[1].toLowerCase().indexOf(" inc.")>=0?((p[1].match(/]/g)||[]).length>1?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" inc.")+5).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf(" inc.")+5,200).trim().split("(")[0].trim()),r.bus=i.length>0&&e?"PCIe":"Onboard",r.vram=null,r.vramDynamic=!1):p[1].toLowerCase().indexOf(" ltd.")>=0&&((p[1].match(/]/g)||[]).length>1?(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(r.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" ltd.")+5).trim(),r.model=p[1].substr(p[1].toLowerCase().indexOf(" ltd.")+5,200).trim().split("(")[0].trim())),r.model&&-1!==o.indexOf(r.model))){const e=o.split(r.model)[0].trim();e&&(r.subVendor=e)}}else n=!1}if(n){let e=a.split(":");if(e.length>1&&-1!==e[0].replace(/ +/g,"").toLowerCase().indexOf("devicename")&&-1!==e[1].toLowerCase().indexOf("onboard")&&(r.bus="Onboard"),e.length>1&&-1!==e[0].replace(/ +/g,"").toLowerCase().indexOf("region")&&-1!==e[1].toLowerCase().indexOf("memory")){let t=e[1].split("=");t.length>1&&(r.vram=parseInt(t[1]))}}}s++})),(r.vendor||r.model||r.bus||r.busAddress||null!==r.vram||r.vramDynamic)&&t.push(r),t}(e);const t=r();s.controllers=s.controllers.map((e=>n(e,t.find((t=>t.pciBus.toLowerCase().endsWith(e.busAddress.toLowerCase())))||{})))}nr("clinfo --raw",(function(r,n){if(!r){let e=n.toString().split("\n");s.controllers=function(e,t){const r=/\[([^\]]+)\]\s+(\w+)\s+(.*)/,n=t.reduce(((e,t)=>{const n=r.exec(t.trim());return n&&(e[n[1]]||(e[n[1]]={}),e[n[1]][n[2]]=n[3]),e}),{});for(let t in n){const r=n[t];if("CL_DEVICE_TYPE_GPU"===r.CL_DEVICE_TYPE){let t;if(r.CL_DEVICE_TOPOLOGY_AMD){const e=r.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);e&&(t=e[0])}else if(r.CL_DEVICE_PCI_BUS_ID_NV&&r.CL_DEVICE_PCI_SLOT_ID_NV){const e=parseInt(r.CL_DEVICE_PCI_BUS_ID_NV),n=parseInt(r.CL_DEVICE_PCI_SLOT_ID_NV);if(!isNaN(e)&&!isNaN(n)){const r=n>>3&255,i=7&n;t=`${(255&e).toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}.${i}`}}if(t){let n=e.find((e=>e.busAddress===t));n||(n={vendor:"",model:"",bus:"",busAddress:t,vram:null,vramDynamic:!1},e.push(n)),n.vendor=r.CL_DEVICE_VENDOR,r.CL_DEVICE_BOARD_NAME_AMD?n.model=r.CL_DEVICE_BOARD_NAME_AMD:n.model=r.CL_DEVICE_NAME;const i=parseInt(r.CL_DEVICE_GLOBAL_MEM_SIZE);isNaN(i)||(n.vram=Math.round(i/1024/1024))}}}return e}(s.controllers,e)}nr("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'",(function(r,n){let a=0;if(!r){let e=n.toString().split("\n");a=parseInt(e[0])||0}nr("xrandr --verbose 2>/dev/null",(function(r,n){if(!r){let e=n.toString().split("\n");s.displays=function(e,t){let r=[],n={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},s=!1,a=!1,o="",l=0;for(let c=1;c<e.length;c++)if(""!==e[c].trim()){if(" "!==e[c][0]&&"\t"!==e[c][0]&&-1!==e[c].toLowerCase().indexOf(" connected ")){(n.model||n.main||n.builtin||n.connection||null!==n.sizeX||null!==n.pixelDepth||null!==n.resolutionX)&&(r.push(n),n={vendor:"",model:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null});let t=e[c].split(" ");n.connection=t[0],n.main=e[c].toLowerCase().indexOf(" primary ")>=0,n.builtin=t[0].toLowerCase().indexOf("edp")>=0}if(s)if(e[c].search(/\S|$/)>l)o+=e[c].toLowerCase().trim();else{let e=i(o);n.vendor=e.vendor,n.model=e.model,n.resolutionX=e.resolutionX,n.resolutionY=e.resolutionY,n.sizeX=e.sizeX,n.sizeY=e.sizeY,n.pixelDepth=t,s=!1}if(e[c].toLowerCase().indexOf("edid:")>=0&&(s=!0,l=e[c].search(/\S|$/)),e[c].toLowerCase().indexOf("*current")>=0){const t=e[c].split("(");if(t&&t.length>1&&t[0].indexOf("x")>=0){const e=t[0].trim().split("x");n.currentResX=sr.toInt(e[0]),n.currentResY=sr.toInt(e[1])}a=!0}if(a&&e[c].toLowerCase().indexOf("clock")>=0&&e[c].toLowerCase().indexOf("hz")>=0&&e[c].toLowerCase().indexOf("v: height")>=0){const t=e[c].split("clock");t&&t.length>1&&t[1].toLowerCase().indexOf("hz")>=0&&(n.currentRefreshRate=sr.toInt(t[1])),a=!1}}return(n.model||n.main||n.builtin||n.connection||null!==n.sizeX||null!==n.pixelDepth||null!==n.resolutionX)&&r.push(n),r}(e,a)}e&&e(s),t(s)}))}))}))}))}if((pr||fr||dr)&&(e&&e(null),t(null)),mr&&(e&&e(null),t(null)),ur)try{const i=[];i.push(sr.powerShell("Get-CimInstance win32_VideoController | fl *")),i.push(sr.powerShell('gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl')),i.push(sr.powerShell("Get-CimInstance win32_desktopmonitor | fl *")),i.push(sr.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")),i.push(sr.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")),i.push(sr.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")),i.push(sr.powerShell('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}'));const a=r();Promise.all(i).then((r=>{let i=r[0].replace(/\r/g,"").split(/\n\s*\n/),o=r[1].replace(/\r/g,"").split(/\n\s*\n/);s.controllers=function(e,t){const r={};for(const e in t)if({}.hasOwnProperty.call(t,e)&&""!==t[e].trim()){const n=t[e].trim().split("\n"),i=sr.getValue(n,"MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);if(i){const e=parseInt(sr.getValue(n,"HardwareInformation.qwMemorySize"));if(!isNaN(e)){let t=i[1].toUpperCase()+"&"+i[2].toUpperCase();i[3]&&(t+="&"+i[3].toUpperCase()),i[4]&&(t+="&"+i[4].toUpperCase()),r[t]=e}}}let n=[];for(let t in e)if({}.hasOwnProperty.call(e,t)&&""!==e[t].trim()){let i=e[t].trim().split("\n"),s=sr.getValue(i,"PNPDeviceID",":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i),a=null,o=null;if(s){if(a=s[3]||"",a&&(a=a.split("_")[1]),null==o&&s[3]&&s[4]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[3].toUpperCase()+"&"+s[4].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o&&s[3]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[3].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o&&s[4]){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase()+"&"+s[4].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}if(null==o){const e=s[1].toUpperCase()+"&"+s[2].toUpperCase();({}).hasOwnProperty.call(r,e)&&(o=r[e])}}n.push({vendor:sr.getValue(i,"AdapterCompatibility",":"),model:sr.getValue(i,"name",":"),bus:sr.getValue(i,"PNPDeviceID",":").startsWith("PCI")?"PCI":"",vram:(null==o?sr.toInt(sr.getValue(i,"AdapterRAM",":")):o)/1024/1024,vramDynamic:"2"===sr.getValue(i,"VideoMemoryType",":"),subDeviceId:a}),hr=sr.toInt(sr.getValue(i,"CurrentHorizontalResolution",":"))||hr,gr=sr.toInt(sr.getValue(i,"CurrentVerticalResolution",":"))||gr,vr=sr.toInt(sr.getValue(i,"CurrentRefreshRate",":"))||vr,yr=sr.toInt(sr.getValue(i,"CurrentBitsPerPixel",":"))||yr}return n}(i,o),s.controllers=s.controllers.map((e=>"nvidia"===e.vendor.toLowerCase()?n(e,a.find((t=>{let r=(e.subDeviceId||"").toLowerCase();const n=t.subDeviceId.split("x");let i=n.length>1?n[1].toLowerCase():n[0].toLowerCase();const s=Math.abs(r.length-i.length);if(r.length>i.length)for(let e=0;e<s;e++)i="0"+i;else if(r.length<i.length)for(let e=0;e<s;e++)r="0"+r;return r===i}))||{}):e));let l=r[2].replace(/\r/g,"").split(/\n\s*\n/);""===l[0].trim()&&l.shift(),l.length&&""===l[l.length-1].trim()&&l.pop();let c=r[3].replace(/\r/g,"").split("Active ");c.shift();let u=r[4].replace(/\r/g,"").split("BitsPerPixel ");u.shift();let p=r[5].replace(/\r/g,"").split(/\n\s*\n/);p.shift();const f=r[6].replace(/\r/g,"").split(/\n/);let d=[];f.forEach((e=>{const t=e.split("|");5===t.length&&d.push({vendor:t[0],code:t[1],model:t[2],serial:t[3],instanceId:t[4]})})),s.displays=function(e,t,r,n,i){let s=[],a="",o="",l="",c=0,u=0;if(r&&r.length){let e=r[0].split("\n");a=sr.getValue(e,"MonitorManufacturer",":"),o=sr.getValue(e,"Name",":"),l=sr.getValue(e,"PNPDeviceID",":").replace(/&amp;/g,"&").toLowerCase(),c=sr.toInt(sr.getValue(e,"ScreenWidth",":")),u=sr.toInt(sr.getValue(e,"ScreenHeight",":"))}for(let r=0;r<e.length;r++)if(""!==e[r].trim()){e[r]="BitsPerPixel "+e[r],t[r]="Active "+t[r],0!==n.length&&void 0!==n[r]||(n[r]="Unknown");let c=e[r].split("\n"),u=t[r].split("\n"),p=n[r].split("\n");const f=sr.getValue(c,"BitsPerPixel"),d=sr.getValue(c,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),m=sr.getValue(c,"Primary"),h=sr.getValue(u,"MaxHorizontalImageSize"),g=sr.getValue(u,"MaxVerticalImageSize"),y=sr.getValue(u,"InstanceName").toLowerCase(),v=sr.getValue(p,"VideoOutputTechnology"),S=sr.getValue(c,"DeviceName");let w="",x="";i.forEach((e=>{e.instanceId.toLowerCase().startsWith(y)&&a.startsWith("(")&&o.startsWith("PnP")&&(w=e.vendor,x=e.model)})),s.push({vendor:y.startsWith(l)&&""===w?a:w,model:y.startsWith(l)&&""===x?o:x,deviceName:S,main:"true"===m.toLowerCase(),builtin:"2147483648"===v,connection:v&&Sr[v]?Sr[v]:"",resolutionX:sr.toInt(sr.getValue(d,"Width",":")),resolutionY:sr.toInt(sr.getValue(d,"Height",":")),sizeX:h?parseInt(h,10):null,sizeY:g?parseInt(g,10):null,pixelDepth:f,currentResX:sr.toInt(sr.getValue(d,"Width",":")),currentResY:sr.toInt(sr.getValue(d,"Height",":")),positionX:sr.toInt(sr.getValue(d,"X",":")),positionY:sr.toInt(sr.getValue(d,"Y",":"))})}0===e.length&&s.push({vendor:a,model:o,main:!0,sizeX:null,sizeY:null,resolutionX:c,resolutionY:u,pixelDepth:null,currentResX:c,currentResY:u,positionX:0,positionY:0});return s}(u,c,l,p,d),1===s.displays.length&&(hr&&(s.displays[0].resolutionX=hr,s.displays[0].currentResX||(s.displays[0].currentResX=hr)),gr&&(s.displays[0].resolutionY=gr,0===s.displays[0].currentResY&&(s.displays[0].currentResY=gr)),yr&&(s.displays[0].pixelDepth=yr)),s.displays=s.displays.map((e=>(vr&&!e.currentRefreshRate&&(e.currentRefreshRate=vr),e))),e&&e(s),t(s)})).catch((()=>{e&&e(s),t(s)}))}catch(r){e&&e(s),t(s)}}))}))};var Or={};const Ir=L,br=h.default,Er=y.default.exec,Lr=y.default.execSync,_r=Ir.promisifySave(y.default.exec);let Pr=process.platform;const Tr="linux"===Pr||"android"===Pr,Vr="darwin"===Pr,Ar="win32"===Pr,Nr="freebsd"===Pr,Dr="openbsd"===Pr,kr="netbsd"===Pr,Mr="sunos"===Pr;let Rr={},Br={};function Fr(e){let t=[],r=0;return e.forEach((e=>{if(e.length>0)if("*"===e[0])r++;else{let n=e.split(":");n.length>1&&(t[r]||(t[r]={name:"",identifier:"",type:"disk",fsType:"",mount:"",size:0,physical:"HDD",uuid:"",label:"",model:"",serial:"",removable:!1,protocol:"",group:"",device:""}),n[0]=n[0].trim().toUpperCase().replace(/ +/g,""),n[1]=n[1].trim(),"DEVICEIDENTIFIER"===n[0]&&(t[r].identifier=n[1]),"DEVICENODE"===n[0]&&(t[r].name=n[1]),"VOLUMENAME"===n[0]&&-1===n[1].indexOf("Not applicable")&&(t[r].label=n[1]),"PROTOCOL"===n[0]&&(t[r].protocol=n[1]),"DISKSIZE"===n[0]&&(t[r].size=function(e){return parseInt(e.substr(e.indexOf(" (")+2,e.indexOf(" Bytes)")-10))}(n[1])),"FILESYSTEMPERSONALITY"===n[0]&&(t[r].fsType=n[1]),"MOUNTPOINT"===n[0]&&(t[r].mount=n[1]),"VOLUMEUUID"===n[0]&&(t[r].uuid=n[1]),"READ-ONLYMEDIA"===n[0]&&"Yes"===n[1]&&(t[r].physical="CD/DVD"),"SOLIDSTATE"===n[0]&&"Yes"===n[1]&&(t[r].physical="SSD"),"VIRTUAL"===n[0]&&(t[r].type="virtual"),"REMOVABLEMEDIA"===n[0]&&(t[r].removable="Removable"===n[1]),"PARTITIONTYPE"===n[0]&&(t[r].type="part"),"DEVICE/MEDIANAME"===n[0]&&(t[r].model=n[1]))}})),t}function Gr(e){let t=[];return e.filter((e=>""!==e)).forEach((e=>{try{e=(e=decodeURIComponent(e.replace(/\\x/g,"%"))).replace(/\\/g,"\\\\");let r=JSON.parse(e);t.push({name:r.name,type:r.type,fsType:r.fsType,mount:r.mountpoint,size:parseInt(r.size),physical:"disk"===r.type?"0"===r.rota?"SSD":"HDD":"rom"===r.type?"CD/DVD":"",uuid:r.uuid,label:r.label,model:(r.model||"").trim(),serial:r.serial,removable:"1"===r.rm,protocol:r.tran,group:r.group||""})}catch(e){Ir.noop()}})),t=Ir.unique(t),t=Ir.sortByKey(t,["type","name"]),t}function Wr(e){let t=e;try{e.forEach((e=>{if(e.type.startsWith("raid")){const r=function(e){const t=Ir.getValue(e,"md_level","="),r=Ir.getValue(e,"md_name","="),n=Ir.getValue(e,"md_uuid","="),i=[];return e.forEach((e=>{e.toLowerCase().startsWith("md_device_dev")&&e.toLowerCase().indexOf("/dev/")>0&&i.push(e.split("/dev/")[1])})),{raid:t,label:r,uuid:n,members:i}}(Lr(`mdadm --export --detail /dev/${e.name}`).toString().split("\n"));e.label=r.label,e.uuid=r.uuid,r.members&&r.members.length&&r.raid===e.type&&(t=t.map((t=>("linux_raid_member"===t.fsType&&r.members.indexOf(t.name)>=0&&(t.group=e.name),t))))}}))}catch(e){Ir.noop()}return t}function Ur(e,t){const r=function(e){const t=[];return e.forEach((e=>{const r=e.split("\r\n"),n=Ir.getValue(r,"DeviceID",":");let i=e.split("@{DeviceID=");i.length>1&&(i=i.slice(1),i.forEach((e=>{t.push({name:e.split(";")[0].toUpperCase(),device:n})})))})),t}(t);return e.map((e=>{const t=r.filter((t=>t.name===e.name.toUpperCase()));return t.length>0&&(e.device=t[0].device),e})),e}function $r(e){return e.toString().replace(/NAME=/g,'{"name":').replace(/FSTYPE=/g,',"fsType":').replace(/TYPE=/g,',"type":').replace(/SIZE=/g,',"size":').replace(/MOUNTPOINT=/g,',"mountpoint":').replace(/UUID=/g,',"uuid":').replace(/ROTA=/g,',"rota":').replace(/RO=/g,',"ro":').replace(/RM=/g,',"rm":').replace(/TRAN=/g,',"tran":').replace(/SERIAL=/g,',"serial":').replace(/LABEL=/g,',"label":').replace(/MODEL=/g,',"model":').replace(/OWNER=/g,',"owner":').replace(/GROUP=/g,',"group":').replace(/\n/g,"}\n")}function jr(e,t){let r={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return Rr&&Rr.ms?(r.rx=e,r.wx=t,r.tx=r.rx+r.wx,r.ms=Date.now()-Rr.ms,r.rx_sec=(r.rx-Rr.bytes_read)/(r.ms/1e3),r.wx_sec=(r.wx-Rr.bytes_write)/(r.ms/1e3),r.tx_sec=r.rx_sec+r.wx_sec,Rr.rx_sec=r.rx_sec,Rr.wx_sec=r.wx_sec,Rr.tx_sec=r.tx_sec,Rr.bytes_read=r.rx,Rr.bytes_write=r.wx,Rr.bytes_overall=r.rx+r.wx,Rr.ms=Date.now(),Rr.last_ms=r.ms):(r.rx=e,r.wx=t,r.tx=r.rx+r.wx,Rr.rx_sec=null,Rr.wx_sec=null,Rr.tx_sec=null,Rr.bytes_read=r.rx,Rr.bytes_write=r.wx,Rr.bytes_overall=r.rx+r.wx,Rr.ms=Date.now(),Rr.last_ms=0),r}function Hr(e,t,r,n,i){let s={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0};return Br&&Br.ms?(s.rIO=e,s.wIO=t,s.tIO=e+t,s.ms=Date.now()-Br.ms,s.rIO_sec=(s.rIO-Br.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-Br.wIO)/(s.ms/1e3),s.tIO_sec=s.rIO_sec+s.wIO_sec,s.rWaitTime=r,s.wWaitTime=n,s.tWaitTime=i,s.rWaitPercent=100*(s.rWaitTime-Br.rWaitTime)/s.ms,s.wWaitPercent=100*(s.wWaitTime-Br.wWaitTime)/s.ms,s.tWaitPercent=100*(s.tWaitTime-Br.tWaitTime)/s.ms,Br.rIO=e,Br.wIO=t,Br.rIO_sec=s.rIO_sec,Br.wIO_sec=s.wIO_sec,Br.tIO_sec=s.tIO_sec,Br.rWaitTime=r,Br.wWaitTime=n,Br.tWaitTime=i,Br.rWaitPercent=s.rWaitPercent,Br.wWaitPercent=s.wWaitPercent,Br.tWaitPercent=s.tWaitPercent,Br.last_ms=s.ms,Br.ms=Date.now()):(s.rIO=e,s.wIO=t,s.tIO=e+t,s.rWaitTime=r,s.wWaitTime=n,s.tWaitTime=i,Br.rIO=e,Br.wIO=t,Br.rIO_sec=null,Br.wIO_sec=null,Br.tIO_sec=null,Br.rWaitTime=r,Br.wWaitTime=n,Br.tWaitTime=i,Br.rWaitPercent=null,Br.wWaitPercent=null,Br.tWaitPercent=null,Br.last_ms=0,Br.ms=Date.now()),s}Or.fsSize=function(e,t){Ir.isFunction(e)&&(t=e,e="");let r=[],n=[];function i(e){let t=e.toString().split("\n");if(t.shift(),e.toString().toLowerCase().indexOf("filesystem")){let e=0;for(let r=0;r<t.length;r++)t[r]&&t[r].toLowerCase().startsWith("filesystem")&&(e=r);for(let r=0;r<e;r++)t.shift()}return t}function s(e){let t=[];return e.forEach((function(e){if(""!==e&&(e=e.replace(/ +/g," ").split(" "))&&(e[0].startsWith("/")||e[6]&&"/"===e[6]||e[0].indexOf("/")>0||1===e[0].indexOf(":")||!Vr&&!function(e){let t=!1;return["rootfs","unionfs","squashfs","cramfs","initrd","initramfs","devtmpfs","tmpfs","udev","devfs","specfs","type","appimaged"].forEach((r=>{e.toLowerCase().indexOf(r)>=0&&(t=!0)})),t}(e[1]))){const i=e[0],s=Tr||Nr||Dr||kr?e[1]:function(e){if(!e.startsWith("/"))return"NFS";const t=e.split("/"),n=t[t.length-1],i=r.filter((e=>e.indexOf(n)>=0));return 1===i.length&&i[0].indexOf("APFS")>=0?"APFS":"HFS"}(e[0]),a=1024*parseInt(Tr||Nr||Dr||kr?e[2]:e[1]),o=1024*parseInt(Tr||Nr||Dr||kr?e[3]:e[2]),l=1024*parseInt(Tr||Nr||Dr||kr?e[4]:e[3]),c=parseFloat((o/(o+l)*100).toFixed(2));let u=n&&Object.keys(n).length>0?n[i]||!1:null;e.splice(0,Tr||Nr||Dr||kr?6:5);const p=e.join(" ");t.find((e=>e.fs===i&&e.type===s))||t.push({fs:i,type:s,size:a,used:o,available:l,use:c,mount:p,rw:u})}})),t}return new Promise((a=>{process.nextTick((()=>{let o=[];if(Tr||Nr||Dr||kr||Vr){let l="";if(r=[],n={},Vr){l="df -kP";try{r=Lr("diskutil list").toString().split("\n").filter((e=>!e.startsWith("/")&&e.indexOf(":")>0)),Lr("mount").toString().split("\n").filter((e=>e.startsWith("/"))).forEach((e=>{n[e.split(" ")[0]]=-1===e.toLowerCase().indexOf("read-only")}))}catch(e){Ir.noop()}}if(Tr)try{l="export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL",Lr("cat /proc/mounts 2>/dev/null").toString().split("\n").filter((e=>e.startsWith("/"))).forEach((e=>{n[e.split(" ")[0]]=n[e.split(" ")[0]]||!1,-1===e.toLowerCase().indexOf("/snap/")&&(n[e.split(" ")[0]]=e.toLowerCase().indexOf("rw,")>=0||e.toLowerCase().indexOf(" rw ")>=0)}))}catch(e){Ir.noop()}if(Nr||Dr||kr)try{l="df -lkPT",Lr("mount").toString().split("\n").forEach((e=>{n[e.split(" ")[0]]=-1===e.toLowerCase().indexOf("read-only")}))}catch(e){Ir.noop()}Er(l,{maxBuffer:1048576},(function(r,n){let l=i(n);o=s(l),e&&(o=o.filter((t=>t.fs.toLowerCase().indexOf(e.toLowerCase())>=0||t.mount.toLowerCase().indexOf(e.toLowerCase())>=0))),r&&!o.length||""===n.toString().trim()?Er("df -kPT",{maxBuffer:1048576},(function(e,r){if(!e){let e=i(r);o=s(e)}t&&t(o),a(o)})):(t&&t(o),a(o))}))}if(Mr&&(t&&t(o),a(o)),Ar)try{const r=`Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${e?"| where -property Caption -eq "+e:""} | fl`;Ir.powerShell(r).then(((e,r)=>{if(!r){e.toString().split(/\n\s*\n/).forEach((function(e){let t=e.split("\r\n");const r=Ir.toInt(Ir.getValue(t,"size",":")),n=Ir.toInt(Ir.getValue(t,"freespace",":")),i=Ir.getValue(t,"caption",":"),s=Ir.getValue(t,"access",":"),a=s?1!==Ir.toInt(s):null;r&&o.push({fs:i,type:Ir.getValue(t,"filesystem",":"),size:r,used:r-n,available:n,use:parseFloat((100*(r-n)/r).toFixed(2)),mount:i,rw:a})}))}t&&t(o),a(o)}))}catch(e){t&&t(o),a(o)}}))}))},Or.fsOpenFiles=function(e){return new Promise((t=>{process.nextTick((()=>{const r={max:null,allocated:null,available:null};if(Nr||Dr||kr||Vr){Er("sysctl -i kern.maxfiles kern.num_files kern.open_files",{maxBuffer:1048576},(function(n,i){if(!n){let e=i.toString().split("\n");r.max=parseInt(Ir.getValue(e,"kern.maxfiles",":"),10),r.allocated=parseInt(Ir.getValue(e,"kern.num_files",":"),10)||parseInt(Ir.getValue(e,"kern.open_files",":"),10),r.available=r.max-r.allocated}e&&e(r),t(r)}))}Tr&&br.readFile("/proc/sys/fs/file-nr",(function(n,i){if(n)br.readFile("/proc/sys/fs/file-max",(function(n,i){if(!n){let e=i.toString().split("\n");e[0]&&(r.max=parseInt(e[0],10))}e&&e(r),t(r)}));else{let n=i.toString().split("\n");if(n[0]){const e=n[0].replace(/\s+/g," ").split(" ");3===e.length&&(r.allocated=parseInt(e[0],10),r.available=parseInt(e[1],10),r.max=parseInt(e[2],10),r.available||(r.available=r.max-r.allocated))}e&&e(r),t(r)}})),Mr&&(e&&e(null),t(null)),Ar&&(e&&e(null),t(null))}))}))},Or.blockDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Tr&&Er("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1048576},(function(n,i){if(n)Er("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1048576},(function(n,i){if(!n){let e=$r(i).split("\n");r=Gr(e),r=Wr(r)}e&&e(r),t(r)}));else{let n=$r(i).split("\n");r=Gr(n),r=Wr(r),r=function(e){let t=e;try{const r=function(e){const t=[];return e.forEach((e=>{e.type.startsWith("disk")&&t.push(e.name)})),t}(e);t=t.map((e=>((e.type.startsWith("part")||e.type.startsWith("disk"))&&r.forEach((t=>{e.name.startsWith(t)&&(e.device="/dev/"+t)})),e)))}catch(e){Ir.noop()}return t}(r),e&&e(r),t(r)}})),Vr&&Er("diskutil info -all",{maxBuffer:1048576},(function(n,i){if(!n){let e=i.toString().split("\n");r=Fr(e),r=function(e){let t=e;try{const r=function(e){const t=[];return e.forEach((e=>{if(e.type.startsWith("disk")&&t.push({name:e.name,model:e.model,device:e.name}),e.type.startsWith("virtual")){let r="";t.forEach((t=>{t.model===e.model&&(r=t.device)})),r&&t.push({name:e.name,model:e.model,device:r})}})),t}(e);t=t.map((e=>((e.type.startsWith("part")||e.type.startsWith("disk")||e.type.startsWith("virtual"))&&r.forEach((t=>{e.name.startsWith(t.name)&&(e.device=t.device)})),e)))}catch(e){Ir.noop()}return t}(r)}e&&e(r),t(r)})),Mr&&(e&&e(r),t(r)),Ar){let n=["Unknown","NoRoot","Removable","Local","Network","CD/DVD","RAM"];try{const i=[];i.push(Ir.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")),i.push(Ir.powerShell("Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl")),Ir.promiseAll(i).then((i=>{let s=i.results[0].toString().split(/\n\s*\n/),a=i.results[1].toString().split(/\n\s*\n/);s.forEach((function(e){let t=e.split("\r\n"),i=Ir.getValue(t,"drivetype",":");i&&r.push({name:Ir.getValue(t,"name",":"),identifier:Ir.getValue(t,"caption",":"),type:"disk",fsType:Ir.getValue(t,"filesystem",":").toLowerCase(),mount:Ir.getValue(t,"caption",":"),size:Ir.getValue(t,"size",":"),physical:i>=0&&i<=6?n[i]:n[0],uuid:Ir.getValue(t,"volumeserialnumber",":"),label:Ir.getValue(t,"volumename",":"),model:"",serial:Ir.getValue(t,"volumeserialnumber",":"),removable:"2"===i,protocol:"",group:"",device:""})})),r=Ur(r,a),e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}(Nr||Dr||kr)&&(e&&e(null),t(null))}))}))},Or.fsStats=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ar||Nr||Dr||kr||Mr)return t(null);let r={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0},n=0,i=0;Rr&&!Rr.ms||Rr&&Rr.ms&&Date.now()-Rr.ms>=500?(Tr&&Er("lsblk -r 2>/dev/null | grep /",{maxBuffer:1048576},(function(s,a){if(s)e&&e(r),t(r);else{let s=a.toString().split("\n"),o=[];s.forEach((function(e){""!==e&&(e=e.trim().split(" "),-1===o.indexOf(e[0])&&o.push(e[0]))}));let l=o.join("|");Er('cat /proc/diskstats | egrep "'+l+'"',{maxBuffer:1048576},(function(s,a){if(!s){a.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.replace(/ +/g," ").split(" "),n+=512*parseInt(e[5]),i+=512*parseInt(e[9]))})),r=jr(n,i)}e&&e(r),t(r)}))}})),Vr&&Er('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',{maxBuffer:1048576},(function(s,a){if(!s){a.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),n+=parseInt(e[2]),i+=parseInt(e[9]))})),r=jr(n,i)}e&&e(r),t(r)}))):(r.ms=Rr.last_ms,r.rx=Rr.bytes_read,r.wx=Rr.bytes_write,r.tx=Rr.bytes_read+Rr.bytes_write,r.rx_sec=Rr.rx_sec,r.wx_sec=Rr.wx_sec,r.tx_sec=Rr.tx_sec,e&&e(r),t(r))}))}))},Or.disksIO=function(e){return new Promise((t=>{process.nextTick((()=>{if(Ar)return t(null);if(Mr)return t(null);let r={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0},n=0,i=0,s=0,a=0,o=0;if(Br&&!Br.ms||Br&&Br.ms&&Date.now()-Br.ms>=500){if(Tr||Nr||Dr||kr){Er('for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done',{maxBuffer:1048576},(function(l,c){if(l)e&&e(r),t(r);else{c.split("\n").forEach((function(e){if(!e)return;let t=e.split(";");n+=parseInt(t[0]),i+=parseInt(t[4]),s+=parseInt(t[3]),a+=parseInt(t[7]),o+=parseInt(t[10])})),r=Hr(n,i,s,a,o),e&&e(r),t(r)}}))}Vr&&Er('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',{maxBuffer:1048576},(function(l,c){if(!l){c.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),n+=parseInt(e[10]),i+=parseInt(e[0]))})),r=Hr(n,i,s,a,o)}e&&e(r),t(r)}))}else r.rIO=Br.rIO,r.wIO=Br.wIO,r.tIO=Br.rIO+Br.wIO,r.ms=Br.last_ms,r.rIO_sec=Br.rIO_sec,r.wIO_sec=Br.wIO_sec,r.tIO_sec=Br.tIO_sec,r.rWaitTime=Br.rWaitTime,r.wWaitTime=Br.wWaitTime,r.tWaitTime=Br.tWaitTime,r.rWaitPercent=Br.rWaitPercent,r.wWaitPercent=Br.wWaitPercent,r.tWaitPercent=Br.tWaitPercent,e&&e(r),t(r)}))}))},Or.diskLayout=function(e){function t(e){const t=[{pattern:"WESTERN.*",manufacturer:"Western Digital"},{pattern:"^WDC.*",manufacturer:"Western Digital"},{pattern:"WD.*",manufacturer:"Western Digital"},{pattern:"TOSHIBA.*",manufacturer:"Toshiba"},{pattern:"HITACHI.*",manufacturer:"Hitachi"},{pattern:"^IC.*",manufacturer:"Hitachi"},{pattern:"^HTS.*",manufacturer:"Hitachi"},{pattern:"SANDISK.*",manufacturer:"SanDisk"},{pattern:"KINGSTON.*",manufacturer:"Kingston Technology"},{pattern:"^SONY.*",manufacturer:"Sony"},{pattern:"TRANSCEND.*",manufacturer:"Transcend"},{pattern:"SAMSUNG.*",manufacturer:"Samsung"},{pattern:"^ST(?!I\\ ).*",manufacturer:"Seagate"},{pattern:"^STI\\ .*",manufacturer:"SimpleTech"},{pattern:"^D...-.*",manufacturer:"IBM"},{pattern:"^IBM.*",manufacturer:"IBM"},{pattern:"^FUJITSU.*",manufacturer:"Fujitsu"},{pattern:"^MP.*",manufacturer:"Fujitsu"},{pattern:"^MK.*",manufacturer:"Toshiba"},{pattern:"MAXTO.*",manufacturer:"Maxtor"},{pattern:"PIONEER.*",manufacturer:"Pioneer"},{pattern:"PHILIPS.*",manufacturer:"Philips"},{pattern:"QUANTUM.*",manufacturer:"Quantum Technology"},{pattern:"FIREBALL.*",manufacturer:"Quantum Technology"},{pattern:"^VBOX.*",manufacturer:"VirtualBox"},{pattern:"CORSAIR.*",manufacturer:"Corsair Components"},{pattern:"CRUCIAL.*",manufacturer:"Crucial"},{pattern:"ECM.*",manufacturer:"ECM"},{pattern:"INTEL.*",manufacturer:"INTEL"},{pattern:"EVO.*",manufacturer:"Samsung"},{pattern:"APPLE.*",manufacturer:"Apple"}];let r="";return e&&(e=e.toUpperCase(),t.forEach((t=>{RegExp(t.pattern).test(e)&&(r=t.manufacturer)}))),r}return new Promise((r=>{process.nextTick((()=>{const n=t=>{for(let e=0;e<t.length;e++)delete t[e].BSDName;e&&e(t),r(t)};let i=[],s="";if(Tr){let e="";Er("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL",{maxBuffer:1048576},(function(r,a){if(!r)try{const r=a.toString().trim();let n=[];try{const e=JSON.parse(r);e&&{}.hasOwnProperty.call(e,"blockdevices")&&(n=e.blockdevices.filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model||null===e.mountpoint&&null===e.label&&null===e.fstype&&null===e.parttype&&e.path&&0!==e.path.indexOf("/ram")&&0!==e.path.indexOf("/loop")&&e["disc-max"]&&0!==e["disc-max"]))))}catch(e){try{let e=$r(Lr("export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL").toString()).split("\n");n=Gr(e).filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model&&""!==e.model||""===e.mount&&""===e.label&&""===e.fsType)))}catch(e){Ir.noop()}}n.forEach((r=>{let n="";const a="/dev/"+r.name,o=r.name;try{n=Lr("cat /sys/block/"+o+"/queue/rotational 2>/dev/null").toString().split("\n")[0]}catch(e){Ir.noop()}let l=r.tran?r.tran.toUpperCase().trim():"";"NVME"===l&&(n="2",l="PCIe"),i.push({device:a,type:"0"===n?"SSD":"1"===n?"HD":"2"===n?"NVMe":r.model&&r.model.indexOf("SSD")>-1?"SSD":r.model&&r.model.indexOf("NVM")>-1?"NVMe":"HD",name:r.model||"",vendor:t(r.model)||(r.vendor?r.vendor.trim():""),size:r.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:r.rev?r.rev.trim():"",serialNum:r.serial?r.serial.trim():"",interfaceType:l,smartStatus:"unknown",temperature:null,BSDName:a}),s+=`printf "\n${a}|"; smartctl -H ${a} | grep overall;`,e+=`${e?'printf ",";':""}smartctl -a -j ${a};`}))}catch(e){Ir.noop()}e?Er(e,{maxBuffer:1048576},(function(e,t){try{JSON.parse(`[${t}]`).forEach((e=>{const t=e.smartctl.argv[e.smartctl.argv.length-1];for(let r=0;r<i.length;r++)i[r].BSDName===t&&(i[r].smartStatus=e.smart_status.passed?"Ok":!1===e.smart_status.passed?"Predicted Failure":"unknown",e.temperature&&e.temperature.current&&(i[r].temperature=e.temperature.current),i[r].smartData=e)})),n(i)}catch(e){s?(s+='printf "\n"',Er(s,{maxBuffer:1048576},(function(e,t){t.toString().split("\n").forEach((e=>{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let r=t[1].split(":");if(2===r.length){r[1]=r[1].trim();let t=r[1].toLowerCase();for(let r=0;r<i.length;r++)i[r].BSDName===e&&(i[r].smartStatus="passed"===t?"Ok":"failed!"===t?"Predicted Failure":"unknown")}}}})),n(i)}))):n(i)}})):n(i)}))}if((Nr||Dr||kr)&&(e&&e(i),r(i)),Mr&&(e&&e(i),r(i)),Vr&&Er("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType",{maxBuffer:1048576},(function(n,a){if(!n){let n=a.toString().split("\n"),o=[],l=[],c=[],u="SATA";n.forEach((e=>{"NVMExpress:"===e?u="NVMe":"USB:"===e?u="USB":"SATA/SATA Express:"===e?u="SATA":"SATA"===u?o.push(e):"NVMe"===u?l.push(e):"USB"===u&&c.push(e)}));try{let e=o.join("\n").split(" Physical Interconnect: ");e.shift(),e.forEach((function(e){let r=(e="InterfaceType: "+e).split("\n");const n=Ir.getValue(r,"Medium Type",":",!0).trim(),a=Ir.getValue(r,"capacity",":",!0).trim(),o=Ir.getValue(r,"BSD Name",":",!0).trim();if(a){let e=0;if(a.indexOf("(")>=0&&(e=parseInt(a.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(a)),e){const a=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:o,type:n.startsWith("Solid")?"SSD":"HD",name:Ir.getValue(r,"Model",":",!0).trim(),vendor:t(Ir.getValue(r,"Model",":",!0).trim())||Ir.getValue(r,"Manufacturer",":",!0),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:Ir.getValue(r,"InterfaceType",":",!0).trim(),smartStatus:"verified"===a?"OK":a||"unknown",temperature:null,BSDName:o}),s=s+'printf "\n'+o+'|"; diskutil info /dev/'+o+" | grep SMART;"}}}))}catch(e){Ir.noop()}try{let e=l.join("\n").split("\n\n Capacity:");e.shift(),e.forEach((function(e){let r=(e="!Capacity: "+e).split("\n");const n=Ir.getValue(r,"link width",":",!0).trim(),a=Ir.getValue(r,"!capacity",":",!0).trim(),o=Ir.getValue(r,"BSD Name",":",!0).trim();if(a){let e=0;if(a.indexOf("(")>=0&&(e=parseInt(a.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(a)),e){const a=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:o,type:"NVMe",name:Ir.getValue(r,"Model",":",!0).trim(),vendor:t(Ir.getValue(r,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+n).trim(),smartStatus:"verified"===a?"OK":a||"unknown",temperature:null,BSDName:o}),s=s+'printf "\n'+o+'|"; diskutil info /dev/'+o+" | grep SMART;"}}}))}catch(e){Ir.noop()}try{let e=c.join("\n").replaceAll("Media:\n ","Model:").split("\n\n Product ID:");e.shift(),e.forEach((function(e){let r=e.split("\n");const n=Ir.getValue(r,"Capacity",":",!0).trim(),a=Ir.getValue(r,"BSD Name",":",!0).trim();if(n){let e=0;if(n.indexOf("(")>=0&&(e=parseInt(n.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),e||(e=parseInt(n)),e){const n=Ir.getValue(r,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:a,type:"USB",name:Ir.getValue(r,"Model",":",!0).trim().replaceAll(":",""),vendor:t(Ir.getValue(r,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:Ir.getValue(r,"Revision",":",!0).trim(),serialNum:Ir.getValue(r,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:"verified"===n?"OK":n||"unknown",temperature:null,BSDName:a}),s=s+'printf "\n'+a+'|"; diskutil info /dev/'+a+" | grep SMART;"}}}))}catch(e){Ir.noop()}if(s)s+='printf "\n"',Er(s,{maxBuffer:1048576},(function(t,n){n.toString().split("\n").forEach((e=>{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let r=t[1].split(":");if(2===r.length){r[1]=r[1].trim();let t=r[1].toLowerCase();for(let r=0;r<i.length;r++)i[r].BSDName===e&&(i[r].smartStatus="not supported"===t?"not supported":"verified"===t?"Ok":"failing"===t?"Predicted Failure":"unknown")}}}}));for(let e=0;e<i.length;e++)delete i[e].BSDName;e&&e(i),r(i)}));else{for(let e=0;e<i.length;e++)delete i[e].BSDName;e&&e(i),r(i)}}})),Ar)try{const n=[];if(n.push(Ir.powerShell("Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl")),n.push(Ir.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")),Ir.smartMonToolsInstalled())try{const e=JSON.parse(Lr("smartctl --scan -j").toString());e&&e.devices&&e.devices.length>0&&e.devices.forEach((e=>{n.push(_r(`smartctl -j -a ${e.name}`,Ir.execOptsWin))}))}catch(e){Ir.noop()}Ir.promiseAll(n).then((n=>{let s=n.results[0].toString().split(/\n\s*\n/);s.forEach((function(e){let r=e.split("\r\n");const n=Ir.getValue(r,"Size",":").trim(),s=Ir.getValue(r,"Status",":").trim().toLowerCase();n&&i.push({device:Ir.getValue(r,"DeviceId",":"),type:e.indexOf("SSD")>-1?"SSD":"HD",name:Ir.getValue(r,"Caption",":"),vendor:t(Ir.getValue(r,"Caption",":",!0).trim()),size:parseInt(n),bytesPerSector:parseInt(Ir.getValue(r,"BytesPerSector",":")),totalCylinders:parseInt(Ir.getValue(r,"TotalCylinders",":")),totalHeads:parseInt(Ir.getValue(r,"TotalHeads",":")),totalSectors:parseInt(Ir.getValue(r,"TotalSectors",":")),totalTracks:parseInt(Ir.getValue(r,"TotalTracks",":")),tracksPerCylinder:parseInt(Ir.getValue(r,"TracksPerCylinder",":")),sectorsPerTrack:parseInt(Ir.getValue(r,"SectorsPerTrack",":")),firmwareRevision:Ir.getValue(r,"FirmwareRevision",":").trim(),serialNum:Ir.getValue(r,"SerialNumber",":").trim(),interfaceType:Ir.getValue(r,"InterfaceType",":").trim(),smartStatus:"ok"===s?"Ok":"degraded"===s?"Degraded":"pred fail"===s?"Predicted Failure":"Unknown",temperature:null})})),s=n.results[1].split(/\n\s*\n/),s.forEach((function(e){let t=e.split("\r\n");const r=Ir.getValue(t,"SerialNumber",":").trim(),n=Ir.getValue(t,"FriendlyName",":").trim().replace("Msft ","Microsoft"),s=Ir.getValue(t,"Size",":").trim(),a=Ir.getValue(t,"Model",":").trim(),o=Ir.getValue(t,"BusType",":").trim();let l=Ir.getValue(t,"MediaType",":").trim();if("3"!==l&&"HDD"!==l||(l="HD"),"4"===l&&(l="SSD"),"5"===l&&(l="SCM"),"Unspecified"===l&&(a.toLowerCase().indexOf("virtual")>-1||a.toLowerCase().indexOf("vbox")>-1)&&(l="Virtual"),s){let e=Ir.findObjectByKey(i,"serialNum",r);-1!==e&&""!==r||(e=Ir.findObjectByKey(i,"name",n)),-1!=e&&(i[e].type=l,i[e].interfaceType=o)}})),n.results.shift(),n.results.shift(),n.results.length&&n.results.forEach((e=>{try{const t=JSON.parse(e);if(t.serial_number){const e=t.serial_number;let r=Ir.findObjectByKey(i,"serialNum",e);-1!=r&&(i[r].smartStatus=t.smart_status&&t.smart_status.passed?"Ok":t.smart_status&&!1===t.smart_status.passed?"Predicted Failure":"unknown",t.temperature&&t.temperature.current&&(i[r].temperature=t.temperature.current),i[r].smartData=t)}}catch(e){Ir.noop()}})),e&&e(i),r(i)}))}catch(t){e&&e(i),r(i)}}))}))};var Xr={};const zr=m.default,Kr=y.default.exec,Yr=y.default.execSync,qr=h.default,Jr=L;let Qr=process.platform;const Zr="linux"===Qr||"android"===Qr,en="darwin"===Qr,tn="win32"===Qr,rn="freebsd"===Qr,nn="openbsd"===Qr,sn="netbsd"===Qr,an="sunos"===Qr;let on,ln={},cn="",un={},pn=[],fn=[],dn={};function mn(){let e="",t="";try{let r=zr.networkInterfaces(),n=9999;for(let i in r)({}).hasOwnProperty.call(r,i)&&r[i].forEach((function(r){r&&!1===r.internal&&(t=t||i,r.scopeid&&r.scopeid<n&&(e=i,n=r.scopeid))}));if(e=e||t||"",tn){let t="";const n=Yr("netstat -r",Jr.execOptsWin);if(n.toString().split(zr.EOL).forEach((e=>{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const r=e.split(" ");r.length>=5&&(t=r[r.length-2])}})),t)for(let n in r)({}).hasOwnProperty.call(r,n)&&r[n].forEach((function(r){r&&r.address&&r.address===t&&(e=n)}))}if(Zr){let t=Yr("ip route 2> /dev/null | grep default").toString().split("\n")[0].split(/\s+/);"none"===t[0]&&t[5]?e=t[5]:t[4]&&(e=t[4]),e.indexOf(":")>-1&&(e=e.split(":")[1].trim())}if(en||rn||nn||sn||an){let t="";Zr&&(t="ip route 2> /dev/null | grep default | awk '{print $5}'"),en&&(t="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(rn||nn||sn||an)&&(t="route get 0.0.0.0 | grep interface:");let r=Yr(t);e=r.toString().split("\n")[0],e.indexOf(":")>-1&&(e=e.split(":")[1].trim())}}catch(e){Jr.noop()}return e&&(cn=e),cn}function hn(){let e="",t="",r={};if(Zr||rn||nn||sn){if(void 0===on)try{const e=Yr("which ip").toString().split("\n");on=e.length&&-1===e[0].indexOf(":")&&0===e[0].indexOf("/")?e[0]:""}catch(e){on=""}try{const n=Yr("export LC_ALL=C; "+(on?on+" link show up":"/sbin/ifconfig")+"; unset LC_ALL").toString().split("\n");for(let i=0;i<n.length;i++)if(n[i]&&" "!==n[i][0]){if(on){let r=n[i+1].trim().split(" ");"link/ether"===r[0]&&(e=n[i].split(" ")[1],e=e.slice(0,e.length-1),t=r[1])}else e=n[i].split(" ")[0],t=n[i].split("HWaddr ")[1];e&&t&&(r[e]=t.trim(),e="",t="")}}catch(e){Jr.noop()}}if(en)try{const n=Yr("/sbin/ifconfig").toString().split("\n");for(let i=0;i<n.length;i++)n[i]&&"\t"!==n[i][0]&&n[i].indexOf(":")>0?e=n[i].split(":")[0]:0===n[i].indexOf("\tether ")&&(t=n[i].split("\tether ")[1],e&&t&&(r[e]=t.trim(),e="",t=""))}catch(e){Jr.noop()}return r}function gn(){return new Promise((e=>{process.nextTick((()=>{let t="Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";t+="Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";try{Jr.powerShell("Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled").then((t=>{const r=((t=t.split("#-#-#-#"))[0]||"").split(/\n\s*\n/),n=(t[1]||"").split(/\n\s*\n/);e(function(e,t){let r=[];for(let n in e)if({}.hasOwnProperty.call(e,n)&&""!==e[n].trim()){let i=e[n].trim().split("\r\n"),s=t&&t[n]?t[n].trim().split("\r\n"):[],a=Jr.getValue(i,"NetEnabled",":"),o="9"===Jr.getValue(i,"AdapterTypeID",":")?"wireless":"wired",l=Jr.getValue(i,"Name",":").replace(/\]/g,")").replace(/\[/g,"("),c=Jr.getValue(i,"NetConnectionID",":").replace(/\]/g,")").replace(/\[/g,"(");if((l.toLowerCase().indexOf("wi-fi")>=0||l.toLowerCase().indexOf("wireless")>=0)&&(o="wireless"),""!==a){const e=parseInt(Jr.getValue(i,"speed",":").trim(),10)/1e6;r.push({mac:Jr.getValue(i,"MACAddress",":").toLowerCase(),dhcp:"true"===Jr.getValue(s,"dhcpEnabled",":").toLowerCase(),name:l,iface:c,netEnabled:"TRUE"===a,speed:isNaN(e)?null:e,operstate:"2"===Jr.getValue(i,"NetConnectionStatus",":")?"up":"down",type:o})}}return r}(r,n))}))}catch(t){e([])}}))}))}function yn(e,t){let r="";const n=t+".";try{const t=e.filter((e=>n.includes(e.name+"."))).map((e=>e.dnsSuffix));return t[0]&&(r=t[0]),r||(r=""),r}catch(e){return"Unknown"}}function vn(e,t,r){let n={state:"Unknown",protocol:"Unknown"};if("Disabled"===r)return n.state="Disabled",n.protocol="Not defined",n;if("wired"==e&&r.length>0)try{const e=r.find((e=>e.includes(t+"\r\n"))).split("\r\n"),i=e.find((e=>e.includes("802.1x")));if(i.includes("Disabled"))n.state="Disabled",n.protocol="Not defined";else if(i.includes("Enabled")){const t=e.find((e=>e.includes("EAP")));n.protocol=t.split(":").pop(),n.state="Enabled"}}catch(e){return n}else if("wireless"==e){let e="",r="";try{const i=function(e){try{return Yr(`netsh wlan show interface name="${e}" | findstr "SSID"`,Jr.execOptsWin).split("\r\n").shift().split(":").pop()}catch(e){return"Unknown"}}(t);"Unknown"!==i&&(e=Yr(`netsh wlan show profiles "${i}" | findstr "802.1X"`,Jr.execOptsWin),r=Yr(`netsh wlan show profiles "${i}" | findstr "EAP"`,Jr.execOptsWin)),e.includes(":")&&r.includes(":")&&(n.state=e.split(":").pop(),n.protocol=r.split(":").pop())}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")&&(n.state="Disabled",n.protocol="Not defined"),n}}return n}function Sn(e){const t=[];let r=[];return e.forEach((function(e){e.startsWith("\t")||e.startsWith(" ")||r.length&&(t.push(r),r=[]),r.push(e)})),r.length&&t.push(r),t}function wn(){try{const e=Yr("/sbin/ifconfig -v",{maxBuffer:2048e4}).toString().split("\n");return function(e){let t=[];return e.forEach((e=>{let r={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1};const n=e[0];r.iface=n.split(":")[0].trim();let i=n.split("> mtu");r.mtu=i.length>1?parseInt(i[1],10):null,isNaN(r.mtu)&&(r.mtu=null),r.internal=i[0].toLowerCase().indexOf("loopback")>-1,e.forEach((e=>{e.trim().startsWith("ether ")&&(r.mac=e.split("ether ")[1].toLowerCase().trim()),e.trim().startsWith("inet6 ")&&!r.ip6&&(r.ip6=e.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),e.trim().startsWith("inet ")&&!r.ip4&&(r.ip4=e.split("inet ")[1].toLowerCase().split(" ")[0])}));let s=Jr.getValue(e,"link rate");r.speed=s?parseFloat(s):null,null===r.speed?(s=Jr.getValue(e,"uplink rate"),r.speed=s?parseFloat(s):null,null!==r.speed&&s.toLowerCase().indexOf("gbps")>=0&&(r.speed=1e3*r.speed)):s.toLowerCase().indexOf("gbps")>=0&&(r.speed=1e3*r.speed),r.type=Jr.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired";const a=Jr.getValue(e,"status").toLowerCase();r.operstate="active"===a?"up":"inactive"===a?"down":"unknown",r.duplex=Jr.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(r.ip6||r.ip4||r.mac)&&t.push(r)})),t}(Sn(e))}catch(e){return[]}}function xn(e){const t=`nmcli device status 2>/dev/null | grep ${e}`;try{const e=Yr(t).toString().replace(/\s+/g," ").trim(),r=e.split(" ").slice(3).join(" ");return"--"!=r?r:""}catch(e){return""}}function Cn(e){let t=[];try{let r=`cat ${e} 2> /dev/null | grep 'iface\\|source'`;Yr(r,{maxBuffer:2048e4}).toString().split("\n").forEach((e=>{const r=e.replace(/\s+/g," ").trim().split(" ");if(r.length>=4&&e.toLowerCase().indexOf(" inet ")>=0&&e.toLowerCase().indexOf("dhcp")>=0&&t.push(r[1]),e.toLowerCase().includes("source")){let r=e.split(" ")[1];t=t.concat(Cn(r))}}))}catch(e){Jr.noop()}return t}function On(){let e=[];try{const t=Yr("ip a 2> /dev/null",{maxBuffer:2048e4}).toString().split("\n");e=function(e){const t=[];e&&e.length&&e.forEach((e=>{if(e&&e.length){if(e[0].split(":").length>2)for(let r of e)if(r.indexOf(" inet ")>=0&&r.indexOf(" dynamic ")>=0){const e=r.split(" "),n=e[e.length-1].trim();t.push(n);break}}}));return t}(Sn(t))}catch(e){Jr.noop()}try{e=Cn("/etc/network/interfaces")}catch(e){Jr.noop()}return e}function In(e,t,r){let n=!1;if(!t)return r.indexOf(e)>=0;{const i=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.method;`;try{const e=Yr(i).toString();if("auto"===e.replace(/\s+/g," ").trim().split(" ").slice(1).toString())n=!0;else n=!1;return n}catch(t){return r.indexOf(e)>=0}}}function bn(e){let t=!1;const r=`ipconfig getpacket "${e}" 2>/dev/null | grep lease_time;`;try{const e=Yr(r).toString().split("\n");e.length&&e[0].startsWith("lease_time")&&(t=!0)}catch(e){Jr.noop()}return t}function En(e){if(!e)return"Unknown";{const t=`nmcli connection show "${e}" 2>/dev/null | grep ipv4.dns-search;`;try{const e=Yr(t).toString(),r=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==r?"Not defined":r}catch(e){return"Unknown"}}}function Ln(e){if(!e)return"Not defined";{const t=`nmcli connection show "${e}" 2>/dev/null | grep 802-1x.eap;`;try{const e=Yr(t).toString(),r=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==r?"":r}catch(e){return"Not defined"}}}function _n(e,t,r){return!!r&&(["00:00:00:00:00:00","00:03:FF","00:05:69","00:0C:29","00:0F:4B","00:13:07","00:13:BE","00:15:5d","00:16:3E","00:1C:42","00:21:F6","00:24:0B","00:50:56","00:A0:B1","00:E0:C8","08:00:27","0A:00:27","18:92:2C","16:DF:49","3C:F3:92","54:52:00","FC:15:97"].filter((e=>r.toUpperCase().toUpperCase().startsWith(e.substring(0,r.length)))).length>0||e.toLowerCase().indexOf(" virtual ")>-1||t.toLowerCase().indexOf(" virtual ")>-1||e.toLowerCase().indexOf("vethernet ")>-1||t.toLowerCase().indexOf("vethernet ")>-1||e.toLowerCase().startsWith("veth")||t.toLowerCase().startsWith("veth")||e.toLowerCase().startsWith("vboxnet")||t.toLowerCase().startsWith("vboxnet"))}function Pn(e,t,r){return"string"==typeof e&&(r=e,t=!0,e=null),"boolean"==typeof e&&(t=e,e=null,r=""),void 0===t&&(t=!0),r=""+(r=r||""),new Promise((n=>{process.nextTick((()=>{let i=zr.networkInterfaces(),s=[],a=[],o=[],l=[];if(en||rn||nn||sn)if(JSON.stringify(i)!==JSON.stringify(un)||t){const t=mn();un=JSON.parse(JSON.stringify(i)),a=wn(),a.forEach((e=>{({}).hasOwnProperty.call(i,e.iface)&&i[e.iface].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(e.ip4subnet=t.netmask),"IPv6"!==t.family&&6!==t.family||(e.ip6subnet=t.netmask)}));let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e.iface),a=Jr.mathMin(n.length,2e3);for(let e=0;e<=a;e++)void 0!==n[e]&&(r+=n[e]);s.push({iface:e.iface,ifaceName:e.iface,default:e.iface===t,ip4:e.ip4,ip4subnet:e.ip4subnet||"",ip6:e.ip6,ip6subnet:e.ip6subnet||"",mac:e.mac,internal:e.internal,virtual:!e.internal&&_n(e.iface,e.iface,e.mac),operstate:e.operstate,type:e.type,duplex:e.duplex,mtu:e.mtu,speed:e.speed,dhcp:bn(r),dnsSuffix:"",ieee8021xAuth:"",ieee8021xState:"",carrierChanges:0})})),fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}else s=fn,e&&e(s),n(s);if(Zr)if(JSON.stringify(i)!==JSON.stringify(un)||t){un=JSON.parse(JSON.stringify(i)),pn=On();const t=mn();for(let e in i){let r="",n="",a="",o="",l="",u="",p="",f=null,d=0,m=!1,h="",g="",y="",v="";if({}.hasOwnProperty.call(i,e)){let S=e;i[e].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(r=t.address,n=t.netmask),"IPv6"!==t.family&&6!==t.family||a&&!a.match(/^fe80::/i)||(a=t.address,o=t.netmask),l=t.mac;const i=parseInt(process.versions.node.split("."),10);l.indexOf("00:00:0")>-1&&(Zr||en)&&!t.internal&&i>=8&&i<=11&&(0===Object.keys(dn).length&&(dn=hn()),l=dn[e]||"")}));let w=e.split(":")[0].trim().toLowerCase(),x="";const C=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(w),O=Jr.mathMin(C.length,2e3);for(let e=0;e<=O;e++)void 0!==C[e]&&(x+=C[e]);const I=`echo -n "addr_assign_type: "; cat /sys/class/net/${x}/addr_assign_type 2>/dev/null; echo;\n echo -n "address: "; cat /sys/class/net/${x}/address 2>/dev/null; echo;\n echo -n "addr_len: "; cat /sys/class/net/${x}/addr_len 2>/dev/null; echo;\n echo -n "broadcast: "; cat /sys/class/net/${x}/broadcast 2>/dev/null; echo;\n echo -n "carrier: "; cat /sys/class/net/${x}/carrier 2>/dev/null; echo;\n echo -n "carrier_changes: "; cat /sys/class/net/${x}/carrier_changes 2>/dev/null; echo;\n echo -n "dev_id: "; cat /sys/class/net/${x}/dev_id 2>/dev/null; echo;\n echo -n "dev_port: "; cat /sys/class/net/${x}/dev_port 2>/dev/null; echo;\n echo -n "dormant: "; cat /sys/class/net/${x}/dormant 2>/dev/null; echo;\n echo -n "duplex: "; cat /sys/class/net/${x}/duplex 2>/dev/null; echo;\n echo -n "flags: "; cat /sys/class/net/${x}/flags 2>/dev/null; echo;\n echo -n "gro_flush_timeout: "; cat /sys/class/net/${x}/gro_flush_timeout 2>/dev/null; echo;\n echo -n "ifalias: "; cat /sys/class/net/${x}/ifalias 2>/dev/null; echo;\n echo -n "ifindex: "; cat /sys/class/net/${x}/ifindex 2>/dev/null; echo;\n echo -n "iflink: "; cat /sys/class/net/${x}/iflink 2>/dev/null; echo;\n echo -n "link_mode: "; cat /sys/class/net/${x}/link_mode 2>/dev/null; echo;\n echo -n "mtu: "; cat /sys/class/net/${x}/mtu 2>/dev/null; echo;\n echo -n "netdev_group: "; cat /sys/class/net/${x}/netdev_group 2>/dev/null; echo;\n echo -n "operstate: "; cat /sys/class/net/${x}/operstate 2>/dev/null; echo;\n echo -n "proto_down: "; cat /sys/class/net/${x}/proto_down 2>/dev/null; echo;\n echo -n "speed: "; cat /sys/class/net/${x}/speed 2>/dev/null; echo;\n echo -n "tx_queue_len: "; cat /sys/class/net/${x}/tx_queue_len 2>/dev/null; echo;\n echo -n "type: "; cat /sys/class/net/${x}/type 2>/dev/null; echo;\n echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${x}; echo;\n echo -n "wirelessspeed: "; iw dev ${x} link 2>&1 | grep bitrate; echo;`;let b=[];try{b=Yr(I).toString().split("\n");const e=xn(x);m=In(x,e,pn),h=En(e),g=Ln(e),y=(c=g)?"Not defined"==c?"Disabled":"Enabled":"Unknown"}catch(e){Jr.noop()}u=Jr.getValue(b,"duplex"),u=u.startsWith("cat")?"":u,p=parseInt(Jr.getValue(b,"mtu"),10);let E=parseInt(Jr.getValue(b,"speed"),10);f=isNaN(E)?null:E;let L=Jr.getValue(b,"wirelessspeed").split("tx bitrate: ");null===f&&2===L.length&&(E=parseFloat(L[1]),f=isNaN(E)?null:E),d=parseInt(Jr.getValue(b,"carrier_changes"),10);const _=Jr.getValue(b,"operstate");v="up"===_?Jr.getValue(b,"wireless").trim()?"wireless":"wired":"unknown",("lo"===x||x.startsWith("bond"))&&(v="virtual");let P=!(!i[e]||!i[e][0])&&i[e][0].internal;(e.toLowerCase().indexOf("loopback")>-1||S.toLowerCase().indexOf("loopback")>-1)&&(P=!0);const T=!P&&_n(e,S,l);s.push({iface:x,ifaceName:S,default:w===t,ip4:r,ip4subnet:n,ip6:a,ip6subnet:o,mac:l,internal:P,virtual:T,operstate:_,type:v,duplex:u,mtu:p,speed:f,dhcp:m,dnsSuffix:h,ieee8021xAuth:g,ieee8021xState:y,carrierChanges:d})}}fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}else s=fn,e&&e(s),n(s);var c;if(tn)if(JSON.stringify(i)!==JSON.stringify(un)||t){un=JSON.parse(JSON.stringify(i));const t=mn();gn().then((function(a){a.forEach((e=>{let t=!1;Object.keys(i).forEach((r=>{t||i[r].forEach((r=>{Object.keys(r).indexOf("mac")>=0&&(t=r.mac===e.mac)}))})),t||(i[e.name]=[{mac:e.mac}])})),l=function(){try{return Yr("netsh lan show profiles",Jr.execOptsWin).split("\r\nProfile on interface")}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")?"Disabled":[]}}(),o=function(){let e={},t={primaryDNS:"",exitCode:0,ifaces:[]};try{return Yr("ipconfig /all",Jr.execOptsWin).split("\r\n\r\n").forEach(((r,n)=>{if(1==n){const e=r.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),n=e[0].substring(e[0].lastIndexOf(":")+1);t.primaryDNS=n.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(n>1)if(n%2==0){const t=r.substring(r.lastIndexOf(" ")+1).replace(":","");e.name=t}else{const n=r.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),i=n[0].substring(n[0].lastIndexOf(":")+1);e.dnsSuffix=i.trim(),t.ifaces.push(e),e={}}})),t}catch(e){return{primaryDNS:"",exitCode:0,ifaces:[]}}}();for(let e in i){let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e),c=Jr.mathMin(n.length,2e3);for(let e=0;e<=c;e++)void 0!==n[e]&&(r+=n[e]);let u=e,p="",f="",d="",m="",h="",g="",y="",v=null,S=0,w="down",x=!1,C="",O="",I="",b="";if({}.hasOwnProperty.call(i,e)){let n=e;i[e].forEach((function(t){"IPv4"!==t.family&&4!==t.family||(p=t.address,f=t.netmask),"IPv6"!==t.family&&6!==t.family||d&&!d.match(/^fe80::/i)||(d=t.address,m=t.netmask),h=t.mac;const r=parseInt(process.versions.node.split("."),10);h.indexOf("00:00:0")>-1&&(Zr||en)&&!t.internal&&r>=8&&r<=11&&(0===Object.keys(dn).length&&(dn=hn()),h=dn[e]||"")})),C=yn(o.ifaces,r);let c=!1;a.forEach((e=>{e.mac!==h||c||(u=e.iface||u,n=e.name,x=e.dhcp,w=e.operstate,v=e.speed,b=e.type,c=!0)})),(e.toLowerCase().indexOf("wlan")>=0||n.toLowerCase().indexOf("wlan")>=0||n.toLowerCase().indexOf("802.11n")>=0||n.toLowerCase().indexOf("wireless")>=0||n.toLowerCase().indexOf("wi-fi")>=0||n.toLowerCase().indexOf("wifi")>=0)&&(b="wireless");const E=vn(b,r,l);O=E.protocol,I=E.state;let L=!(!i[e]||!i[e][0])&&i[e][0].internal;(e.toLowerCase().indexOf("loopback")>-1||n.toLowerCase().indexOf("loopback")>-1)&&(L=!0);const _=!L&&_n(e,n,h);s.push({iface:u,ifaceName:n,default:u===t,ip4:p,ip4subnet:f,ip6:d,ip6subnet:m,mac:h,internal:L,virtual:_,operstate:w,type:b,duplex:g,mtu:y,speed:v,dhcp:x,dnsSuffix:C,ieee8021xAuth:O,ieee8021xState:I,carrierChanges:S})}}fn=s,r.toLowerCase().indexOf("default")>=0&&(s=s.filter((e=>e.default)),s=s.length>0?s[0]:[]),e&&e(s),n(s)}))}else s=fn,e&&e(s),n(s)}))}))}function Tn(e,t,r,n,i,s,a,o){let l={iface:e,operstate:n,rx_bytes:t,rx_dropped:i,rx_errors:s,tx_bytes:r,tx_dropped:a,tx_errors:o,rx_sec:null,tx_sec:null,ms:0};return ln[e]&&ln[e].ms?(l.ms=Date.now()-ln[e].ms,l.rx_sec=t-ln[e].rx_bytes>=0?(t-ln[e].rx_bytes)/(l.ms/1e3):0,l.tx_sec=r-ln[e].tx_bytes>=0?(r-ln[e].tx_bytes)/(l.ms/1e3):0,ln[e].rx_bytes=t,ln[e].tx_bytes=r,ln[e].rx_sec=l.rx_sec,ln[e].tx_sec=l.tx_sec,ln[e].ms=Date.now(),ln[e].last_ms=l.ms,ln[e].operstate=n):(ln[e]||(ln[e]={}),ln[e].rx_bytes=t,ln[e].tx_bytes=r,ln[e].rx_sec=null,ln[e].tx_sec=null,ln[e].ms=Date.now(),ln[e].last_ms=0,ln[e].operstate=n),l}function Vn(e){return new Promise((t=>{process.nextTick((()=>{let r="";const n=Jr.isPrototypePolluted()?"---":Jr.sanitizeShellString(e),i=Jr.mathMin(n.length,2e3);for(let e=0;e<=i;e++)void 0!==n[e]&&(r+=n[e]);let s,a,o,l={iface:r,operstate:"unknown",rx_bytes:0,rx_dropped:0,rx_errors:0,tx_bytes:0,tx_dropped:0,tx_errors:0,rx_sec:null,tx_sec:null,ms:0},c="unknown",u=0,p=0,f=0,d=0,m=0,h=0;if(!ln[r]||ln[r]&&!ln[r].ms||ln[r]&&ln[r].ms&&Date.now()-ln[r].ms>=500){if(Zr&&(qr.existsSync("/sys/class/net/"+r)?(s="cat /sys/class/net/"+r+"/operstate; cat /sys/class/net/"+r+"/statistics/rx_bytes; cat /sys/class/net/"+r+"/statistics/tx_bytes; cat /sys/class/net/"+r+"/statistics/rx_dropped; cat /sys/class/net/"+r+"/statistics/rx_errors; cat /sys/class/net/"+r+"/statistics/tx_dropped; cat /sys/class/net/"+r+"/statistics/tx_errors; ",Kr(s,(function(e,n){e||(a=n.toString().split("\n"),c=a[0].trim(),u=parseInt(a[1],10),p=parseInt(a[2],10),f=parseInt(a[3],10),d=parseInt(a[4],10),m=parseInt(a[5],10),h=parseInt(a[6],10),l=Tn(r,u,p,c,f,d,m,h)),t(l)}))):t(l)),(rn||nn||sn)&&(s="netstat -ibndI "+r,Kr(s,(function(e,n){if(!e){a=n.toString().split("\n");for(let e=1;e<a.length;e++){const t=a[e].replace(/ +/g," ").split(" ");t&&t[0]&&t[7]&&t[10]&&(u+=parseInt(t[7]),"-"!==t[6].trim()&&(f+=parseInt(t[6])),"-"!==t[5].trim()&&(d+=parseInt(t[5])),p+=parseInt(t[10]),"-"!==t[12].trim()&&(m+=parseInt(t[12])),"-"!==t[9].trim()&&(h+=parseInt(t[9])),c="up")}l=Tn(r,u,p,c,f,d,m,h)}t(l)}))),en&&(s="ifconfig "+r+' | grep "status"',Kr(s,(function(e,n){l.operstate=(n.toString().split(":")[1]||"").trim(),l.operstate=(l.operstate||"").toLowerCase(),l.operstate="active"===l.operstate?"up":"inactive"===l.operstate?"down":"unknown",s="netstat -bdI "+r,Kr(s,(function(e,n){if(!e&&(a=n.toString().split("\n"),a.length>1&&""!==a[1].trim())){o=a[1].replace(/ +/g," ").split(" ");const e=o.length>11?1:0;u=parseInt(o[e+5]),f=parseInt(o[e+10]),d=parseInt(o[e+4]),p=parseInt(o[e+8]),m=parseInt(o[e+10]),h=parseInt(o[e+7]),l=Tn(r,u,p,l.operstate,f,d,m,h)}t(l)}))}))),tn){let e=[],n=r;Jr.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then(((i,s)=>{if(!s){const t=i.toString().split(/\n\s*\n/);e=function(e){let t=[];for(let r in e)if({}.hasOwnProperty.call(e,r)&&""!==e[r].trim()){let n=e[r].trim().split("\r\n");t.push({name:Jr.getValue(n,"Name",":").replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase(),rx_bytes:parseInt(Jr.getValue(n,"BytesReceivedPersec",":"),10),rx_errors:parseInt(Jr.getValue(n,"PacketsReceivedErrors",":"),10),rx_dropped:parseInt(Jr.getValue(n,"PacketsReceivedDiscarded",":"),10),tx_bytes:parseInt(Jr.getValue(n,"BytesSentPersec",":"),10),tx_errors:parseInt(Jr.getValue(n,"PacketsOutboundErrors",":"),10),tx_dropped:parseInt(Jr.getValue(n,"PacketsOutboundDiscarded",":"),10)})}return t}(t)}Pn(!1).then((i=>{u=0,p=0,e.forEach((e=>{i.forEach((t=>{t.iface.toLowerCase()!==r.toLowerCase()&&t.mac.toLowerCase()!==r.toLowerCase()&&t.ip4.toLowerCase()!==r.toLowerCase()&&t.ip6.toLowerCase()!==r.toLowerCase()&&t.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()!==r.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase()||t.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()!==e.name||(n=t.iface,u=e.rx_bytes,f=e.rx_dropped,d=e.rx_errors,p=e.tx_bytes,m=e.tx_dropped,h=e.tx_errors,c=t.operstate)}))})),u&&p&&(l=Tn(n,parseInt(u),parseInt(p),c,f,d,m,h)),t(l)}))}))}}else l.rx_bytes=ln[r].rx_bytes,l.tx_bytes=ln[r].tx_bytes,l.rx_sec=ln[r].rx_sec,l.tx_sec=ln[r].tx_sec,l.ms=ln[r].last_ms,l.operstate=ln[r].operstate,t(l)}))}))}function An(e,t){let r="";e.forEach((e=>{const n=e.split(" ");(parseInt(n[0],10)||-1)===t&&(n.shift(),r=n.join(" ").split(":")[0])})),r=r.split(" -")[0];const n=r.split("/");return n[n.length-1]}Xr.getDefaultNetworkInterface=mn,Xr.networkInterfaceDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let r=mn();e&&e(r),t(r)}))}))},Xr.networkInterfaces=Pn,Xr.networkStats=function e(t,r){let n=[];return new Promise((i=>{process.nextTick((()=>{if(Jr.isFunction(t)&&!r)r=t,n=[mn()];else{if("string"!=typeof t&&void 0!==t)return r&&r([]),i([]);(t=t||mn()).__proto__.toLowerCase=Jr.stringToLower,t.__proto__.replace=Jr.stringReplace,t.__proto__.trim=Jr.stringTrim,t=t.trim().toLowerCase().replace(/,+/g,"|"),n=t.split("|")}const s=[],a=[];if(n.length&&"*"===n[0].trim())n=[],Pn(!1).then((t=>{for(let e of t)n.push(e.iface);e(n.join(",")).then((e=>{r&&r(e),i(e)}))}));else{for(let e of n)a.push(Vn(e.trim()));a.length?Promise.all(a).then((e=>{r&&r(e),i(e)})):(r&&r(s),i(s))}}))}))},Xr.networkConnections=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Zr||rn||nn||sn){let n='export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';(rn||nn||sn)&&(n='export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'),Kr(n,{maxBuffer:2048e4},(function(i,s){let a=s.toString().split("\n");!i&&(a.length>1||""!=a[0])?(a.forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=7){let t=e[3],n="",i=e[3].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":"));let s=e[4],a="",o=e[4].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":"));let l=e[5],c=e[6].split("/");l&&r.push({protocol:e[0],localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:l,pid:c[0]&&"-"!==c[0]?parseInt(c[0],10):null,process:c[1]?c[1].split(" ")[0].split(":")[0]:""})}})),e&&e(r),t(r)):(n='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',Kr(n,{maxBuffer:2048e4},(function(n,i){if(!n){i.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=6){let t=e[4],n="",i=e[4].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":"));let s=e[5],a="",o=e[5].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":"));let l=e[1];"ESTAB"===l&&(l="ESTABLISHED"),"TIME-WAIT"===l&&(l="TIME_WAIT");let c=null,u="";if(e.length>=7&&e[6].indexOf("users:")>-1){let t=e[6].replace('users:(("',"").replace(/"/g,"").split(",");t.length>2&&(u=t[0].split(" ")[0].split(":")[0],c=parseInt(t[1],10))}l&&r.push({protocol:e[0],localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:l,pid:c,process:u})}}))}e&&e(r),t(r)})))}))}if(en){const n="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN";Kr('netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"',{maxBuffer:2048e4},(function(i,s){i||Kr("ps -axo pid,command",{maxBuffer:2048e4},(function(i,a){let o=a.toString().split("\n");o=o.map((e=>e.trim().replace(/ +/g," "))),s.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=8){let t=e[3],i="",s=e[3].split(".");s.length>1&&(i=s[s.length-1],s.pop(),t=s.join("."));let a=e[4],l="",c=e[4].split(".");c.length>1&&(l=c[c.length-1],c.pop(),a=c.join("."));const u=n.indexOf(e[5])>=0;let p=u?e[5]:"UNKNOWN",f=parseInt(e[8+(u?0:-1)],10);p&&r.push({protocol:e[0],localAddress:t,localPort:i,peerAddress:a,peerPort:l,state:p,pid:f,process:An(o,f)})}})),e&&e(r),t(r)}))}))}if(tn){let n="netstat -nao";try{Kr(n,Jr.execOptsWin,(function(n,i){if(!n){i.toString().split("\r\n").forEach((function(e){if((e=e.trim().replace(/ +/g," ").split(" ")).length>=4){let t=e[1],n="",i=e[1].split(":");i.length>1&&(n=i[i.length-1],i.pop(),t=i.join(":")),t=t.replace(/\[/g,"").replace(/\]/g,"");let s=e[2],a="",o=e[2].split(":");o.length>1&&(a=o[o.length-1],o.pop(),s=o.join(":")),s=s.replace(/\[/g,"").replace(/\]/g,"");let l=Jr.toInt(e[4]),c=e[3];"HERGESTELLT"===c&&(c="ESTABLISHED"),c.startsWith("ABH")&&(c="LISTEN"),"SCHLIESSEN_WARTEN"===c&&(c="CLOSE_WAIT"),"WARTEND"===c&&(c="TIME_WAIT"),"SYN_GESENDET"===c&&(c="SYN_SENT"),"LISTENING"===c&&(c="LISTEN"),"SYN_RECEIVED"===c&&(c="SYN_RECV"),"FIN_WAIT_1"===c&&(c="FIN_WAIT1"),"FIN_WAIT_2"===c&&(c="FIN_WAIT2"),"udp"!==e[0].toLowerCase()&&c?r.push({protocol:e[0].toLowerCase(),localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:c,pid:l,process:""}):"udp"===e[0].toLowerCase()&&r.push({protocol:e[0].toLowerCase(),localAddress:t,localPort:n,peerAddress:s,peerPort:a,state:"",pid:parseInt(e[3],10),process:""})}})),e&&e(r),t(r)}}))}catch(n){e&&e(r),t(r)}}}))}))},Xr.networkGatewayDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let r="";if(Zr||rn||nn||sn){let n="ip route get 1";try{Kr(n,{maxBuffer:2048e4},(function(n,i){if(n)e&&e(r),t(r);else{let n=i.toString().split("\n");let s=(n&&n[0]?n[0]:"").split(" via ");s&&s[1]&&(s=s[1].split(" "),r=s[0]),e&&e(r),t(r)}}))}catch(n){e&&e(r),t(r)}}if(en){let n="route -n get default";try{Kr(n,{maxBuffer:2048e4},(function(i,s){if(!i){const e=s.toString().split("\n").map((e=>e.trim()));r=Jr.getValue(e,"gateway")}r?(e&&e(r),t(r)):(n="netstat -rn | awk '/default/ {print $2}'",Kr(n,{maxBuffer:2048e4},(function(n,i){const s=i.toString().split("\n").map((e=>e.trim()));r=s.find((e=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))),e&&e(r),t(r)})))}))}catch(n){e&&e(r),t(r)}}if(tn)try{Kr("netstat -r",Jr.execOptsWin,(function(n,i){i.toString().split(zr.EOL).forEach((e=>{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const t=e.split(" ");t.length>=5&&t[t.length-3].indexOf(".")>-1&&(r=t[t.length-3])}})),r?(e&&e(r),t(r)):Jr.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then((n=>{let i=n.toString().split("\r\n");i.length>1&&!r&&(r=Jr.getValue(i,"NextHop"),e&&e(r),t(r))}))}))}catch(n){e&&e(r),t(r)}}))}))};var Nn={};const Dn=m.default,kn=y.default.exec,Mn=y.default.execSync,Rn=L;let Bn=process.platform;const Fn="linux"===Bn||"android"===Bn,Gn="darwin"===Bn,Wn="win32"===Bn;function Un(e){return parseFloat(e)/2-100}function $n(e){const t=2*(parseFloat(e)+100);return t<=100?t:100}const jn={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484,32:5160,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,50:5250,52:5260,54:5270,56:5280,58:5290,60:5300,62:5310,64:5320,68:5340,96:5480,100:5500,102:5510,104:5520,106:5530,108:5540,110:5550,112:5560,114:5570,116:5580,118:5590,120:5600,122:5610,124:5620,126:5630,128:5640,132:5660,134:5670,136:5680,138:5690,140:5700,142:5710,144:5720,149:5745,151:5755,153:5765,155:5775,157:5785,159:5795,161:5805,165:5825,169:5845,173:5865,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};function Hn(e){return{}.hasOwnProperty.call(jn,e)?jn[e]:null}function Xn(e){let t=0;for(let r in jn)({}).hasOwnProperty.call(jn,r)&&jn[r]===e&&(t=Rn.toInt(r));return t}function zn(){const e=[];try{const t=Mn("iw dev 2>/dev/null").toString().split("\n").map((e=>e.trim())).join("\n").split("\nInterface ");return t.shift(),t.forEach((t=>{const r=t.split("\n"),n=r[0],i=Rn.toInt(Rn.getValue(r,"ifindex"," ")),s=Rn.getValue(r,"addr"," "),a=Rn.toInt(Rn.getValue(r,"channel"," "));e.push({id:i,iface:n,mac:s,channel:a})})),e}catch(t){try{const t=Mn("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null").toString().split("\n\n");let r=1;return t.forEach((t=>{const n=t.split("\n"),i=Rn.getValue(n,"GENERAL.DEVICE"),s=Rn.getValue(n,"GENERAL.TYPE"),a=r++,o=Rn.getValue(n,"GENERAL.HWADDR");"wifi"===s.toLowerCase()&&e.push({id:a,iface:i,mac:o,channel:""})})),e}catch(e){return[]}}}function Kn(e){const t=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${e} 2>/dev/null`;try{const r=Mn(t).toString().split("\n"),n=Rn.getValue(r,"GENERAL.CONNECTION");return{iface:e,type:Rn.getValue(r,"GENERAL.TYPE"),vendor:Rn.getValue(r,"GENERAL.VENDOR"),product:Rn.getValue(r,"GENERAL.PRODUCT"),mac:Rn.getValue(r,"GENERAL.HWADDR").toLowerCase(),ssid:"--"!==n?n:null}}catch(e){return{}}}function Yn(){const e=[];try{const t=Mn("nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null",{maxBuffer:2048e4}).toString().split("ACTIVE:");return t.shift(),t.forEach((t=>{const r=(t="ACTIVE:"+t).split(Dn.EOL),n=Rn.getValue(r,"CHAN"),i=Rn.getValue(r,"FREQ").toLowerCase().replace("mhz","").trim(),s=Rn.getValue(r,"SECURITY").replace("(","").replace(")",""),a=Rn.getValue(r,"WPA-FLAGS").replace("(","").replace(")",""),o=Rn.getValue(r,"RSN-FLAGS").replace("(","").replace(")","");e.push({ssid:Rn.getValue(r,"SSID"),bssid:Rn.getValue(r,"BSSID").toLowerCase(),mode:Rn.getValue(r,"MODE"),channel:n?parseInt(n,10):null,frequency:i?parseInt(i,10):null,signalLevel:Un(Rn.getValue(r,"SIGNAL")),quality:parseFloat(Rn.getValue(r,"SIGNAL")),security:s&&"none"!==s?s.split(" "):[],wpaFlags:a&&"none"!==a?a.split(" "):[],rsnFlags:o&&"none"!==o?o.split(" "):[]})})),e}catch(e){return[]}}function qn(e){const t=[];try{let r=Mn(`export LC_ALL=C; iwlist ${e} scan 2>&1; unset LC_ALL`).toString().split(" Cell ");return r[0].indexOf("resource busy")>=0?-1:(r.length>1&&(r.shift(),r.forEach((e=>{const r=e.split("\n"),n=Rn.getValue(r,"channel",":",!0),i=r&&r.length&&r[0].indexOf("Address:")>=0?r[0].split("Address:")[1].trim().toLowerCase():"",s=Rn.getValue(r,"mode",":",!0),a=Rn.getValue(r,"frequency",":",!0),o=Rn.getValue(r,"Quality","=",!0).toLowerCase().split("signal level="),l=o.length>1?Rn.toInt(o[1]):0,c=l?$n(l):0,u=Rn.getValue(r,"essid",":",!0),p=e.indexOf(" WPA ")>=0,f=e.indexOf("WPA2 ")>=0,d=[];p&&d.push("WPA"),f&&d.push("WPA2");const m=[];let h="";r.forEach((function(e){const t=e.trim().toLowerCase();if(t.indexOf("group cipher")>=0){h&&m.push(h);const e=t.split(":");e.length>1&&(h=e[1].trim().toUpperCase())}if(t.indexOf("pairwise cipher")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("tkip")?h=h?"TKIP/"+h:"TKIP":e[1].indexOf("ccmp")?h=h?"CCMP/"+h:"CCMP":e[1].indexOf("proprietary")&&(h=h?"PROP/"+h:"PROP"))}if(t.indexOf("authentication suites")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("802.1x")?h=h?"802.1x/"+h:"802.1x":e[1].indexOf("psk")&&(h=h?"PSK/"+h:"PSK"))}})),h&&m.push(h),t.push({ssid:u,bssid:i,mode:s,channel:n?Rn.toInt(n):null,frequency:a?Rn.toInt(a.replace(".","")):null,signalLevel:l,quality:c,security:d,wpaFlags:m,rsnFlags:[]})}))),t)}catch(e){return-1}}Nn.wifiNetworks=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Fn)if(r=Yn(),0===r.length)try{const n=Mn("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL").toString().split("\n\n");let i="";if(n.forEach((e=>{-1===e.indexOf("no wireless")&&""!==e.trim()&&(i=e.split(" ")[0])})),i){let n="";const s=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(i,!0),a=Rn.mathMin(s.length,2e3);for(let e=0;e<=a;e++)void 0!==s[e]&&(n+=s[e]);const o=qn(n);-1===o?setTimeout((function(n){const i=qn(n);-1!=i&&(r=i),e&&e(r),t(r)}),4e3):(r=o,e&&e(r),t(r))}else e&&e(r),t(r)}catch(n){e&&e(r),t(r)}else e&&e(r),t(r);else if(Gn){kn("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x",{maxBuffer:4096e4},(function(n,i){const s=i.toString();r=function(e){const t=[];return e&&e.forEach((function(e){const r=e.RSSI;let n=[],i=[],s=e.SSID_STR||"";if(e.WPA_IE&&(n.push("WPA"),e.WPA_IE.IE_KEY_WPA_UCIPHERS&&e.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach((function(e){0===e&&-1===i.indexOf("unknown/TKIP")&&i.push("unknown/TKIP"),2===e&&-1===i.indexOf("PSK/TKIP")&&i.push("PSK/TKIP"),4===e&&-1===i.indexOf("PSK/AES")&&i.push("PSK/AES")}))),e.RSN_IE&&(n.push("WPA2"),e.RSN_IE.IE_KEY_RSN_UCIPHERS&&e.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach((function(e){0===e&&-1===i.indexOf("unknown/TKIP")&&i.push("unknown/TKIP"),2===e&&-1===i.indexOf("TKIP/TKIP")&&i.push("TKIP/TKIP"),4===e&&-1===i.indexOf("PSK/AES")&&i.push("PSK/AES")}))),e.SSID&&""===s)try{s=Buffer.from(e.SSID,"base64").toString("utf8")}catch(e){Rn.noop()}t.push({ssid:s,bssid:e.BSSID||"",mode:"",channel:e.CHANNEL,frequency:Hn(e.CHANNEL),signalLevel:r?parseInt(r,10):null,quality:$n(r),security:n,wpaFlags:i,rsnFlags:[]})})),t}(Rn.plistParser(s)),e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show networks mode=Bssid";Rn.powerShell(n).then((n=>{const i=n.toString("utf8").split(Dn.EOL+Dn.EOL+"SSID ");i.shift(),i.forEach((e=>{const t=e.split(Dn.EOL);if(t&&t.length>=8&&t[0].indexOf(":")>=0){const n=e.split(" BSSID");n.shift(),n.forEach((e=>{const n=e.split(Dn.EOL),i=n[0].split(":");i.shift();const s=i.join(":").trim().toLowerCase(),a=n[3].split(":").pop().trim(),o=n[1].split(":").pop().trim();r.push({ssid:t[0].split(":").pop().trim(),bssid:s,mode:"",channel:a?parseInt(a,10):null,frequency:Hn(a),signalLevel:Un(o),quality:o?parseInt(o,10):null,security:[t[2].split(":").pop().trim()],wpaFlags:[t[3].split(":").pop().trim()],rsnFlags:[]})}))}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))},Nn.wifiConnections=function(e){return new Promise((t=>{process.nextTick((()=>{const r=[];if(Fn){const n=zn(),i=Yn();n.forEach((e=>{let t="";const n=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(e.iface,!0),s=Rn.mathMin(n.length,2e3);for(let e=0;e<=s;e++)void 0!==n[e]&&(t+=n[e]);const a=Kn(t),o=function(e){if(!e)return{};const t=`wpa_cli -i ${e} status 2>&1`;try{const e=Mn(t).toString().split("\n"),r=Rn.toInt(Rn.getValue(e,"freq","="));return{ssid:Rn.getValue(e,"ssid","="),uuid:Rn.getValue(e,"uuid","="),security:Rn.getValue(e,"key_mgmt","="),freq:r,channel:Xn(r),bssid:Rn.getValue(e,"bssid","=").toLowerCase()}}catch(e){return{}}}(t),l=a.ssid||o.ssid,c=i.filter((e=>e.ssid===l));let u="";const p=Rn.isPrototypePolluted()?"---":Rn.sanitizeShellString(l,!0),f=Rn.mathMin(p.length,2e3);for(let e=0;e<=f;e++)void 0!==p[e]&&(u+=p[e]);const d=function(e){const t=`nmcli -t --show-secrets connection show ${e} 2>/dev/null`;try{const r=Mn(t).toString().split("\n"),n=Rn.getValue(r,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:"--"!==e?e:null,uuid:Rn.getValue(r,"connection.uuid"),type:Rn.getValue(r,"connection.type"),autoconnect:"yes"===Rn.getValue(r,"connection.autoconnect"),security:Rn.getValue(r,"802-11-wireless-security.key-mgmt"),bssid:"--"!==n?n:null}}catch(e){return{}}}(u),m=c&&c.length&&c[0].channel?c[0].channel:o.channel?o.channel:null,h=c&&c.length&&c[0].bssid?c[0].bssid:o.bssid?o.bssid:null;l&&h&&r.push({id:e.id,iface:e.iface,model:a.product,ssid:l,bssid:c&&c.length&&c[0].bssid?c[0].bssid:o.bssid?o.bssid:null,channel:m,frequency:m?Hn(m):null,type:d.type?d.type:"802.11",security:d.security?d.security:o.security?o.security:null,signalLevel:c&&c.length&&c[0].signalLevel?c[0].signalLevel:null,txRate:null})})),e&&e(r),t(r)}else if(Gn){let n="system_profiler SPNetworkDataType";kn(n,(function(i,s){const a=s.toString().split("\n\n Wi-Fi:\n\n");if(a.length>1){const i=a[1].split("\n\n")[0].split("\n"),s=Rn.getValue(i,"BSD Device Name",":",!0),o=Rn.getValue(i,"hardware",":",!0);n="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I",kn(n,(function(n,a){const l=a.toString().split("\n");if(i.length>10){const e=Rn.getValue(l,"ssid",":",!0),t=Rn.getValue(l,"bssid",":",!0),n=Rn.getValue(l,"link auth",":",!0),i=Rn.getValue(l,"lastTxRate",":",!0),a=Rn.getValue(l,"channel",":",!0).split(",")[0],c="802.11",u=Rn.toInt(Rn.getValue(l,"agrCtlRSSI",":",!0))-Rn.toInt(Rn.getValue(l,"agrCtlNoise",":",!0));(e||t)&&r.push({id:"Wi-Fi",iface:s,model:o,ssid:e,bssid:t,channel:Rn.toInt(a),frequency:a?Hn(a):null,type:c,security:n,signalLevel:u,txRate:i})}e&&e(r),t(r)}))}else e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show interfaces";Rn.powerShell(n).then((function(n){const i=n.toString().split("\r\n");for(let e=0;e<i.length;e++)i[e]=i[e].trim();const s=i.join("\r\n").split(":\r\n\r\n");s.shift(),s.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",n=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",s=Rn.getValue(t,"SSID",":",!0),a=Rn.getValue(t,"BSSID",":",!0),o=Rn.getValue(t,"Signal",":",!0),l=Rn.getValue(t,"Radio type",":",!0)||Rn.getValue(t,"Type de radio",":",!0)||Rn.getValue(t,"Funktyp",":",!0)||null,c=Rn.getValue(t,"authentication",":",!0)||Rn.getValue(t,"Authentification",":",!0)||Rn.getValue(t,"Authentifizierung",":",!0)||null,u=Rn.getValue(t,"Channel",":",!0)||Rn.getValue(t,"Canal",":",!0)||Rn.getValue(t,"Kanal",":",!0)||null,p=Rn.getValue(t,"Transmit rate (mbps)",":",!0)||Rn.getValue(t,"Transmission (mbit/s)",":",!0)||Rn.getValue(t,"Empfangsrate (MBit/s)",":",!0)||null;n&&i&&s&&a&&r.push({id:i,iface:e,model:n,ssid:s,bssid:a,channel:Rn.toInt(u),frequency:u?Hn(u):null,type:l,security:c,signalLevel:o,txRate:Rn.toInt(p)||null})}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))},Nn.wifiInterfaces=function(e){return new Promise((t=>{process.nextTick((()=>{const r=[];if(Fn){zn().forEach((e=>{const t=Kn(e.iface);r.push({id:e.id,iface:e.iface,model:t.product?t.product:null,vendor:t.vendor?t.vendor:null,mac:e.mac})})),e&&e(r),t(r)}else if(Gn){kn("system_profiler SPNetworkDataType",(function(n,i){const s=i.toString().split("\n\n Wi-Fi:\n\n");if(s.length>1){const e=s[1].split("\n\n")[0].split("\n"),t=Rn.getValue(e,"BSD Device Name",":",!0),n=Rn.getValue(e,"MAC Address",":",!0),i=Rn.getValue(e,"hardware",":",!0);r.push({id:"Wi-Fi",iface:t,model:i,vendor:"",mac:n})}e&&e(r),t(r)}))}else if(Wn){let n="netsh wlan show interfaces";Rn.powerShell(n).then((function(n){const i=n.toString().split("\r\n");for(let e=0;e<i.length;e++)i[e]=i[e].trim();const s=i.join("\r\n").split(":\r\n\r\n");s.shift(),s.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",n=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",s=t[3].indexOf(":")>=0?t[3].split(":"):[];s.shift();const a=s.join(":").trim(),o=function(e){let t="";return(e=e.toLowerCase()).indexOf("intel")>=0?t="Intel":e.indexOf("realtek")>=0?t="Realtek":e.indexOf("qualcom")>=0?t="Qualcom":e.indexOf("broadcom")>=0?t="Broadcom":e.indexOf("cavium")>=0?t="Cavium":e.indexOf("cisco")>=0?t="Cisco":e.indexOf("marvel")>=0?t="Marvel":e.indexOf("zyxel")>=0?t="Zyxel":e.indexOf("melanox")>=0?t="Melanox":e.indexOf("d-link")>=0?t="D-Link":e.indexOf("tp-link")>=0?t="TP-Link":e.indexOf("asus")>=0?t="Asus":e.indexOf("linksys")>=0&&(t="Linksys"),t}(n);e&&n&&i&&a&&r.push({id:i,iface:e,model:n,vendor:o,mac:a})}})),e&&e(r),t(r)}))}else e&&e(r),t(r)}))}))};var Jn={};const Qn=m.default,Zn=h.default,ei=g.default,ti=y.default.exec,ri=y.default.execSync,ni=L;let ii=process.platform;const si="linux"===ii||"android"===ii,ai="darwin"===ii,oi="win32"===ii,li="freebsd"===ii,ci="openbsd"===ii,ui="netbsd"===ii,pi="sunos"===ii,fi={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},di={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},mi={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},hi={0:"unknown",1:"other",2:"ready",3:"running",4:"blocked",5:"suspended blocked",6:"suspended ready",7:"terminated",8:"stopped",9:"growing"};function gi(e){let t=e.replace(/ +/g," ").split(" ");return(t.length>=2?parseInt(t[1]):0)+(t.length>=3?parseInt(t[2]):0)+(t.length>=4?parseInt(t[3]):0)+(t.length>=5?parseInt(t[4]):0)+(t.length>=6?parseInt(t[5]):0)+(t.length>=7?parseInt(t[6]):0)+(t.length>=8?parseInt(t[7]):0)+(t.length>=9?parseInt(t[8]):0)+(t.length>=10?parseInt(t[9]):0)+(t.length>=11?parseInt(t[10]):0)}function yi(e,t,r){let n=e.replace(/ +/g," ").split(")");if(n.length>=2){let e=n[1].split(" ");if(e.length>=16){let i=parseInt(n[0].split(" ")[0]),s=parseInt(e[12]),a=parseInt(e[13]),o=parseInt(e[14]),l=parseInt(e[15]),c=0,u=0;return r.all>0&&r.list[i]?(c=(s+o-r.list[i].utime-r.list[i].cutime)/(t-r.all)*100,u=(a+l-r.list[i].stime-r.list[i].cstime)/(t-r.all)*100):(c=(s+o)/t*100,u=(a+l)/t*100),{pid:i,utime:s,stime:a,cutime:o,cstime:l,cpuu:c,cpus:u}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}function vi(e,t,r){let n=0,i=0;return r.all>0&&r.list[e.pid]?(n=(e.utime-r.list[e.pid].utime)/(t-r.all)*100,i=(e.stime-r.list[e.pid].stime)/(t-r.all)*100):(n=e.utime/t*100,i=e.stime/t*100),{pid:e.pid,utime:e.utime,stime:e.stime,cpuu:n>0?n:0,cpus:i>0?i:0}}Jn.services=function(e,t){return ni.isFunction(e)&&!t&&(t=e,e=""),new Promise((r=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t([]),r([]);if(e){let n="";n.__proto__.toLowerCase=ni.stringToLower,n.__proto__.replace=ni.stringReplace,n.__proto__.trim=ni.stringTrim;const i=ni.sanitizeShellString(e),s=ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)void 0!==i[e]&&(n+=i[e]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===n&&(n="*"),ni.isPrototypePolluted()&&"*"!==n&&(n="------");let a=n.split("|"),o=[],l=[];if(si||li||ci||ui||ai){if((si||li||ci||ui)&&"*"===n)try{const e=ri("systemctl --all --type=service --no-legend 2> /dev/null").toString().split("\n");a=[];for(const t of e){const e=t.split(".service")[0];e&&-1===t.indexOf(" not-found ")&&a.push(e.trim())}n=a.join("|")}catch(e){try{n="";const e=ri("service --status-all 2> /dev/null").toString().split("\n");for(const t of e){const e=t.split("]");2===e.length&&(n+=(""!==n?"|":"")+e[1].trim())}a=n.split("|")}catch(e){try{const e=ri("ls /etc/init.d/ -m 2> /dev/null").toString().split("\n").join("");if(n="",e){const t=e.split(",");for(const e of t){const t=e.trim();t&&(n+=(""!==n?"|":"")+t)}a=n.split("|")}}catch(e){n="",a=[]}}}ai&&"*"===n&&(t&&t(o),r(o));let e=ai?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];""!==n&&a.length>0?ni.execSafe("ps",e).then((n=>{if(n){let e=n.replace(/ +/g," ").replace(/,+/g,".").split("\n");if(a.forEach((function(t){let r;r=ai?e.filter((function(e){return-1!==e.toLowerCase().indexOf(t)})):e.filter((function(e){return-1!==e.toLowerCase().indexOf(" "+t.toLowerCase()+":")||-1!==e.toLowerCase().indexOf("/"+t.toLowerCase())}));const n=[];for(const e of r){const t=e.trim().split(" ")[2];t&&n.push(parseInt(t,10))}o.push({name:t,running:r.length>0,startmode:"",pids:n,cpu:parseFloat(r.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[0])}),0).toFixed(2)),mem:parseFloat(r.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[1])}),0).toFixed(2))})})),si){let e='cat /proc/stat | grep "cpu "';for(let t in o)for(let r in o[t].pids)e+=";cat /proc/"+o[t].pids[r]+"/stat";ti(e,{maxBuffer:2048e4},(function(e,n){let i=n.toString().split("\n"),s=gi(i.shift()),a={},l={};i.forEach((e=>{if(l=yi(e,s,di),l.pid){let e=-1;for(let t in o)for(let r in o[t].pids)parseInt(o[t].pids[r])===parseInt(l.pid)&&(e=t);e>=0&&(o[e].cpu+=l.cpuu+l.cpus),a[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),di.all=s,di.list=Object.assign({},a),di.ms=Date.now()-di.ms,di.result=Object.assign({},o),t&&t(o),r(o)}))}else t&&t(o),r(o)}else e=["-o","comm"],ni.execSafe("ps",e).then((e=>{if(e){let n=e.replace(/ +/g," ").replace(/,+/g,".").split("\n");a.forEach((function(e){let t=n.filter((function(t){return-1!==t.indexOf(e)}));o.push({name:e,running:t.length>0,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o)}else a.forEach((function(e){o.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o)}))})):(t&&t(o),r(o))}if(oi)try{let e="Get-CimInstance Win32_Service";"*"!==a[0]&&(e+=' -Filter "',a.forEach((t=>{e+=`Name='${t}' or `})),e=`${e.slice(0,-4)}"`),e+=" | select Name,Caption,Started,StartMode,ProcessId | fl",ni.powerShell(e).then(((e,i)=>{if(i)a.forEach((function(e){o.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(o),r(o);else{if(e.split(/\n\s*\n/).forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=ni.getValue(t,"Name",":",!0).toLowerCase(),i=ni.getValue(t,"Caption",":",!0).toLowerCase(),s=ni.getValue(t,"Started",":",!0),c=ni.getValue(t,"StartMode",":",!0),u=ni.getValue(t,"ProcessId",":",!0);("*"===n||a.indexOf(r)>=0||a.indexOf(i)>=0)&&(o.push({name:r,running:"true"===s.toLowerCase(),startmode:c,pids:[u],cpu:0,mem:0}),l.push(r),l.push(i))}})),"*"!==n){a.filter((function(e){return-1===l.indexOf(e)})).forEach((function(e){o.push({name:e,running:!1,startmode:"",pids:[],cpu:0,mem:0})}))}t&&t(o),r(o)}}))}catch(e){t&&t(o),r(o)}}else t&&t([]),r([])}))}))},Jn.processes=function(e){let t=[];function r(e){let t=(e=e||"").split(" ")[0];if(":"===t.substr(-1)&&(t=t.substr(0,t.length-1)),"["!==t.substr(0,1)){let e=t.split("/");t=isNaN(parseInt(e[e.length-1]))?e[e.length-1]:e[0]}return t}function n(e){let n=0,i=0;function s(r){n=i,i=t[r]?e.substring(t[r].to+n,1e4).indexOf(" "):1e4}s(0);const a=parseInt(e.substring(t[0].from+n,t[0].to+i));s(1);const o=parseInt(e.substring(t[1].from+n,t[1].to+i));s(2);const l=parseFloat(e.substring(t[2].from+n,t[2].to+i).replace(/,/g,"."));s(3);const c=parseFloat(e.substring(t[3].from+n,t[3].to+i).replace(/,/g,"."));s(4);const u=parseInt(e.substring(t[4].from+n,t[4].to+i));s(5);const p=parseInt(e.substring(t[5].from+n,t[5].to+i));s(6);const f=parseInt(e.substring(t[6].from+n,t[6].to+i));s(7);const d=parseInt(e.substring(t[7].from+n,t[7].to+i))||0;s(8);const m=pi?function(e){let t=e,r=e.replace(/ +/g," ").split(" ");return 5===r.length&&(t=r[4]+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(r[1].toUpperCase())/3+1)).slice(-2)+"-"+("0"+r[2]).slice(-2)+" "+r[3]),t}(e.substring(t[8].from+n,t[8].to+i).trim()):function(e){let t=new Date;t=new Date(t.getTime()-6e4*t.getTimezoneOffset());const r=e.split("-"),n=r.length-1,i=n>0?parseInt(r[n-1]):0,s=r[n].split(":"),a=1e3*(60*(60*(24*i+(3===s.length?parseInt(s[0]||0):0))+parseInt(s[3===s.length?1:0]||0))+parseInt(s[3===s.length?2:1]||0));let o=new Date(t.getTime()),l=o.toISOString().substring(0,10)+" "+o.toISOString().substring(11,19);try{o=new Date(t.getTime()-a),l=o.toISOString().substring(0,10)+" "+o.toISOString().substring(11,19)}catch(e){ni.noop()}return l}(e.substring(t[8].from+n,t[8].to+i).trim());s(9);let h=e.substring(t[9].from+n,t[9].to+i).trim();h="R"===h[0]?"running":"S"===h[0]?"sleeping":"T"===h[0]?"stopped":"W"===h[0]?"paging":"X"===h[0]?"dead":"Z"===h[0]?"zombie":"D"===h[0]||"U"===h[0]?"blocked":"unknown",s(10);let g=e.substring(t[10].from+n,t[10].to+i).trim();"?"!==g&&"??"!==g||(g=""),s(11);const y=e.substring(t[11].from+n,t[11].to+i).trim();s(12);let v="",S="",w="",x=e.substring(t[12].from+n,t[12].to+i).trim();if("]"===x.substr(x.length-1)&&(x=x.slice(0,-1)),"["===x.substr(0,1))S=x.substring(1);else{const e=x.indexOf("("),t=x.indexOf(")"),r=x.indexOf("/"),n=x.indexOf(":");if(e<t&&e<r&&r<t)S=x.split(" ")[0],S=S.replace(/:/g,"");else if(n>0&&(-1===r||r>3))S=x.split(" ")[0],S=S.replace(/:/g,"");else{let e=x.indexOf(" -"),t=x.indexOf(" /");e=e>=0?e:1e4,t=t>=0?t:1e4;const r=Math.min(e,t);let n=x.substr(0,r);const i=x.substr(r),s=n.lastIndexOf("/");if(s>=0&&(v=n.substr(0,s),n=n.substr(s+1)),1e4===r&&n.indexOf(" ")>-1){const e=n.split(" ");Zn.existsSync(ei.join(v,e[0]))?(S=e.shift(),w=(e.join(" ")+" "+i).trim()):(S=n.trim(),w=i.trim())}else S=n.trim(),w=i.trim()}}return{pid:a,parentPid:o,name:si?r(S):S,cpu:l,cpuu:0,cpus:0,mem:c,priority:u,memVsz:p,memRss:f,nice:d,started:m,state:h,tty:g,user:y,command:S,params:w,path:v}}function i(e){function t(e){const t=("0"+(e.getMonth()+1).toString()).slice(-2);return e.getFullYear().toString()+"-"+t+"-"+("0"+e.getDate().toString()).slice(-2)+" "+("0"+e.getHours().toString()).slice(-2)+":"+("0"+e.getMinutes().toString()).slice(-2)+":"+("0"+e.getSeconds().toString()).slice(-2)}let n=[];return e.forEach((function(e){if(""!==e.trim()){const i=(e=e.trim().replace(/ +/g," ").replace(/,+/g,".")).split(" "),s=i.slice(9).join(" "),a=parseFloat((1*parseInt(i[3])*1024/Qn.totalmem()).toFixed(1)),o=function(e){let r="";if(e.indexOf("d")>=0){const n=e.split("d");r=t(new Date(Date.now()-60*(24*n[0]+1*n[1])*60*1e3))}else if(e.indexOf("h")>=0){const n=e.split("h");r=t(new Date(Date.now()-60*(60*n[0]+1*n[1])*1e3))}else if(e.indexOf(":")>=0){const n=e.split(":");r=t(new Date(Date.now()-(n.length>1?1e3*(60*n[0]+n[1]):1e3*n[0])))}return r}(i[5]);n.push({pid:parseInt(i[0]),parentPid:parseInt(i[1]),name:r(s),cpu:0,cpuu:0,cpus:0,mem:a,priority:0,memVsz:parseInt(i[2]),memRss:parseInt(i[3]),nice:parseInt(i[4]),started:o,state:"R"===i[6]?"running":"S"===i[6]?"sleeping":"T"===i[6]?"stopped":"W"===i[6]?"paging":"X"===i[6]?"dead":"Z"===i[6]?"zombie":"D"===i[6]||"U"===i[6]?"blocked":"unknown",tty:i[7],user:i[8],command:s})}})),n}return new Promise((r=>{process.nextTick((()=>{let s={all:0,running:0,blocked:0,sleeping:0,unknown:0,list:[]},a="";if(fi.ms&&Date.now()-fi.ms>=500||0===fi.ms)if(si||li||ci||ui||ai||pi)si&&(a="export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"),(li||ci||ui)&&(a="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"),ai&&(a="ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"),pi&&(a="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),ti(a,{maxBuffer:2048e4},(function(o,l){!o&&l.toString().trim()?(s.list=function(e){let r=[];if(e.length>1){let i=e[0];t=ni.parseHead(i,8),e.shift(),e.forEach((function(e){""!==e.trim()&&r.push(n(e))}))}return r}(l.toString().split("\n")).slice(),s.all=s.list.length,s.running=s.list.filter((function(e){return"running"===e.state})).length,s.blocked=s.list.filter((function(e){return"blocked"===e.state})).length,s.sleeping=s.list.filter((function(e){return"sleeping"===e.state})).length,si?(a='cat /proc/stat | grep "cpu "',s.list.forEach((e=>{a+=";cat /proc/"+e.pid+"/stat"})),ti(a,{maxBuffer:2048e4},(function(t,n){let i=n.toString().split("\n"),a=gi(i.shift()),o={},l={};i.forEach((e=>{if(l=yi(e,a,fi),l.pid){let e=s.list.map((function(e){return e.pid})).indexOf(l.pid);e>=0&&(s.list[e].cpu=l.cpuu+l.cpus,s.list[e].cpuu=l.cpuu,s.list[e].cpus=l.cpus),o[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),fi.all=a,fi.list=Object.assign({},o),fi.ms=Date.now()-fi.ms,fi.result=Object.assign({},s),e&&e(s),r(s)}))):(e&&e(s),r(s))):(a="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",pi&&(a="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),ti(a,{maxBuffer:2048e4},(function(t,n){if(t)e&&e(s),r(s);else{let t=n.toString().split("\n");t.shift(),s.list=i(t).slice(),s.all=s.list.length,s.running=s.list.filter((function(e){return"running"===e.state})).length,s.blocked=s.list.filter((function(e){return"blocked"===e.state})).length,s.sleeping=s.list.filter((function(e){return"sleeping"===e.state})).length,e&&e(s),r(s)}})))}));else if(oi)try{ni.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then(((t,n)=>{if(!n){let e=t.split(/\n\s*\n/),r=[],n=[],i={},a=0,o=0;e.forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),i=parseInt(ni.getValue(t,"ProcessId",":",!0),10),l=parseInt(ni.getValue(t,"ParentProcessId",":",!0),10),c=ni.getValue(t,"ExecutionState",":"),u=ni.getValue(t,"Caption",":",!0),p=ni.getValue(t,"CommandLine",":",!0),f=!1;t.forEach((e=>{f&&e.toLowerCase().startsWith(" ")?p+=" "+e.trim():f=!1,e.toLowerCase().startsWith("commandline")&&(f=!0)}));let d=ni.getValue(t,"ExecutablePath",":",!0),m=parseInt(ni.getValue(t,"UserModeTime",":",!0),10),h=parseInt(ni.getValue(t,"KernelModeTime",":",!0),10),g=parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10);a+=m,o+=h,s.all++,c||s.unknown++,"3"===c&&s.running++,"4"!==c&&"5"!==c||s.blocked++,n.push({pid:i,utime:m,stime:h,cpu:0,cpuu:0,cpus:0}),r.push({pid:i,parentPid:l,name:u,cpu:0,cpuu:0,cpus:0,mem:g/Qn.totalmem()*100,priority:parseInt(ni.getValue(t,"Priority",":",!0),10),memVsz:parseInt(ni.getValue(t,"PageFileUsage",":",!0),10),memRss:Math.floor(parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10)/1024),nice:0,started:ni.getValue(t,"CreationDate",":",!0),state:c?hi[c]:hi[0],tty:"",user:"",command:p||u,path:d,params:""})}})),s.sleeping=s.all-s.running-s.blocked-s.unknown,s.list=r,n.forEach((e=>{let t=vi(e,a+o,fi),r=s.list.map((function(e){return e.pid})).indexOf(t.pid);r>=0&&(s.list[r].cpu=t.cpuu+t.cpus,s.list[r].cpuu=t.cpuu,s.list[r].cpus=t.cpus),i[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}})),fi.all=a+o,fi.all_utime=a,fi.all_stime=o,fi.list=Object.assign({},i),fi.ms=Date.now()-fi.ms,fi.result=Object.assign({},s)}e&&e(s),r(s)}))}catch(t){e&&e(s),r(s)}else e&&e(s),r(s);else e&&e(fi.result),r(fi.result)}))}))},Jn.processLoad=function(e,t){return ni.isFunction(e)&&!t&&(t=e,e=""),new Promise((r=>{process.nextTick((()=>{if("string"!=typeof(e=e||""))return t&&t([]),r([]);let n="";n.__proto__.toLowerCase=ni.stringToLower,n.__proto__.replace=ni.stringReplace,n.__proto__.trim=ni.stringTrim;const i=ni.sanitizeShellString(e),s=ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)void 0!==i[e]&&(n+=i[e]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===n&&(n="*"),ni.isPrototypePolluted()&&"*"!==n&&(n="------");let a=n.split("|"),o=[];if((ni.isPrototypePolluted()?"":ni.sanitizeShellString(e))&&a.length&&"------"!==a[0]){if(oi)try{ni.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then(((e,i)=>{if(!i){let i=e.split(/\n\s*\n/),s=[],l={},c=0,u=0;if(i.forEach((e=>{if(""!==e.trim()){let t=e.trim().split("\r\n"),r=parseInt(ni.getValue(t,"ProcessId",":",!0),10),i=ni.getValue(t,"Caption",":",!0),l=parseInt(ni.getValue(t,"UserModeTime",":",!0),10),p=parseInt(ni.getValue(t,"KernelModeTime",":",!0),10),f=parseInt(ni.getValue(t,"WorkingSetSize",":",!0),10);c+=l,u+=p,s.push({pid:r,name:i,utime:l,stime:p,cpu:0,cpuu:0,cpus:0,mem:f});let d="",m=!1;if(a.forEach((function(e){i.toLowerCase().indexOf(e.toLowerCase())>=0&&!m&&(m=!0,d=e)})),"*"===n||m){let e=!1;o.forEach((function(t){t.proc.toLowerCase()===d.toLowerCase()&&(t.pids.push(r),t.mem+=f/Qn.totalmem()*100,e=!0)})),e||o.push({proc:d,pid:r,pids:[r],cpu:0,mem:f/Qn.totalmem()*100})}}})),"*"!==n){let e=a.filter((function(e){return 0===s.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length}));e.forEach((function(e){o.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}s.forEach((e=>{let t=vi(e,c+u,mi),r=-1;for(let e=0;e<o.length;e++)(o[e].pid===t.pid||o[e].pids.indexOf(t.pid)>=0)&&(r=e);r>=0&&(o[r].cpu+=t.cpuu+t.cpus),l[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}})),mi.all=c+u,mi.all_utime=c,mi.all_stime=u,mi.list=Object.assign({},l),mi.ms=Date.now()-mi.ms,mi.result=JSON.parse(JSON.stringify(o)),t&&t(o),r(o)}}))}catch(e){t&&t(o),r(o)}if(ai||si||li||ci||ui){const e=["-axo","pid,ppid,pcpu,pmem,comm"];ni.execSafe("ps",e).then((e=>{if(e){let i=[];if(e.toString().split("\n").filter((function(e){if("*"===n)return!0;if(-1!==e.toLowerCase().indexOf("grep"))return!1;let t=!1;return a.forEach((function(r){t=t||e.toLowerCase().indexOf(r.toLowerCase())>=0})),t})).forEach((function(e){let t=e.trim().replace(/ +/g," ").split(" ");t.length>4&&i.push({name:t[4].substring(t[4].lastIndexOf("/")+1),pid:parseInt(t[0])||0,ppid:parseInt(t[1])||0,cpu:parseFloat(t[2].replace(",",".")),mem:parseFloat(t[3].replace(",","."))})})),i.forEach((function(e){let t=-1,r=!1,i="";for(let r=0;r<o.length;r++)e.name.toLowerCase().indexOf(o[r].proc.toLowerCase())>=0&&(t=r);a.forEach((function(t){e.name.toLowerCase().indexOf(t.toLowerCase())>=0&&!r&&(r=!0,i=t)})),("*"===n||r)&&(t<0?o.push({proc:i,pid:e.pid,pids:[e.pid],cpu:e.cpu,mem:e.mem}):(e.ppid<10&&(o[t].pid=e.pid),o[t].pids.push(e.pid),o[t].cpu+=e.cpu,o[t].mem+=e.mem))})),"*"!==n){let e=a.filter((function(e){return 0===i.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length}));e.forEach((function(e){o.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}if(si){o.forEach((function(e){e.cpu=0}));let e='cat /proc/stat | grep "cpu "';for(let t in o)for(let r in o[t].pids)e+=";cat /proc/"+o[t].pids[r]+"/stat";ti(e,{maxBuffer:2048e4},(function(e,n){let i=n.toString().split("\n"),s=gi(i.shift()),a={},l={};i.forEach((e=>{if(l=yi(e,s,mi),l.pid){let e=-1;for(let t in o)o[t].pids.indexOf(l.pid)>=0&&(e=t);e>=0&&(o[e].cpu+=l.cpuu+l.cpus),a[l.pid]={cpuu:l.cpuu,cpus:l.cpus,utime:l.utime,stime:l.stime,cutime:l.cutime,cstime:l.cstime}}})),o.forEach((function(e){e.cpu=Math.round(100*e.cpu)/100})),mi.all=s,mi.list=Object.assign({},a),mi.ms=Date.now()-mi.ms,mi.result=Object.assign({},o),t&&t(o),r(o)}))}else t&&t(o),r(o)}else t&&t(o),r(o)}))}}}))}))};var Si={};const wi=y.default.exec,xi=L;let Ci=process.platform;const Oi="linux"===Ci||"android"===Ci,Ii="darwin"===Ci,bi="win32"===Ci,Ei="freebsd"===Ci,Li="openbsd"===Ci,_i="netbsd"===Ci,Pi="sunos"===Ci;function Ti(e,t){let r=[],n=[],i={},s=!0,a=[],o=[],l={},c=!0;return e.forEach((function(e){if("---"===e)c=!1;else{let t=e.replace(/ +/g," ").split(" ");c?n.push({user:t[0],tty:t[1],date:t[2],time:t[3],ip:t&&t.length>4?t[4].replace(/\(/g,"").replace(/\)/g,""):""}):s?(a=t,a.forEach((function(t){o.push(e.indexOf(t))})),s=!1):(i.user=e.substring(o[0],o[1]-1).trim(),i.tty=e.substring(o[1],o[2]-1).trim(),i.ip=e.substring(o[2],o[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=e.substring(o[7],1e3).trim(),l=n.filter((function(e){return e.user.substring(0,8).trim()===i.user&&e.tty===i.tty})),1===l.length&&r.push({user:l[0].user,tty:l[0].tty,date:l[0].date,time:l[0].time,ip:l[0].ip,command:i.command}))}})),0===r.length&&2===t?n:r}function Vi(e){let t=[],r=[],n={},i={},s=!0;return e.forEach((function(e){if("---"===e)s=!1;else{let a=e.replace(/ +/g," ").split(" ");s?r.push({user:a[0],tty:a[1],date:(new Date).getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2),time:a[4]}):(n.user=a[0],n.tty=a[1],n.ip="-"!==a[2]?a[2]:"",n.command=a.slice(5,1e3).join(" "),i=r.filter((function(e){return e.user===n.user&&(e.tty.substring(3,1e3)===n.tty||e.tty===n.tty)})),1===i.length&&t.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:n.ip,command:n.command}))}})),t}Si.users=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Oi&&wi('who --ips; echo "---"; w | tail -n +2',(function(n,i){if(n)e&&e(r),t(r);else{let n=i.toString().split("\n");r=Ti(n,1),0===r.length?wi('who; echo "---"; w | tail -n +2',(function(i,s){i||(n=s.toString().split("\n"),r=Ti(n,2)),e&&e(r),t(r)})):(e&&e(r),t(r))}})),(Ei||Li||_i)&&wi('who; echo "---"; w -ih',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),Pi&&wi('who; echo "---"; w -h',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),Ii&&wi('who; echo "---"; w -ih',(function(n,i){if(!n){let e=i.toString().split("\n");r=Vi(e)}e&&e(r),t(r)})),bi)try{let n='Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo \'#-#-#-#\';';n+="Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';",n+="$process = (Get-CimInstance Win32_Process -Filter \"name = 'explorer.exe'\"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';",n+="query user",xi.powerShell(n).then((n=>{if(n){let e=function(e){const t={};return e.forEach((e=>{const r=e.split("\r\n"),n=xi.getValue(r,"LogonId"),i=xi.getValue(r,"starttime");n&&(t[n]=i)})),t}(((n=n.split("#-#-#-#"))[0]||"").split(/\n\s*\n/)),t=function(e){const t={};return e.forEach((e=>{const r=e.split("\r\n");let n=xi.getValue(r,"antecedent",":",!0).split("=");const i=n.length>2?n[1].split(",")[0].replace(/"/g,"").trim():"",s=n.length>2?n[2].replace(/"/g,"").replace(/\)/g,"").trim():"";n=xi.getValue(r,"dependent",":",!0).split("=");const a=n.length>1?n[1].replace(/"/g,"").replace(/\)/g,"").trim():"";a&&(t[a]={domain:s,user:i})})),t}((n[1]||"").split(/\n\s*\n/)),i=function(e){e=e.filter((e=>e));let t=[];const r=e[0],n=[];if(r){const i=" "===r[0]?1:0;n.push(i-1);let s=0;for(let e=i+1;e<r.length;e++)" "!==r[e]||" "!==r[e-1]&&"."!==r[e-1]?s&&(n.push(s),s=0):s=e;for(let r=1;r<e.length;r++)if(e[r].trim()){const i=e[r].substring(n[0]+1,n[1]).trim()||"",s=e[r].substring(n[1]+1,n[2]-2).trim()||"";t.push({user:i,tty:s})}}return t}((n[3]||"").split("\r\n")),s=function(e,t){const r=[];return e.forEach((e=>{const n=e.split("\r\n"),i=xi.getValue(n,"domain",":",!0),s=xi.getValue(n,"user",":",!0),a=xi.getValue(n,"sessionid",":",!0);if(s){const e=t.filter((e=>function(e,t){e=e.toLowerCase(),t=t.toLowerCase();let r=0,n=e.length;t.length>n&&(n=t.length);for(let i=0;i<n;i++){(e[i]||"")===(t[i]||"")&&r++}return n>10?r/n>.9:n>0&&r/n>.8}(e.user,s)));r.push({domain:i,user:s,tty:e&&e[0]&&e[0].tty?e[0].tty:a})}})),r}((n[2]||"").split(/\n\s*\n/),i);for(let r in t)({}).hasOwnProperty.call(t,r)&&(t[r].dateTime={}.hasOwnProperty.call(e,r)?e[r]:"");s.forEach((e=>{let n="";for(let r in t)({}).hasOwnProperty.call(t,r)&&t[r].user===e.user&&(!n||n<t[r].dateTime)&&(n=t[r].dateTime);r.push({user:e.user,tty:e.tty,date:`${n.substring(0,10)}`,time:`${n.substring(11,19)}`,ip:"",command:""})}))}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))};var Ai={};const Ni=L;let Di=process.platform;const ki="linux"===Di||"android"===Di,Mi="darwin"===Di,Ri="win32"===Di,Bi="freebsd"===Di,Fi="openbsd"===Di,Gi="netbsd"===Di,Wi="sunos"===Di;Ai.inetChecksite=function(e,t){return new Promise((r=>{process.nextTick((()=>{let n={url:e,ok:!1,status:404,ms:null};if("string"!=typeof e)return t&&t(n),r(n);let i="";const s=Ni.sanitizeShellString(e,!0),a=Ni.mathMin(s.length,2e3);for(let e=0;e<=a;e++)if(void 0!==s[e]){s[e].__proto__.toLowerCase=Ni.stringToLower;const t=s[e].toLowerCase();t&&t[0]&&!t[1]&&1===t[0].length&&(i+=t[0])}n.url=i;try{if(i&&!Ni.isPrototypePolluted()){if(i.__proto__.startsWith=Ni.stringStartWith,i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return t&&t(n),r(n);let e=Date.now();if(ki||Bi||Fi||Gi||Mi||Wi){let s=["-I","--connect-timeout","5","-m","5"];s.push(i);let a="curl";Ni.execSafe(a,s).then((i=>{const s=i.split("\n");let a=s[0]&&s[0].indexOf(" ")>=0?parseInt(s[0].split(" ")[1],10):404;n.status=a||404,n.ok=200===a||301===a||302===a||304===a,n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)}))}if(Ri){const s=i.startsWith("https:")?require("https"):require("http");try{s.get(i,(i=>{const s=i.statusCode;n.status=s||404,n.ok=200===s||301===s||302===s||304===s,200!==s?(i.resume(),n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)):(i.on("data",(()=>{})),i.on("end",(()=>{n.ms=n.ok?Date.now()-e:null,t&&t(n),r(n)})))})).on("error",(()=>{t&&t(n),r(n)}))}catch(e){t&&t(n),r(n)}}}else t&&t(n),r(n)}catch(e){t&&t(n),r(n)}}))}))},Ai.inetLatency=function(e,t){return Ni.isFunction(e)&&!t&&(t=e,e=""),e=e||"8.8.8.8",new Promise((r=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t(null),r(null);let n="";const i=(Ni.isPrototypePolluted()?"8.8.8.8":Ni.sanitizeShellString(e,!0)).trim(),s=Ni.mathMin(i.length,2e3);for(let e=0;e<=s;e++)if(void 0!==i[e]){i[e].__proto__.toLowerCase=Ni.stringToLower;const t=i[e].toLowerCase();t&&t[0]&&!t[1]&&(n+=t[0])}if(n.__proto__.startsWith=Ni.stringStartWith,n.startsWith("file:")||n.startsWith("gopher:")||n.startsWith("telnet:")||n.startsWith("mailto:")||n.startsWith("news:")||n.startsWith("nntp:"))return t&&t(null),r(null);let a;if((ki||Bi||Fi||Gi||Mi)&&(ki&&(a=["-c","2","-w","3",n]),(Bi||Fi||Gi)&&(a=["-c","2","-t","3",n]),Mi&&(a=["-c2","-t3",n]),Ni.execSafe("ping",a).then((e=>{let n=null;if(e){const t=e.split("\n").filter((e=>e.indexOf("rtt")>=0||e.indexOf("round-trip")>=0||e.indexOf("avg")>=0)).join("\n"),r=t.split("=");if(r.length>1){const e=r[1].split("/");e.length>1&&(n=parseFloat(e[1]))}}t&&t(n),r(n)}))),Wi){const e=["-s","-a",n,"56","2"],i="avg";Ni.execSafe("ping",e,{timeout:3e3}).then((e=>{let n=null;if(e){const t=e.split("\n").filter((e=>e.indexOf(i)>=0)).join("\n"),r=t.split("=");if(r.length>1){const e=r[1].split("/");e.length>1&&(n=parseFloat(e[1].replace(",",".")))}}t&&t(n),r(n)}))}if(Ri){let e=null;try{const i=[n,"-n","1"];Ni.execSafe("ping",i,Ni.execOptsWin).then((n=>{if(n){let t=n.split("\r\n");t.shift(),t.forEach((function(t){if(3===(t.toLowerCase().match(/ms/g)||[]).length){let r=t.replace(/ +/g," ").split(" ");r.length>6&&(e=parseFloat(r[r.length-1]))}}))}t&&t(e),r(e)}))}catch(n){t&&t(e),r(e)}}}))}))};var Ui={};const $i=S.default,ji="Windows_NT"===m.default.type()?"//./pipe/docker_engine":"/var/run/docker.sock";const Hi=L,Xi=class{getInfo(e){try{let t,r=$i.createConnection({path:ji}),n="";r.on("connect",(()=>{r.write("GET http:/info HTTP/1.0\r\n\r\n")})),r.on("data",(e=>{n+=e.toString()})),r.on("error",(()=>{r=!1,e({})})),r.on("end",(()=>{let i=n.indexOf("\r\n\r\n");n=n.substring(i+4),r=!1;try{t=JSON.parse(n),e(t)}catch(t){e({})}}))}catch(t){e({})}}listImages(e,t){try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/images/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}}inspectImage(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/images/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}listContainers(e,t){try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}}getStats(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/stats?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}getInspect(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}getProcesses(e,t){if(e=e||"")try{let r,n=$i.createConnection({path:ji}),i="";n.on("connect",(()=>{n.write("GET http:/containers/"+e+"/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{i+=e.toString()})),n.on("error",(()=>{n=!1,t({})})),n.on("end",(()=>{let e=i.indexOf("\r\n\r\n");i=i.substring(e+4),n=!1;try{r=JSON.parse(i),t(r)}catch(e){t({})}}))}catch(e){t({})}else t({})}listVolumes(e){try{let t,r=$i.createConnection({path:ji}),n="";r.on("connect",(()=>{r.write("GET http:/volumes HTTP/1.0\r\n\r\n")})),r.on("data",(e=>{n+=e.toString()})),r.on("error",(()=>{r=!1,e({})})),r.on("end",(()=>{let i=n.indexOf("\r\n\r\n");n=n.substring(i+4),r=!1;try{t=JSON.parse(n),e(t)}catch(t){e({})}}))}catch(t){e({})}}};const zi="win32"===process.platform;let Ki,Yi={},qi=0;function Ji(e,t){function r(e,t){return e.filter((e=>e.Id&&e.Id===t)).length>0}Hi.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let n=[];return new Promise((i=>{process.nextTick((()=>{Ki||(Ki=new Xi);const s=[];Ki.listContainers(e,(e=>{let a={};try{if(a=e,a&&"[object Array]"===Object.prototype.toString.call(a)&&a.length>0){for(let e in Yi)({}).hasOwnProperty.call(Yi,e)&&(r(a,e)||delete Yi[e]);a.forEach((function(e){var t,r;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),s.push((t=e.Id.trim(),r=e,new Promise((e=>{process.nextTick((()=>{if("string"!=typeof(t=t||""))return e();const n=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(t,!0)).trim();n?(Ki||(Ki=new Xi),Ki.getInspect(n.trim(),(t=>{try{e({id:r.Id,name:r.Name,image:r.Image,imageID:r.ImageID,command:r.Command,created:r.Created,started:t.State&&t.State.StartedAt?Math.round(new Date(t.State.StartedAt).getTime()/1e3):0,finished:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(t.State.FinishedAt).getTime()/1e3):0,createdAt:t.Created?t.Created:"",startedAt:t.State&&t.State.StartedAt?t.State.StartedAt:"",finishedAt:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?t.State.FinishedAt:"",state:r.State,restartCount:t.RestartCount||0,platform:t.Platform||"",driver:t.Driver||"",ports:r.Ports,mounts:r.Mounts})}catch(t){e()}}))):e()}))}))))})),s.length?Promise.all(s).then((e=>{t&&t(e),i(e)})):(t&&t(n),i(n))}else t&&t(n),i(n)}catch(e){for(let e in Yi)({}).hasOwnProperty.call(Yi,e)&&(r(a,e)||delete Yi[e]);t&&t(n),i(n)}}))}))}))}function Qi(e,t){let r=[];return new Promise((n=>{process.nextTick((()=>{if(Hi.isFunction(e)&&!t)t=e,r=["*"];else{if("string"!=typeof(e=e||"*"))return t&&t([]),n([]);let i="";if(i.__proto__.toLowerCase=Hi.stringToLower,i.__proto__.replace=Hi.stringReplace,i.__proto__.trim=Hi.stringTrim,i=e,i=i.trim(),"*"!==i){i="";const t=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(e,!0)).trim(),r=Hi.mathMin(t.length,2e3);for(let e=0;e<=r;e++)if(void 0!==t[e]){t[e].__proto__.toLowerCase=Hi.stringToLower;const r=t[e].toLowerCase();r&&r[0]&&!r[1]&&(i+=r[0])}}i=i.trim().toLowerCase().replace(/,+/g,"|"),r=i.split("|")}const i=[],s=[];if(r.length&&"*"===r[0].trim())r=[],Ji().then((e=>{for(let t of e)r.push(t.id.substring(0,12));r.length?Qi(r.join(",")).then((e=>{t&&t(e),n(e)})):(t&&t(i),n(i))}));else{for(let e of r)s.push(Zi(e.trim()));s.length?Promise.all(s).then((e=>{t&&t(e),n(e)})):(t&&t(i),n(i))}}))}))}function Zi(e){let t={id:e=e||"",memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0},restartCount:0,cpuStats:{},precpuStats:{},memoryStats:{},networks:{}};return new Promise((r=>{process.nextTick((()=>{e?(Ki||(Ki=new Xi),Ki.getInspect(e,(n=>{try{Ki.getStats(e,(e=>{try{let r=e;r.message||(e.id&&(t.id=e.id),t.memUsage=r.memory_stats&&r.memory_stats.usage?r.memory_stats.usage:0,t.memLimit=r.memory_stats&&r.memory_stats.limit?r.memory_stats.limit:0,t.memPercent=r.memory_stats&&r.memory_stats.usage&&r.memory_stats.limit?r.memory_stats.usage/r.memory_stats.limit*100:0,t.cpuPercent=r.cpu_stats&&r.precpu_stats?function(e,t){if(zi){let r=Hi.nanoSeconds(),n=0;if(qi>0){let i=r-qi,s=e.cpu_usage.total_usage-t.cpu_usage.total_usage;i>0&&(n=100*s/i)}return qi=r,n}{let r=0,n=e.cpu_usage.total_usage-t.cpu_usage.total_usage,i=e.system_cpu_usage-t.system_cpu_usage;return i>0&&n>0&&(r=t.online_cpus?n/i*t.online_cpus*100:n/i*e.cpu_usage.percpu_usage.length*100),r}}(r.cpu_stats,r.precpu_stats):0,t.pids=r.pids_stats&&r.pids_stats.current?r.pids_stats.current:0,t.restartCount=n.RestartCount?n.RestartCount:0,r.networks&&(t.netIO=function(e){let t,r;for(let n in e){if(!{}.hasOwnProperty.call(e,n))continue;let i=e[n];t=+i.rx_bytes,r=+i.tx_bytes}return{rx:t,wx:r}}(r.networks)),r.blkio_stats&&(t.blockIO=function(e){let t={r:0,w:0};return e&&e.io_service_bytes_recursive&&"[object Array]"===Object.prototype.toString.call(e.io_service_bytes_recursive)&&e.io_service_bytes_recursive.length>0&&e.io_service_bytes_recursive.forEach((function(e){e.op&&"read"===e.op.toLowerCase()&&e.value&&(t.r+=e.value),e.op&&"write"===e.op.toLowerCase()&&e.value&&(t.w+=e.value)})),t}(r.blkio_stats)),t.cpuStats=r.cpu_stats?r.cpu_stats:{},t.precpuStats=r.precpu_stats?r.precpu_stats:{},t.memoryStats=r.memory_stats?r.memory_stats:{},t.networks=r.networks?r.networks:{})}catch(e){Hi.noop()}r(t)}))}catch(e){Hi.noop()}}))):r(t)}))}))}function es(e,t){let r=[];return new Promise((n=>{process.nextTick((()=>{if("string"!=typeof(e=e||""))return n(r);const i=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(e,!0)).trim();i?(Ki||(Ki=new Xi),Ki.getProcesses(i,(e=>{try{if(e&&e.Titles&&e.Processes){let t=e.Titles.map((function(e){return e.toUpperCase()})),n=t.indexOf("PID"),i=t.indexOf("PPID"),s=t.indexOf("PGID"),a=t.indexOf("VSZ"),o=t.indexOf("TIME"),l=t.indexOf("ELAPSED"),c=t.indexOf("NI"),u=t.indexOf("RUSER"),p=t.indexOf("USER"),f=t.indexOf("RGROUP"),d=t.indexOf("GROUP"),m=t.indexOf("STAT"),h=t.indexOf("RSS"),g=t.indexOf("COMMAND");e.Processes.forEach((e=>{r.push({pidHost:n>=0?e[n]:"",ppid:i>=0?e[i]:"",pgid:s>=0?e[s]:"",user:p>=0?e[p]:"",ruser:u>=0?e[u]:"",group:d>=0?e[d]:"",rgroup:f>=0?e[f]:"",stat:m>=0?e[m]:"",time:o>=0?e[o]:"",elapsed:l>=0?e[l]:"",nice:c>=0?e[c]:"",rss:h>=0?e[h]:"",vsz:a>=0?e[a]:"",command:g>=0?e[g]:""})}))}}catch(e){Hi.noop()}t&&t(r),n(r)}))):(t&&t(r),n(r))}))}))}Ui.dockerInfo=function(e){return new Promise((t=>{process.nextTick((()=>{Ki||(Ki=new Xi);const r={};Ki.getInfo((n=>{r.id=n.ID,r.containers=n.Containers,r.containersRunning=n.ContainersRunning,r.containersPaused=n.ContainersPaused,r.containersStopped=n.ContainersStopped,r.images=n.Images,r.driver=n.Driver,r.memoryLimit=n.MemoryLimit,r.swapLimit=n.SwapLimit,r.kernelMemory=n.KernelMemory,r.cpuCfsPeriod=n.CpuCfsPeriod,r.cpuCfsQuota=n.CpuCfsQuota,r.cpuShares=n.CPUShares,r.cpuSet=n.CPUSet,r.ipv4Forwarding=n.IPv4Forwarding,r.bridgeNfIptables=n.BridgeNfIptables,r.bridgeNfIp6tables=n.BridgeNfIp6tables,r.debug=n.Debug,r.nfd=n.NFd,r.oomKillDisable=n.OomKillDisable,r.ngoroutines=n.NGoroutines,r.systemTime=n.SystemTime,r.loggingDriver=n.LoggingDriver,r.cgroupDriver=n.CgroupDriver,r.nEventsListener=n.NEventsListener,r.kernelVersion=n.KernelVersion,r.operatingSystem=n.OperatingSystem,r.osType=n.OSType,r.architecture=n.Architecture,r.ncpu=n.NCPU,r.memTotal=n.MemTotal,r.dockerRootDir=n.DockerRootDir,r.httpProxy=n.HttpProxy,r.httpsProxy=n.HttpsProxy,r.noProxy=n.NoProxy,r.name=n.Name,r.labels=n.Labels,r.experimentalBuild=n.ExperimentalBuild,r.serverVersion=n.ServerVersion,r.clusterStore=n.ClusterStore,r.clusterAdvertise=n.ClusterAdvertise,r.defaultRuntime=n.DefaultRuntime,r.liveRestoreEnabled=n.LiveRestoreEnabled,r.isolation=n.Isolation,r.initBinary=n.InitBinary,r.productLicense=n.ProductLicense,e&&e(r),t(r)}))}))}))},Ui.dockerImages=function(e,t){Hi.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let r=[];return new Promise((n=>{process.nextTick((()=>{Ki||(Ki=new Xi);const i=[];Ki.listImages(e,(e=>{let s={};try{s=e,s&&"[object Array]"===Object.prototype.toString.call(s)&&s.length>0?(s.forEach((function(e){var t,r;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),i.push((t=e.Id.trim(),r=e,new Promise((e=>{process.nextTick((()=>{if("string"!=typeof(t=t||""))return e();const n=(Hi.isPrototypePolluted()?"":Hi.sanitizeShellString(t,!0)).trim();n?(Ki||(Ki=new Xi),Ki.inspectImage(n.trim(),(t=>{try{e({id:r.Id,container:t.Container,comment:t.Comment,os:t.Os,architecture:t.Architecture,parent:t.Parent,dockerVersion:t.DockerVersion,size:t.Size,sharedSize:r.SharedSize,virtualSize:t.VirtualSize,author:t.Author,created:t.Created?Math.round(new Date(t.Created).getTime()/1e3):0,containerConfig:t.ContainerConfig?t.ContainerConfig:{},graphDriver:t.GraphDriver?t.GraphDriver:{},repoDigests:t.RepoDigests?t.RepoDigests:{},repoTags:t.RepoTags?t.RepoTags:{},config:t.Config?t.Config:{},rootFS:t.RootFS?t.RootFS:{}})}catch(t){e()}}))):e()}))}))))})),i.length?Promise.all(i).then((e=>{t&&t(e),n(e)})):(t&&t(r),n(r))):(t&&t(r),n(r))}catch(e){t&&t(r),n(r)}}))}))}))},Ui.dockerContainers=Ji,Ui.dockerContainerStats=Qi,Ui.dockerContainerProcesses=es,Ui.dockerVolumes=function(e){let t=[];return new Promise((r=>{process.nextTick((()=>{Ki||(Ki=new Xi),Ki.listVolumes((n=>{let i={};try{i=n,i&&i.Volumes&&"[object Array]"===Object.prototype.toString.call(i.Volumes)&&i.Volumes.length>0?(i.Volumes.forEach((function(e){t.push({name:e.Name,driver:e.Driver,labels:e.Labels,mountpoint:e.Mountpoint,options:e.Options,scope:e.Scope,created:e.CreatedAt?Math.round(new Date(e.CreatedAt).getTime()/1e3):0})})),e&&e(t),r(t)):(e&&e(t),r(t))}catch(n){e&&e(t),r(t)}}))}))}))},Ui.dockerAll=function(e){return new Promise((t=>{process.nextTick((()=>{Ji(!0).then((r=>{if(r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0){let n=r.length;r.forEach((function(i){Qi(i.id).then((s=>{i.memUsage=s[0].memUsage,i.memLimit=s[0].memLimit,i.memPercent=s[0].memPercent,i.cpuPercent=s[0].cpuPercent,i.pids=s[0].pids,i.netIO=s[0].netIO,i.blockIO=s[0].blockIO,i.cpuStats=s[0].cpuStats,i.precpuStats=s[0].precpuStats,i.memoryStats=s[0].memoryStats,i.networks=s[0].networks,es(i.id).then((s=>{i.processes=s,n-=1,0===n&&(e&&e(r),t(r))}))}))}))}else e&&e(r),t(r)}))}))}))};var ts={};const rs=m.default,ns=y.default.exec,is=L;ts.vboxInfo=function(e){let t=[];return new Promise((r=>{process.nextTick((()=>{try{ns(is.getVboxmanage()+" list vms --long",(function(n,i){let s=(rs.EOL+i.toString()).split(rs.EOL+"Name:");s.shift(),s.forEach((e=>{const r=("Name:"+e).split(rs.EOL),n=is.getValue(r,"State"),i=n.startsWith("running"),s=i?n.replace("running (since ","").replace(")","").trim():"";let a=0;try{if(i){const e=new Date(s),t=e.getTimezoneOffset();a=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){is.noop()}const o=i?"":n.replace("powered off (since","").replace(")","").trim();let l=0;try{if(!i){const e=new Date(o),t=e.getTimezoneOffset();l=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){is.noop()}t.push({id:is.getValue(r,"UUID"),name:is.getValue(r,"Name"),running:i,started:s,runningSince:a,stopped:o,stoppedSince:l,guestOS:is.getValue(r,"Guest OS"),hardwareUUID:is.getValue(r,"Hardware UUID"),memory:parseInt(is.getValue(r,"Memory size"," "),10),vram:parseInt(is.getValue(r,"VRAM size"),10),cpus:parseInt(is.getValue(r,"Number of CPUs"),10),cpuExepCap:is.getValue(r,"CPU exec cap"),cpuProfile:is.getValue(r,"CPUProfile"),chipset:is.getValue(r,"Chipset"),firmware:is.getValue(r,"Firmware"),pageFusion:"enabled"===is.getValue(r,"Page Fusion"),configFile:is.getValue(r,"Config file"),snapshotFolder:is.getValue(r,"Snapshot folder"),logFolder:is.getValue(r,"Log folder"),hpet:"enabled"===is.getValue(r,"HPET"),pae:"enabled"===is.getValue(r,"PAE"),longMode:"enabled"===is.getValue(r,"Long Mode"),tripleFaultReset:"enabled"===is.getValue(r,"Triple Fault Reset"),apic:"enabled"===is.getValue(r,"APIC"),x2Apic:"enabled"===is.getValue(r,"X2APIC"),acpi:"enabled"===is.getValue(r,"ACPI"),ioApic:"enabled"===is.getValue(r,"IOAPIC"),biosApicMode:is.getValue(r,"BIOS APIC mode"),bootMenuMode:is.getValue(r,"Boot menu mode"),bootDevice1:is.getValue(r,"Boot Device 1"),bootDevice2:is.getValue(r,"Boot Device 2"),bootDevice3:is.getValue(r,"Boot Device 3"),bootDevice4:is.getValue(r,"Boot Device 4"),timeOffset:is.getValue(r,"Time offset"),rtc:is.getValue(r,"RTC")})})),e&&e(t),r(t)}))}catch(n){e&&e(t),r(t)}}))}))};var ss={};const as=y.default.exec,os=L;let ls=process.platform;const cs="linux"===ls||"android"===ls,us="darwin"===ls,ps="win32"===ls,fs="freebsd"===ls,ds="openbsd"===ls,ms="netbsd"===ls,hs="sunos"===ls,gs={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function ys(e){const t={},r=os.getValue(e,"PrinterId"," ");return t.id=r?parseInt(r,10):null,t.name=os.getValue(e,"Info"," "),t.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",t.uri=os.getValue(e,"DeviceURI"," "),t.uuid=os.getValue(e,"UUID"," "),t.status=os.getValue(e,"State"," "),t.local=os.getValue(e,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=os.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),t}function vs(e,t){const r={};return r.id=t,r.name=os.getValue(e,"Description",":",!0),r.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",r.uri=null,r.uuid=null,r.status=e.length>0&&e[0]?e[0].indexOf(" idle")>0?"idle":e[0].indexOf(" printing")>0?"printing":"unknown":null,r.local=os.getValue(e,"Location",":",!0).toLowerCase().startsWith("local"),r.default=null,r.shared=os.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),r}function Ss(e,t){const r={},n=e.uri.split("/");return r.id=t,r.name=e._name,r.model=n.length?n[n.length-1]:"",r.uri=e.uri,r.uuid=null,r.status=e.status,r.local="local"===e.printserver,r.default="yes"===e.default,r.shared="yes"===e.shared,r}function ws(e,t){const r={},n=parseInt(os.getValue(e,"PrinterStatus",":"),10);return r.id=t,r.name=os.getValue(e,"name",":"),r.model=os.getValue(e,"DriverName",":"),r.uri=null,r.uuid=null,r.status=gs[n]?gs[n]:null,r.local="TRUE"===os.getValue(e,"Local",":").toUpperCase(),r.default="TRUE"===os.getValue(e,"Default",":").toUpperCase(),r.shared="TRUE"===os.getValue(e,"Shared",":").toUpperCase(),r}ss.printer=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(cs||fs||ds||ms){let n="cat /etc/cups/printers.conf 2>/dev/null";as(n,(function(i,s){if(!i){const e=s.toString().split("<Printer "),t=function(e){const t={};if(e&&e.length&&e[0].indexOf(" CUPS v")>0){const r=e[0].split(" CUPS v");t.cupsVersion=r[1]}return t}(e[0]);for(let n=1;n<e.length;n++){const i=ys(e[n].split("\n"));i.name&&(i.engine="CUPS",i.engineVersion=t.cupsVersion,r.push(i))}}0===r.length&&cs?(n="export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL",as(n,(function(e,t){const n=("\n"+t.toString()).split("\nprinter ");for(let e=1;e<n.length;e++){const t=vs(n[e].split("\n"),e);r.push(t)}})),e&&e(r),t(r)):(e&&e(r),t(r))}))}if(us){as("system_profiler SPPrintersDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPPrintersDataType&&e.SPPrintersDataType.length)for(let t=0;t<e.SPPrintersDataType.length;t++){const n=Ss(e.SPPrintersDataType[t],t);r.push(n)}}catch(e){os.noop()}e&&e(r),t(r)}))}ps&&os.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then(((n,i)=>{if(!i){const e=n.toString().split(/\n\s*\n/);for(let t=0;t<e.length;t++){const n=ws(e[t].split("\n"),t);(n.name||n.model)&&r.push(n)}}e&&e(r),t(r)})),hs&&t(null)}))}))};var xs={};const Cs=y.default.exec,Os=L;let Is=process.platform;const bs="linux"===Is||"android"===Is,Es="darwin"===Is,Ls="win32"===Is,_s="freebsd"===Is,Ps="openbsd"===Is,Ts="netbsd"===Is,Vs="sunos"===Is;function As(e){const t={},r=e.split("\n");if(r&&r.length&&r[0].indexOf("Device")>=0){const e=r[0].split(" ");t.bus=parseInt(e[0],10),e[2]?t.deviceId=parseInt(e[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;const n=Os.getValue(r,"idVendor"," ",!0).trim();let i=n.split(" ");i.shift();const s=i.join(" "),a=Os.getValue(r,"idProduct"," ",!0).trim();let o=a.split(" ");o.shift();const l=o.join(" ");let c=Os.getValue(r,"bInterfaceClass"," ",!0).trim().split(" ");c.shift();const u=c.join(" ");let p=Os.getValue(r,"iManufacturer"," ",!0).trim().split(" ");p.shift();const f=p.join(" ");return t.id=(n.startsWith("0x")?n.split(" ")[0].substr(2,10):"")+":"+(a.startsWith("0x")?a.split(" ")[0].substr(2,10):""),t.name=l,t.type=function(e,t){let r=e;const n=(t+" "+e).toLowerCase();return n.indexOf("camera")>=0?r="Camera":n.indexOf("hub")>=0?r="Hub":n.indexOf("keybrd")>=0||n.indexOf("keyboard")>=0?r="Keyboard":n.indexOf("mouse")>=0?r="Mouse":n.indexOf("stora")>=0?r="Storage":n.indexOf("mic")>=0?r="Microphone":(n.indexOf("headset")>=0||n.indexOf("audio")>=0)&&(r="Audio"),r}(u,l),t.removable=null,t.vendor=s,t.manufacturer=f,t.maxPower=Os.getValue(r,"MaxPower"," ",!0),t.serialNumber=null,t}function Ns(e,t){const r={};r.id=t;let n=(e=(e=e.replace(/ \|/g,"")).trim()).split("\n");n.shift();try{for(let e=0;e<n.length;e++){n[e]=n[e].trim(),n[e]=n[e].replace(/=/g,":"),"{"!==n[e]&&"}"!==n[e]&&n[e+1]&&"}"!==n[e+1].trim()&&(n[e]=n[e]+","),n[e]=n[e].replace(":Yes,",':"Yes",'),n[e]=n[e].replace(": Yes,",': "Yes",'),n[e]=n[e].replace(": Yes",': "Yes"'),n[e]=n[e].replace(":No,",':"No",'),n[e]=n[e].replace(": No,",': "No",'),n[e]=n[e].replace(": No",': "No"'),n[e]=n[e].replace("((","").replace("))","");const t=/<(\w+)>/.exec(n[e]);if(t){const r=t[0];n[e]=n[e].replace(r,`"${r}"`)}}const e=JSON.parse(n.join("\n")),t=!(e["Built-In"]&&"yes"===e["Built-In"].toLowerCase()||e["non-removable"]&&"no"!==e["non-removable"].toLowerCase());return r.bus=null,r.deviceId=null,r.id=e["USB Address"]||null,r.name=e.kUSBProductString||e["USB Product Name"]||null,r.type=function(e){let t="";return e.indexOf("camera")>=0?t="Camera":e.indexOf("touch bar")>=0?t="Touch Bar":e.indexOf("controller")>=0?t="Controller":e.indexOf("headset")>=0?t="Audio":e.indexOf("keyboard")>=0?t="Keyboard":e.indexOf("trackpad")>=0?t="Trackpad":e.indexOf("sensor")>=0?t="Sensor":e.indexOf("bthusb")>=0||e.indexOf("bth")>=0||e.indexOf("rfcomm")>=0?t="Bluetooth":e.indexOf("usbhub")>=0||e.indexOf(" hub")>=0?t="Hub":e.indexOf("mouse")>=0?t="Mouse":e.indexOf("mic")>=0?t="Microphone":e.indexOf("removable")>=0&&(t="Storage"),t}((e.kUSBProductString||e["USB Product Name"]||"").toLowerCase()+(t?" removable":"")),r.removable=!e["non-removable"]||(e["non-removable"].toLowerCase()||!1),r.vendor=e.kUSBVendorString||e["USB Vendor Name"]||null,r.manufacturer=e.kUSBVendorString||e["USB Vendor Name"]||null,r.maxPower=null,r.serialNumber=e.kUSBSerialNumberString||null,r.name?r:null}catch(e){return null}}function Ds(e,t){const r=function(e,t){let r="";return t.indexOf("storage")>=0||t.indexOf("speicher")>=0?r="Storage":e.indexOf("usbhub")>=0?r="Hub":e.indexOf("storage")>=0?r="Storage":e.indexOf("usbcontroller")>=0?r="Controller":e.indexOf("keyboard")>=0?r="Keyboard":e.indexOf("pointing")>=0?r="Mouse":e.indexOf("disk")>=0&&(r="Storage"),r}(Os.getValue(e,"CreationClassName",":").toLowerCase(),Os.getValue(e,"name",":").toLowerCase());if(r){const n={bus:null};return n.deviceId=Os.getValue(e,"deviceid",":"),n.id=t,n.name=Os.getValue(e,"name",":"),n.type=r,n.removable=null,n.vendor=null,n.manufacturer=Os.getValue(e,"Manufacturer",":"),n.maxPower=null,n.serialNumber=null,n}return null}xs.usb=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(bs){Cs("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:134217728},(function(n,i){if(!n){const e=("\n\n"+i.toString()).split("\n\nBus ");for(let t=1;t<e.length;t++){const n=As(e[t]);r.push(n)}}e&&e(r),t(r)}))}if(Es){Cs("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l",{maxBuffer:134217728},(function(n,i){if(!n){const n=i.toString().split(" +-o ");for(let e=1;e<n.length;e++){const t=Ns(n[e]);t&&r.push(t)}e&&e(r),t(r)}e&&e(r),t(r)}))}Ls&&Os.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then(((n,i)=>{if(!i){const e=n.toString().split(/\n\s*\n/);for(let t=0;t<e.length;t++){const n=Ds(e[t].split("\n"),t);n&&r.push(n)}}e&&e(r),t(r)})),(Vs||_s||Ps||Ts)&&t(null)}))}))};var ks={};const Ms=y.default.exec,Rs=y.default.execSync,Bs=L;let Fs=process.platform;const Gs="linux"===Fs||"android"===Fs,Ws="darwin"===Fs,Us="win32"===Fs,$s="freebsd"===Fs,js="openbsd"===Fs,Hs="netbsd"===Fs,Xs="sunos"===Fs;function zs(e,t,r){let n="";return(e=e.toLowerCase()).indexOf("input")>=0&&(n="Microphone"),e.indexOf("display audio")>=0&&(n="Speaker"),e.indexOf("speak")>=0&&(n="Speaker"),e.indexOf("laut")>=0&&(n="Speaker"),e.indexOf("loud")>=0&&(n="Speaker"),e.indexOf("head")>=0&&(n="Headset"),e.indexOf("mic")>=0&&(n="Microphone"),e.indexOf("mikr")>=0&&(n="Microphone"),e.indexOf("phone")>=0&&(n="Phone"),e.indexOf("controll")>=0&&(n="Controller"),e.indexOf("line o")>=0&&(n="Line Out"),e.indexOf("digital o")>=0&&(n="Digital Out"),e.indexOf("smart sound technology")>=0&&(n="Digital Signal Processor"),e.indexOf("high definition audio")>=0&&(n="Sound Driver"),!n&&r?n="Speaker":!n&&t&&(n="Microphone"),n}function Ks(e,t){const r={},n=((e.coreaudio_device_transport||"")+" "+(e._name||"")).toLowerCase();return r.id=t,r.name=e._name,r.manufacturer=e.coreaudio_device_manufacturer,r.revision=null,r.driver=null,r.default=!!e.coreaudio_default_audio_input_device||!!e.coreaudio_default_audio_output_device,r.channel=function(e){let t="";return e.indexOf("builtin")>=0&&(t="Built-In"),e.indexOf("extern")>=0&&(t="Audio-Jack"),e.indexOf("hdmi")>=0&&(t="HDMI"),e.indexOf("displayport")>=0&&(t="Display-Port"),e.indexOf("usb")>=0&&(t="USB"),e.indexOf("pci")>=0&&(t="PCIe"),t}(n),r.type=zs(r.name,!!e.coreaudio_device_input,!!e.coreaudio_device_output),r.in=!!e.coreaudio_device_input,r.out=!!e.coreaudio_device_output,r.status="online",r}ks.audio=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(Gs||$s||js||Hs){Ms("lspci -vmm 2>/dev/null",(function(n,i){if(!n){const e=function(){let e=[];try{return Rs("lspci -v 2>/dev/null").toString().split("\n\n").forEach((t=>{const r=t.split("\n");if(r&&r.length&&r[0].toLowerCase().indexOf("audio")>=0){const t={};t.slotId=r[0].split(" ")[0],t.driver=Bs.getValue(r,"Kernel driver in use",":",!0)||Bs.getValue(r,"Kernel modules",":",!0),e.push(t)}})),e}catch(t){return e}}();i.toString().split("\n\n").forEach((t=>{const n=t.split("\n");if(Bs.getValue(n,"class",":",!0).toLowerCase().indexOf("audio")>=0){const t=function(e,t){const r={},n=Bs.getValue(e,"Slot"),i=t.filter((function(e){return e.slotId===n}));return r.id=n,r.name=Bs.getValue(e,"SDevice"),r.manufacturer=Bs.getValue(e,"SVendor"),r.revision=Bs.getValue(e,"Rev"),r.driver=i&&1===i.length&&i[0].driver?i[0].driver:"",r.default=null,r.channel="PCIe",r.type=zs(r.name,null,null),r.in=null,r.out=null,r.status="online",r}(n,e);r.push(t)}}))}e&&e(r),t(r)}))}if(Ws){Ms("system_profiler SPAudioDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPAudioDataType&&e.SPAudioDataType.length&&e.SPAudioDataType[0]&&e.SPAudioDataType[0]._items&&e.SPAudioDataType[0]._items.length)for(let t=0;t<e.SPAudioDataType[0]._items.length;t++){const n=Ks(e.SPAudioDataType[0]._items[t],t);r.push(n)}}catch(e){Bs.noop()}e&&e(r),t(r)}))}Us&&Bs.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then(((n,i)=>{if(!i){n.toString().split(/\n\s*\n/).forEach((e=>{const t=e.split("\n");Bs.getValue(t,"name",":")&&r.push(function(e){const t={},r=Bs.getValue(e,"StatusInfo",":");return t.id=Bs.getValue(e,"DeviceID",":"),t.name=Bs.getValue(e,"name",":"),t.manufacturer=Bs.getValue(e,"manufacturer",":"),t.revision=null,t.driver=null,t.default=null,t.channel=null,t.type=zs(t.name,null,null),t.in=null,t.out=null,t.status=r,t}(t))}))}e&&e(r),t(r)})),Xs&&t(null)}))}))};var Ys={};const qs=y.default.exec,Js=y.default.execSync,Qs=g.default,Zs=L,ea=h.default;let ta=process.platform;const ra="linux"===ta||"android"===ta,na="darwin"===ta,ia="win32"===ta,sa="freebsd"===ta,aa="openbsd"===ta,oa="netbsd"===ta,la="sunos"===ta;function ca(e){let t="";return e.indexOf("keyboard")>=0&&(t="Keyboard"),e.indexOf("mouse")>=0&&(t="Mouse"),e.indexOf("trackpad")>=0&&(t="Trackpad"),e.indexOf("speaker")>=0&&(t="Speaker"),e.indexOf("headset")>=0&&(t="Headset"),e.indexOf("phone")>=0&&(t="Phone"),e.indexOf("macbook")>=0&&(t="Computer"),e.indexOf("imac")>=0&&(t="Computer"),e.indexOf("ipad")>=0&&(t="Tablet"),e.indexOf("watch")>=0&&(t="Watch"),e.indexOf("headphone")>=0&&(t="Headset"),t}function ua(e,t){const r={},n=((e.device_minorClassOfDevice_string||e.device_majorClassOfDevice_string||e.device_minorType||"")+(e.device_name||"")).toLowerCase();return r.device=e.device_services||"",r.name=e.device_name||"",r.manufacturer=e.device_manufacturer||function(e){let t=e.split(" ")[0];return(e=e.toLowerCase()).indexOf("apple")>=0&&(t="Apple"),e.indexOf("ipad")>=0&&(t="Apple"),e.indexOf("imac")>=0&&(t="Apple"),e.indexOf("iphone")>=0&&(t="Apple"),e.indexOf("magic mouse")>=0&&(t="Apple"),e.indexOf("magic track")>=0&&(t="Apple"),e.indexOf("macbook")>=0&&(t="Apple"),t}(e.device_name||"")||"",r.macDevice=(e.device_addr||e.device_address||"").toLowerCase().replace(/-/g,":"),r.macHost=t,r.batteryPercent=e.device_batteryPercent||null,r.type=ca(n),r.connected="attrib_Yes"===e.device_isconnected||!1,r}Ys.bluetoothDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let r=[];if(ra){Zs.getFilesInPath("/var/lib/bluetooth/").forEach((e=>{const t=Qs.basename(e),n=e.split("/"),i=n.length>=6?n[n.length-2]:null,s=n.length>=7?n[n.length-3]:null;if("info"===t){const t=ea.readFileSync(e,{encoding:"utf8"}).split("\n");r.push(function(e,t,r){const n={device:null};return n.name=Zs.getValue(e,"name","="),n.manufacturer=null,n.macDevice=t,n.macHost=r,n.batteryPercent=null,n.type=ca(n.name.toLowerCase()),n.connected=!1,n}(t,i,s))}}));try{const e=Js("hcitool con").toString().toLowerCase();for(let t=0;t<r.length;t++)r[t].macDevice&&r[t].macDevice.length>10&&e.indexOf(r[t].macDevice.toLowerCase())>=0&&(r[t].connected=!0)}catch(e){Zs.noop()}e&&e(r),t(r)}if(na){qs("system_profiler SPBluetoothDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_title&&e.SPBluetoothDataType[0].device_title.length){let t=null;e.SPBluetoothDataType[0].local_device_title&&e.SPBluetoothDataType[0].local_device_title.general_address&&(t=e.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":")),e.SPBluetoothDataType[0].device_title.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0];const s=ua(e,t);r.push(s)}}))}if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_connected&&e.SPBluetoothDataType[0].device_connected.length){const t=e.SPBluetoothDataType[0].controller_properties&&e.SPBluetoothDataType[0].controller_properties.controller_address?e.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;e.SPBluetoothDataType[0].device_connected.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0],e.device_isconnected="attrib_Yes";const s=ua(e,t);r.push(s)}}))}if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_not_connected&&e.SPBluetoothDataType[0].device_not_connected.length){const t=e.SPBluetoothDataType[0].controller_properties&&e.SPBluetoothDataType[0].controller_properties.controller_address?e.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;e.SPBluetoothDataType[0].device_not_connected.forEach((e=>{const n=e,i=Object.keys(n);if(i&&1===i.length){const e=n[i[0]];e.device_name=i[0],e.device_isconnected="attrib_No";const s=ua(e,t);r.push(s)}}))}}catch(e){Zs.noop()}e&&e(r),t(r)}))}ia&&Zs.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then(((n,i)=>{if(!i){n.toString().split(/\n\s*\n/).forEach((e=>{"Bluetooth"===Zs.getValue(e.split("\n"),"PNPClass",":")&&r.push(function(e){const t={device:null};return t.name=Zs.getValue(e,"name",":"),t.manufacturer=Zs.getValue(e,"manufacturer",":"),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=ca(t.name.toLowerCase()),t.connected=null,t}(e.split("\n")))}))}e&&e(r),t(r)})),(sa||oa||aa||la)&&t(null)}))}))},function(e){const t=E,r=L,n=ye,i=Ne,s=Je,a=Et,o=er,l=tr,c=Or,u=Xr,p=Nn,f=Jn,d=Si,m=Ai,h=Ui,g=ts,y=ss,v=xs,S=ks,w=Ys;let x=process.platform;const C="win32"===x,O="freebsd"===x,I="openbsd"===x,b="netbsd"===x,_="sunos"===x;function P(){return t}function T(e){return new Promise((t=>{process.nextTick((()=>{let r={};r.version=P(),Promise.all([n.system(),n.bios(),n.baseboard(),n.chassis(),i.osInfo(),i.uuid(),i.versions(),s.cpu(),s.cpuFlags(),l.graphics(),u.networkInterfaces(),a.memLayout(),c.diskLayout()]).then((n=>{r.system=n[0],r.bios=n[1],r.baseboard=n[2],r.chassis=n[3],r.os=n[4],r.uuid=n[5],r.versions=n[6],r.cpu=n[7],r.cpu.flags=n[8],r.graphics=n[9],r.net=n[10],r.memLayout=n[11],r.diskLayout=n[12],e&&e(r),t(r)}))}))}))}function V(e,t,n){return r.isFunction(t)&&(n=t,t=""),r.isFunction(e)&&(n=e,e=""),new Promise((r=>{process.nextTick((()=>{t=t||u.getDefaultNetworkInterface(),e=e||"";let l=function(){let e=15;return C&&(e=13),(O||I||b)&&(e=11),_&&(e=6),function(){0==--e&&(n&&n(h),r(h))}}(),h={};h.time=i.time(),h.node=process.versions.node,h.v8=process.versions.v8,s.cpuCurrentSpeed().then((e=>{h.cpuCurrentSpeed=e,l()})),d.users().then((e=>{h.users=e,l()})),f.processes().then((e=>{h.processes=e,l()})),s.currentLoad().then((e=>{h.currentLoad=e,l()})),_||s.cpuTemperature().then((e=>{h.temp=e,l()})),I||O||b||_||u.networkStats(t).then((e=>{h.networkStats=e,l()})),_||u.networkConnections().then((e=>{h.networkConnections=e,l()})),a.mem().then((e=>{h.mem=e,l()})),_||o().then((e=>{h.battery=e,l()})),_||f.services(e).then((e=>{h.services=e,l()})),_||c.fsSize().then((e=>{h.fsSize=e,l()})),C||I||O||b||_||c.fsStats().then((e=>{h.fsStats=e,l()})),C||I||O||b||_||c.disksIO().then((e=>{h.disksIO=e,l()})),I||O||b||_||p.wifiNetworks().then((e=>{h.wifiNetworks=e,l()})),m.inetLatency().then((e=>{h.inetLatency=e,l()}))}))}))}function A(t,r){return new Promise((n=>{process.nextTick((()=>{const i=Object.keys(t).filter((t=>({}.hasOwnProperty.call(e,t)))).map((r=>{const n=t[r].substring(t[r].lastIndexOf("(")+1,t[r].lastIndexOf(")"));let i=r.indexOf(")")>=0?r.split(")")[1].trim():r;return i=r.indexOf("|")>=0?r.split("|")[0].trim():i,n?e[i](n):e[i]("")}));Promise.all(i).then((i=>{const s={};let a=0;for(let r in t)if({}.hasOwnProperty.call(t,r)&&{}.hasOwnProperty.call(e,r)&&i.length>a){if("*"===t[r]||"all"===t[r])s[r]=i[a];else{let e=t[r],n="",o=[];if(e.indexOf(")")>=0&&(e=e.split(")")[1].trim()),e.indexOf("|")>=0&&(n=e.split("|")[1].trim(),o=n.split(":"),e=e.split("|")[0].trim()),e=e.replace(/,/g," ").replace(/ +/g," ").split(" "),i[a])if(Array.isArray(i[a])){const t=[];i[a].forEach((r=>{let i={};if(1!==e.length||"*"!==e[0]&&"all"!==e[0]?e.forEach((e=>{({}).hasOwnProperty.call(r,e)&&(i[e]=r[e])})):i=r,n&&2===o.length){if({}.hasOwnProperty.call(i,o[0].trim())){const e=i[o[0].trim()];"number"==typeof e?e===parseFloat(o[1].trim())&&t.push(i):"string"==typeof e&&e.toLowerCase()===o[1].trim().toLowerCase()&&t.push(i)}}else t.push(i)})),s[r]=t}else{const t={};e.forEach((e=>{({}).hasOwnProperty.call(i[a],e)&&(t[e]=i[a][e])})),s[r]=t}else s[r]={}}a++}r&&r(s),n(s)}))}))}))}C&&r.getCodepage(),e.version=P,e.system=n.system,e.bios=n.bios,e.baseboard=n.baseboard,e.chassis=n.chassis,e.time=i.time,e.osInfo=i.osInfo,e.versions=i.versions,e.shell=i.shell,e.uuid=i.uuid,e.cpu=s.cpu,e.cpuFlags=s.cpuFlags,e.cpuCache=s.cpuCache,e.cpuCurrentSpeed=s.cpuCurrentSpeed,e.cpuTemperature=s.cpuTemperature,e.currentLoad=s.currentLoad,e.fullLoad=s.fullLoad,e.mem=a.mem,e.memLayout=a.memLayout,e.battery=o,e.graphics=l.graphics,e.fsSize=c.fsSize,e.fsOpenFiles=c.fsOpenFiles,e.blockDevices=c.blockDevices,e.fsStats=c.fsStats,e.disksIO=c.disksIO,e.diskLayout=c.diskLayout,e.networkInterfaceDefault=u.networkInterfaceDefault,e.networkGatewayDefault=u.networkGatewayDefault,e.networkInterfaces=u.networkInterfaces,e.networkStats=u.networkStats,e.networkConnections=u.networkConnections,e.wifiNetworks=p.wifiNetworks,e.wifiInterfaces=p.wifiInterfaces,e.wifiConnections=p.wifiConnections,e.services=f.services,e.processes=f.processes,e.processLoad=f.processLoad,e.users=d.users,e.inetChecksite=m.inetChecksite,e.inetLatency=m.inetLatency,e.dockerInfo=h.dockerInfo,e.dockerImages=h.dockerImages,e.dockerContainers=h.dockerContainers,e.dockerContainerStats=h.dockerContainerStats,e.dockerContainerProcesses=h.dockerContainerProcesses,e.dockerVolumes=h.dockerVolumes,e.dockerAll=h.dockerAll,e.vboxInfo=g.vboxInfo,e.printer=y.printer,e.usb=v.usb,e.audio=S.audio,e.bluetoothDevices=w.bluetoothDevices,e.getStaticData=T,e.getDynamicData=V,e.getAllData=function(e,t,n){return new Promise((i=>{process.nextTick((()=>{let s={};t&&r.isFunction(t)&&!n&&(n=t,t=""),e&&r.isFunction(e)&&!t&&!n&&(n=e,e="",t=""),T().then((r=>{s=r,V(e,t).then((e=>{for(let t in e)({}).hasOwnProperty.call(e,t)&&(s[t]=e[t]);n&&n(s),i(s)}))}))}))}))},e.get=A,e.observe=function(e,t,r){let n=null;return setInterval((()=>{A(e).then((e=>{JSON.stringify(n)!==JSON.stringify(e)&&(n=Object.assign({},e),r(e))}))}),t)},e.powerShellStart=r.powerShellStart,e.powerShellRelease=r.powerShellRelease}(b);var pa={},fa={exports:{}};
2
2
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
- !function(e,t){var r=w.default,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),s.prototype=Object.create(n.prototype),i(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(fa,fa.exports);var da=fa.exports.Buffer,ma=x.default;function ha(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=da.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=da.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}v.default.inherits(ha,ma),ha.prototype.write=function(e){this.buffer=da.concat([this.buffer,da.from(e)]),this.emit("data",e)},ha.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var ga=ha,ya=w.default.Buffer,va=w.default.SlowBuffer,Sa=wa;function wa(e,t){if(!ya.isBuffer(e)||!ya.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}wa.install=function(){ya.prototype.equal=va.prototype.equal=function(e){return wa(this,e)}};var xa=ya.prototype.equal,Ca=va.prototype.equal;function Oa(e){return(e/8|0)+(e%8==0?0:1)}wa.restore=function(){ya.prototype.equal=xa,va.prototype.equal=Ca};var Ia={ES256:Oa(256),ES384:Oa(384),ES512:Oa(521)};var ba=function(e){var t=Ia[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')},Ea=fa.exports.Buffer,La=ba,_a=128;function Pa(e){if(Ea.isBuffer(e))return e;if("string"==typeof e)return Ea.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Ta(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=_a&&--n,n}var Va={derToJose:function(e,t){e=Pa(e);var r=La(t),n=r+1,i=e.length,s=0;if(48!==e[s++])throw new Error('Could not find expected "seq"');var a=e[s++];if(a===(1|_a)&&(a=e[s++]),i-s<a)throw new Error('"seq" specified length of "'+a+'", only "'+(i-s)+'" remaining');if(2!==e[s++])throw new Error('Could not find expected "int" for "r"');var o=e[s++];if(i-s-2<o)throw new Error('"r" specified length of "'+o+'", only "'+(i-s-2)+'" available');if(n<o)throw new Error('"r" specified length of "'+o+'", max of "'+n+'" is acceptable');var l=s;if(s+=o,2!==e[s++])throw new Error('Could not find expected "int" for "s"');var c=e[s++];if(i-s!==c)throw new Error('"s" specified length of "'+c+'", expected "'+(i-s)+'"');if(n<c)throw new Error('"s" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if((s+=c)!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var p=r-o,f=r-c,d=Ea.allocUnsafe(p+o+f+c);for(s=0;s<p;++s)d[s]=0;e.copy(d,s,l+Math.max(-p,0),l+o);for(var m=s=r;s<m+f;++s)d[s]=0;return e.copy(d,s,u+Math.max(-f,0),u+c),d=(d=d.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=Pa(e);var r=La(t),n=e.length;if(n!==2*r)throw new TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var i=Ta(e,0,r),s=Ta(e,r,e.length),a=r-i,o=r-s,l=2+a+1+1+o,c=l<_a,u=Ea.allocUnsafe((c?2:3)+l),p=0;return u[p++]=48,c?u[p++]=l:(u[p++]=1|_a,u[p++]=255&l),u[p++]=2,u[p++]=a,i<0?(u[p++]=0,p+=e.copy(u,p,0,r)):p+=e.copy(u,p,i,r),u[p++]=2,u[p++]=o,s<0?(u[p++]=0,e.copy(u,p,r)):e.copy(u,p,r+s),u}},Aa=Sa,Na=fa.exports.Buffer,Da=f.default,ka=Va,Ma=v.default,Ra="secret must be a string or buffer",Ba="key must be a string or a buffer",Fa="key must be a string, a buffer or an object",Ga="function"==typeof Da.createPublicKey;function Wa(e){if(!Na.isBuffer(e)&&"string"!=typeof e){if(!Ga)throw Ha(Ba);if("object"!=typeof e)throw Ha(Ba);if("string"!=typeof e.type)throw Ha(Ba);if("string"!=typeof e.asymmetricKeyType)throw Ha(Ba);if("function"!=typeof e.export)throw Ha(Ba)}}function Ua(e){if(!Na.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw Ha(Fa)}function $a(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ja(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Ha(e){var t=[].slice.call(arguments,1),r=Ma.format.bind(Ma,e).apply(null,t);return new TypeError(r)}function Xa(e){var t;return t=e,Na.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function za(e){return function(t,r){!function(e){if(!Na.isBuffer(e)){if("string"==typeof e)return e;if(!Ga)throw Ha(Ra);if("object"!=typeof e)throw Ha(Ra);if("secret"!==e.type)throw Ha(Ra);if("function"!=typeof e.export)throw Ha(Ra)}}(r),t=Xa(t);var n=Da.createHmac("sha"+e,r);return $a((n.update(t),n.digest("base64")))}}function Ka(e){return function(t,r,n){var i=za(e)(t,n);return Aa(Na.from(r),Na.from(i))}}function Ya(e){return function(t,r){Ua(r),t=Xa(t);var n=Da.createSign("RSA-SHA"+e);return $a((n.update(t),n.sign(r,"base64")))}}function qa(e){return function(t,r,n){Wa(n),t=Xa(t),r=ja(r);var i=Da.createVerify("RSA-SHA"+e);return i.update(t),i.verify(n,r,"base64")}}function Ja(e){return function(t,r){Ua(r),t=Xa(t);var n=Da.createSign("RSA-SHA"+e);return $a((n.update(t),n.sign({key:r,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function Qa(e){return function(t,r,n){Wa(n),t=Xa(t),r=ja(r);var i=Da.createVerify("RSA-SHA"+e);return i.update(t),i.verify({key:n,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function Za(e){var t=Ya(e);return function(){var r=t.apply(null,arguments);return r=ka.derToJose(r,"ES"+e)}}function eo(e){var t=qa(e);return function(r,n,i){return n=ka.joseToDer(n,"ES"+e).toString("base64"),t(r,n,i)}}function to(){return function(){return""}}function ro(){return function(e,t){return""===t}}Ga&&(Ba+=" or a KeyObject",Ra+="or a KeyObject");var no=function(e){var t={hs:za,rs:Ya,ps:Ja,es:Za,none:to},r={hs:Ka,rs:qa,ps:Qa,es:eo,none:ro},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!n)throw Ha('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var i=(n[1]||n[3]).toLowerCase(),s=n[2];return{sign:t[i](s),verify:r[i](s)}},io=w.default.Buffer,so=function(e){return"string"==typeof e?e:"number"==typeof e||io.isBuffer(e)?e.toString():JSON.stringify(e)},ao=fa.exports.Buffer,oo=ga,lo=no,co=x.default,uo=so,po=v.default;function fo(e,t){return ao.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mo(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,s=lo(t.alg),a=function(e,t,r){r=r||"utf8";var n=fo(uo(e),"binary"),i=fo(uo(t),r);return po.format("%s.%s",n,i)}(t,r,i),o=s.sign(a,n);return po.format("%s.%s",a,o)}function ho(e){var t=e.secret||e.privateKey||e.key,r=new oo(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new oo(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}po.inherits(ho,co),ho.prototype.sign=function(){try{var e=mo({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},ho.sign=mo;var go=ho,yo=fa.exports.Buffer,vo=ga,So=no,wo=x.default,xo=so,Co=v.default,Oo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Io(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}function bo(e){var t=e.split(".",1)[0];return Io(yo.from(t,"base64").toString("binary"))}function Eo(e){return e.split(".")[2]}function Lo(e){return Oo.test(e)&&!!bo(e)}function _o(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var i=Eo(e=xo(e)),s=function(e){return e.split(".",2).join(".")}(e);return So(t).verify(s,i,r)}function Po(e,t){if(t=t||{},!Lo(e=xo(e)))return null;var r=bo(e);if(!r)return null;var n=function(e,t){t=t||"utf8";var r=e.split(".")[1];return yo.from(r,"base64").toString(t)}(e);return("JWT"===r.typ||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:Eo(e)}}function To(e){var t=(e=e||{}).secret||e.publicKey||e.key,r=new vo(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new vo(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}Co.inherits(To,wo),To.prototype.verify=function(){try{var e=_o(this.signature.buffer,this.algorithm,this.key.buffer),t=Po(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},To.decode=Po,To.isValid=Lo,To.verify=_o;var Vo=go,Ao=To;pa.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],pa.sign=Vo.sign,pa.verify=Ao.verify,pa.decode=Ao.decode,pa.isValid=Ao.isValid,pa.createSign=function(e){return new Vo(e)},pa.createVerify=function(e){return new Ao(e)};var No=pa,Do=function(e,t){t=t||{};var r=No.decode(e,t);if(!r)return null;var n=r.payload;if("string"==typeof n)try{var i=JSON.parse(n);null!==i&&"object"==typeof i&&(n=i)}catch(e){}return!0===t.complete?{header:r.header,payload:n,signature:r.signature}:n},ko=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};(ko.prototype=Object.create(Error.prototype)).constructor=ko;var Mo=ko,Ro=Mo,Bo=function(e,t){Ro.call(this,e),this.name="NotBeforeError",this.date=t};(Bo.prototype=Object.create(Ro.prototype)).constructor=Bo;var Fo=Bo,Go=Mo,Wo=function(e,t){Go.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};(Wo.prototype=Object.create(Go.prototype)).constructor=Wo;var Uo=Wo,$o=1e3,jo=60*$o,Ho=60*jo,Xo=24*Ho,zo=7*Xo,Ko=365.25*Xo;function Yo(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}var qo=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*Ko;case"weeks":case"week":case"w":return r*zo;case"days":case"day":case"d":return r*Xo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ho;case"minutes":case"minute":case"mins":case"min":case"m":return r*jo;case"seconds":case"second":case"secs":case"sec":case"s":return r*$o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=Xo)return Yo(e,t,Xo,"day");if(t>=Ho)return Yo(e,t,Ho,"hour");if(t>=jo)return Yo(e,t,jo,"minute");if(t>=$o)return Yo(e,t,$o,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=Xo)return Math.round(e/Xo)+"d";if(t>=Ho)return Math.round(e/Ho)+"h";if(t>=jo)return Math.round(e/jo)+"m";if(t>=$o)return Math.round(e/$o)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Jo=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var n=qo(e);if(void 0===n)return;return Math.floor(r+n/1e3)}return"number"==typeof e?r+e:void 0},Qo={exports:{}};var Zo={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var el="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Zo,s=el,a=(t=e.exports={}).re=[],o=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[p,n]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=u++;s(e,i,t),c[e]=i,l[i]=t,a[i]=new RegExp(t,r?"g":void 0),o[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),d("FULL",`^${l[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),d("LOOSE",`^${l[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),d("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),d("COERCERTL",l[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Qo,Qo.exports);const tl=Object.freeze({loose:!0}),rl=Object.freeze({});var nl=e=>e?"object"!=typeof e?tl:e:rl;const il=/^[0-9]+$/,sl=(e,t)=>{const r=il.test(e),n=il.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var al={compareIdentifiers:sl,rcompareIdentifiers:(e,t)=>sl(t,e)};const ol=el,{MAX_LENGTH:ll,MAX_SAFE_INTEGER:cl}=Zo,{safeRe:ul,t:pl}=Qo.exports,fl=nl,{compareIdentifiers:dl}=al;class ml{constructor(e,t){if(t=fl(t),e instanceof ml){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ll)throw new TypeError(`version is longer than ${ll} characters`);ol("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?ul[pl.LOOSE]:ul[pl.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>cl||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cl||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cl||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<cl)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ol("SemVer.compare",this.version,this.options,e),!(e instanceof ml)){if("string"==typeof e&&e===this.version)return 0;e=new ml(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ml||(e=new ml(e,this.options)),dl(this.major,e.major)||dl(this.minor,e.minor)||dl(this.patch,e.patch)}comparePre(e){if(e instanceof ml||(e=new ml(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(ol("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return dl(r,n)}while(++t)}compareBuild(e){e instanceof ml||(e=new ml(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(ol("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return dl(r,n)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===dl(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var hl=ml;const gl=hl;var yl=(e,t,r=!1)=>{if(e instanceof gl)return e;try{return new gl(e,t)}catch(e){if(!r)return null;throw e}};const vl=yl;var Sl=(e,t)=>{const r=vl(e,t);return r?r.version:null};const wl=yl;var xl=(e,t)=>{const r=wl(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const Cl=hl;var Ol=(e,t,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new Cl(e instanceof Cl?e.version:e,r).inc(t,n,i).version}catch(e){return null}};const Il=yl;var bl=(e,t)=>{const r=Il(e,null,!0),n=Il(t,null,!0),i=r.compare(n);if(0===i)return null;const s=i>0,a=s?r:n,o=s?n:r,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l)return o.patch||o.minor?a.patch?"patch":a.minor?"minor":"major":"major";const c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};const El=hl;var Ll=(e,t)=>new El(e,t).major;const _l=hl;var Pl=(e,t)=>new _l(e,t).minor;const Tl=hl;var Vl=(e,t)=>new Tl(e,t).patch;const Al=yl;var Nl=(e,t)=>{const r=Al(e,t);return r&&r.prerelease.length?r.prerelease:null};const Dl=hl;var kl=(e,t,r)=>new Dl(e,r).compare(new Dl(t,r));const Ml=kl;var Rl=(e,t,r)=>Ml(t,e,r);const Bl=kl;var Fl=(e,t)=>Bl(e,t,!0);const Gl=hl;var Wl=(e,t,r)=>{const n=new Gl(e,r),i=new Gl(t,r);return n.compare(i)||n.compareBuild(i)};const Ul=Wl;var $l=(e,t)=>e.sort(((e,r)=>Ul(e,r,t)));const jl=Wl;var Hl=(e,t)=>e.sort(((e,r)=>jl(r,e,t)));const Xl=kl;var zl=(e,t,r)=>Xl(e,t,r)>0;const Kl=kl;var Yl=(e,t,r)=>Kl(e,t,r)<0;const ql=kl;var Jl=(e,t,r)=>0===ql(e,t,r);const Ql=kl;var Zl=(e,t,r)=>0!==Ql(e,t,r);const ec=kl;var tc=(e,t,r)=>ec(e,t,r)>=0;const rc=kl;var nc=(e,t,r)=>rc(e,t,r)<=0;const ic=Jl,sc=Zl,ac=zl,oc=tc,lc=Yl,cc=nc;var uc=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return ic(e,r,n);case"!=":return sc(e,r,n);case">":return ac(e,r,n);case">=":return oc(e,r,n);case"<":return lc(e,r,n);case"<=":return cc(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const pc=hl,fc=yl,{safeRe:dc,t:mc}=Qo.exports;var hc,gc,yc,vc,Sc,wc,xc,Cc,Oc,Ic,bc=(e,t)=>{if(e instanceof pc)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=dc[mc.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),dc[mc.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;dc[mc.COERCERTL].lastIndex=-1}else r=e.match(dc[mc.COERCE]);return null===r?null:fc(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function Ec(){if(vc)return yc;function e(t){var r=this;if(r instanceof e||(r=new e),r.tail=null,r.head=null,r.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){r.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)r.push(arguments[n]);return r}function t(e,t,r){var n=t===e.head?new i(r,null,t,e):new i(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function r(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function n(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,r,n){if(!(this instanceof i))return new i(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}vc=1,yc=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},e.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},e.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},e.prototype.map=function(t,r){r=r||this;for(var n=new e,i=this.head;null!==i;)n.push(t.call(r,i.value,this)),i=i.next;return n},e.prototype.mapReverse=function(t,r){r=r||this;for(var n=new e,i=this.tail;null!==i;)n.push(t.call(r,i.value,this)),i=i.prev;return n},e.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},e.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},e.prototype.slice=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var i=0,s=this.head;null!==s&&i<t;i++)s=s.next;for(;null!==s&&i<r;i++,s=s.next)n.push(s.value);return n},e.prototype.sliceReverse=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var i=this.length,s=this.tail;null!==s&&i>r;i--)s=s.prev;for(;null!==s&&i>t;i--,s=s.prev)n.push(s.value);return n},e.prototype.splice=function(e,r,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;var a=[];for(i=0;s&&i<r;i++)a.push(s.value),s=this.removeNode(s);null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(i=0;i<n.length;i++)s=t(this,s,n[i]);return a},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{(gc?hc:(gc=1,hc=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return yc}function Lc(){if(Cc)return xc;Cc=1;class e{constructor(t,r){if(r=n(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&h(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,n=r.get(t);if(n)return n;const a=this.options.loose,h=a?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];e=e.replace(h,L(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(o[l.COMPARATORTRIM],c),s("comparator trim",e),e=e.replace(o[l.TILDETRIM],u),s("tilde trim",e),e=e.replace(o[l.CARETTRIM],p),s("caret trim",e);let g=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));a&&(g=g.filter((e=>(s("loose invalid filter",e,this.options),!!e.match(o[l.COMPARATORLOOSE]))))),s("range list",g);const v=new Map,S=g.map((e=>new i(e,this.options)));for(const e of S){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return r.set(t,w),w}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,r)&&t.set.some((t=>g(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(_(this.set[t],e,this.options))return!0;return!1}}xc=e;const t=function(){if(wc)return Sc;wc=1;const e=Ec(),t=Symbol("max"),r=Symbol("length"),n=Symbol("lengthCalculator"),i=Symbol("allowStale"),s=Symbol("maxAge"),a=Symbol("dispose"),o=Symbol("noDisposeOnSet"),l=Symbol("lruList"),c=Symbol("cache"),u=Symbol("updateAgeOnGet"),p=()=>1,f=(e,t,r)=>{const n=e[c].get(t);if(n){const t=n.value;if(d(e,t)){if(h(e,n),!e[i])return}else r&&(e[u]&&(n.value.now=Date.now()),e[l].unshiftNode(n));return t.value}},d=(e,t)=>{if(!t||!t.maxAge&&!e[s])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[s]&&r>e[s]},m=e=>{if(e[r]>e[t])for(let n=e[l].tail;e[r]>e[t]&&null!==n;){const t=n.prev;h(e,n),n=t}},h=(e,t)=>{if(t){const n=t.value;e[a]&&e[a](n.key,n.value),e[r]-=n.length,e[c].delete(n.key),e[l].removeNode(t)}};class g{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const y=(e,t,r,n)=>{let s=r.value;d(e,s)&&(h(e,r),e[i]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};return Sc=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const r=e.length||p;if(this[n]="function"!=typeof r?p:r,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[s]=e.maxAge||0,this[a]=e.dispose,this[o]=e.noDisposeOnSet||!1,this[u]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,m(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[s]=e,m(this)}get maxAge(){return this[s]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[n]&&(this[n]=e,this[r]=0,this[l].forEach((e=>{e.length=this[n](e.value,e.key),this[r]+=e.length}))),m(this)}get lengthCalculator(){return this[n]}get length(){return this[r]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let r=this[l].tail;null!==r;){const n=r.prev;y(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[l].head;null!==r;){const n=r.next;y(this,e,r,t),r=n}}keys(){return this[l].toArray().map((e=>e.key))}values(){return this[l].toArray().map((e=>e.value))}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach((e=>this[a](e.key,e.value))),this[c]=new Map,this[l]=new e,this[r]=0}dump(){return this[l].map((e=>!d(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[l]}set(e,i,u){if((u=u||this[s])&&"number"!=typeof u)throw new TypeError("maxAge must be a number");const p=u?Date.now():0,f=this[n](i,e);if(this[c].has(e)){if(f>this[t])return h(this,this[c].get(e)),!1;const n=this[c].get(e).value;return this[a]&&(this[o]||this[a](e,n.value)),n.now=p,n.maxAge=u,n.value=i,this[r]+=f-n.length,n.length=f,this.get(e),m(this),!0}const d=new g(e,i,f,p,u);return d.length>this[t]?(this[a]&&this[a](e,i),!1):(this[r]+=d.length,this[l].unshift(d),this[c].set(e,this[l].head),m(this),!0)}has(e){if(!this[c].has(e))return!1;const t=this[c].get(e).value;return!d(this,t)}get(e){return f(this,e,!0)}peek(e){return f(this,e,!1)}pop(){const e=this[l].tail;return e?(h(this,e),e.value):null}del(e){h(this,this[c].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[c].forEach(((e,t)=>f(this,t,!1)))}},Sc}(),r=new t({max:1e3}),n=nl,i=_c(),s=el,a=hl,{safeRe:o,t:l,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:p}=Qo.exports,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=Zo,m=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},y=(e,t)=>(s("comp",e,t),e=x(e,t),s("caret",e),e=S(e,t),s("tildes",e),e=O(e,t),s("xrange",e),e=b(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?o[l.TILDELOOSE]:o[l.TILDE];return e.replace(r,((t,r,n,i,a)=>{let o;return s("tilde",e,t,r,n,i,a),v(r)?o="":v(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:a?(s("replaceTilde pr",a),o=`>=${r}.${n}.${i}-${a} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",o),o}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{s("caret",e,t);const r=t.loose?o[l.CARETLOOSE]:o[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,a,o)=>{let l;return s("caret",e,t,r,i,a,o),v(r)?l="":v(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(a)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(s("replaceCaret pr",o),l="0"===r?"0"===i?`>=${r}.${i}.${a}-${o} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a}-${o} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${a}${n} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a} <${+r+1}.0.0-0`),s("caret return",l),l}))},O=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return e.replace(r,((r,n,i,a,o,l)=>{s("xRange",e,r,n,i,a,o,l);const c=v(i),u=c||v(a),p=u||v(o),f=p;return"="===n&&f&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(a=0),o=0,">"===n?(n=">=",u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===n&&(n="<",u?i=+i+1:a=+a+1),"<"===n&&(l="-0"),r=`${n+i}.${a}.${o}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${a}.0${l} <${i}.${+a+1}.0-0`),s("xRange return",r),r}))},b=(e,t)=>(s("replaceStars",e,t),e.trim().replace(o[l.STAR],"")),E=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(o[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),L=e=>(t,r,n,i,s,a,o,l,c,u,p,f,d)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${e?"-0":""}`:v(s)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=v(c)?"":v(u)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${p}-${f}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),_=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return xc}function _c(){if(Ic)return Oc;Ic=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){if(i=r(i),n instanceof t){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),a("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new o(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new o(t,this.options)}catch(e){return!1}return s(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,n).test(this.value):""===e.operator?""===e.value||new l(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(s(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(s(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Oc=t;const r=nl,{safeRe:n,t:i}=Qo.exports,s=uc,a=el,o=hl,l=Lc();return Oc}const Pc=Lc();var Tc=(e,t,r)=>{try{t=new Pc(t,r)}catch(e){return!1}return t.test(e)};const Vc=Lc();var Ac=(e,t)=>new Vc(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Nc=hl,Dc=Lc();var kc=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Dc(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new Nc(n,r)))})),n};const Mc=hl,Rc=Lc();var Bc=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Rc(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new Mc(n,r)))})),n};const Fc=hl,Gc=Lc(),Wc=zl;var Uc=(e,t)=>{e=new Gc(e,t);let r=new Fc("0.0.0");if(e.test(r))return r;if(r=new Fc("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let i=null;n.forEach((e=>{const t=new Fc(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Wc(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!Wc(r,i)||(r=i)}return r&&e.test(r)?r:null};const $c=Lc();var jc=(e,t)=>{try{return new $c(e,t).range||"*"}catch(e){return null}};const Hc=hl,Xc=_c(),{ANY:zc}=Xc,Kc=Lc(),Yc=Tc,qc=zl,Jc=Yl,Qc=nc,Zc=tc;var eu=(e,t,r,n)=>{let i,s,a,o,l;switch(e=new Hc(e,n),t=new Kc(t,n),r){case">":i=qc,s=Qc,a=Jc,o=">",l=">=";break;case"<":i=Jc,s=Zc,a=qc,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Yc(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const c=t.set[r];let u=null,p=null;if(c.forEach((e=>{e.semver===zc&&(e=new Xc(">=0.0.0")),u=u||e,p=p||e,i(e.semver,u.semver,n)?u=e:a(e.semver,p.semver,n)&&(p=e)})),u.operator===o||u.operator===l)return!1;if((!p.operator||p.operator===o)&&s(e,p.semver))return!1;if(p.operator===l&&a(e,p.semver))return!1}return!0};const tu=eu;var ru=(e,t,r)=>tu(e,t,">",r);const nu=eu;var iu=(e,t,r)=>nu(e,t,"<",r);const su=Lc();var au=(e,t,r)=>(e=new su(e,r),t=new su(t,r),e.intersects(t,r));const ou=Tc,lu=kl;const cu=Lc(),uu=_c(),{ANY:pu}=uu,fu=Tc,du=kl,mu=[new uu(">=0.0.0-0")],hu=[new uu(">=0.0.0")],gu=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===pu){if(1===t.length&&t[0].semver===pu)return!0;e=r.includePrerelease?mu:hu}if(1===t.length&&t[0].semver===pu){if(r.includePrerelease)return!0;t=hu}const n=new Set;let i,s,a,o,l,c,u;for(const t of e)">"===t.operator||">="===t.operator?i=yu(i,t,r):"<"===t.operator||"<="===t.operator?s=vu(s,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&s){if(a=du(i.semver,s.semver,r),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==s.operator))return null}for(const e of n){if(i&&!fu(e,String(i),r))return null;if(s&&!fu(e,String(s),r))return null;for(const n of t)if(!fu(e,String(n),r))return!1;return!0}let p=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver,f=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;p&&1===p.prerelease.length&&"<"===s.operator&&0===p.prerelease[0]&&(p=!1);for(const e of t){if(u=u||">"===e.operator||">="===e.operator,c=c||"<"===e.operator||"<="===e.operator,i)if(f&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===f.major&&e.semver.minor===f.minor&&e.semver.patch===f.patch&&(f=!1),">"===e.operator||">="===e.operator){if(o=yu(i,e,r),o===e&&o!==i)return!1}else if(">="===i.operator&&!fu(i.semver,String(e),r))return!1;if(s)if(p&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===p.major&&e.semver.minor===p.minor&&e.semver.patch===p.patch&&(p=!1),"<"===e.operator||"<="===e.operator){if(l=vu(s,e,r),l===e&&l!==s)return!1}else if("<="===s.operator&&!fu(s.semver,String(e),r))return!1;if(!e.operator&&(s||i)&&0!==a)return!1}return!(i&&c&&!s&&0!==a)&&(!(s&&u&&!i&&0!==a)&&(!f&&!p))},yu=(e,t,r)=>{if(!e)return t;const n=du(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},vu=(e,t,r)=>{if(!e)return t;const n=du(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var Su=(e,t,r={})=>{if(e===t)return!0;e=new cu(e,r),t=new cu(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=gu(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const wu=Qo.exports,xu=Zo,Cu=hl,Ou=al,Iu=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort(((e,t)=>lu(e,t,r)));for(const e of a){ou(e,t,r)?(s=e,i||(i=e)):(s&&n.push([i,s]),s=null,i=null)}i&&n.push([i,null]);const o=[];for(const[e,t]of n)e===t?o.push(e):t||e!==a[0]?t?e===a[0]?o.push(`<=${t}`):o.push(`${e} - ${t}`):o.push(`>=${e}`):o.push("*");const l=o.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length<c.length?l:t};var bu={parse:yl,valid:Sl,clean:xl,inc:Ol,diff:bl,major:Ll,minor:Pl,patch:Vl,prerelease:Nl,compare:kl,rcompare:Rl,compareLoose:Fl,compareBuild:Wl,sort:$l,rsort:Hl,gt:zl,lt:Yl,eq:Jl,neq:Zl,gte:tc,lte:nc,cmp:uc,coerce:bc,Comparator:_c(),Range:Lc(),satisfies:Tc,toComparators:Ac,maxSatisfying:kc,minSatisfying:Bc,minVersion:Uc,validRange:jc,outside:eu,gtr:ru,ltr:iu,intersects:au,simplifyRange:Iu,subset:Su,SemVer:Cu,re:wu.re,src:wu.src,tokens:wu.t,SEMVER_SPEC_VERSION:xu.SEMVER_SPEC_VERSION,RELEASE_TYPES:xu.RELEASE_TYPES,compareIdentifiers:Ou.compareIdentifiers,rcompareIdentifiers:Ou.rcompareIdentifiers};var Eu=bu.satisfies(process.version,">=15.7.0");var Lu=bu.satisfies(process.version,">=16.9.0");const _u=Eu,Pu=Lu,Tu={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Vu={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var Au=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const n=Tu[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(_u)switch(r){case"ec":const r=t.asymmetricKeyDetails.namedCurve,n=Vu[e];if(r!==n)throw new Error(`"alg" parameter "${e}" requires curve "${n}".`);break;case"rsa-pss":if(Pu){const r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:i,saltLength:s}=t.asymmetricKeyDetails;if(n!==`sha${r}`||i!==n)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==s&&s>r>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}},Nu=bu.satisfies(process.version,"^6.12.0 || >=8.0.0");const Du=Mo,ku=Fo,Mu=Uo,Ru=Do,Bu=Jo,Fu=Au,Gu=Nu,Wu=pa,{KeyObject:Uu,createSecretKey:$u,createPublicKey:ju}=f.default,Hu=["RS256","RS384","RS512"],Xu=["ES256","ES384","ES512"],zu=["RS256","RS384","RS512"],Ku=["HS256","HS384","HS512"];Gu&&(Hu.splice(Hu.length,0,"PS256","PS384","PS512"),zu.splice(zu.length,0,"PS256","PS384","PS512"));var Yu=1/0,qu=9007199254740991,Ju=17976931348623157e292,Qu=NaN,Zu="[object Arguments]",ep="[object Function]",tp="[object GeneratorFunction]",rp="[object String]",np="[object Symbol]",ip=/^\s+|\s+$/g,sp=/^[-+]0x[0-9a-f]+$/i,ap=/^0b[01]+$/i,op=/^0o[0-7]+$/i,lp=/^(?:0|[1-9]\d*)$/,cp=parseInt;function up(e){return e!=e}function pp(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(t,(function(t){return e[t]}))}var fp,dp,mp=Object.prototype,hp=mp.hasOwnProperty,gp=mp.toString,yp=mp.propertyIsEnumerable,vp=(fp=Object.keys,dp=Object,function(e){return fp(dp(e))}),Sp=Math.max;function wp(e,t){var r=Op(e)||function(e){return function(e){return Ep(e)&&Ip(e)}(e)&&hp.call(e,"callee")&&(!yp.call(e,"callee")||gp.call(e)==Zu)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var s in e)!t&&!hp.call(e,s)||i&&("length"==s||Cp(s,n))||r.push(s);return r}function xp(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||mp,t!==n)return vp(e);var t,r,n,i=[];for(var s in Object(e))hp.call(e,s)&&"constructor"!=s&&i.push(s);return i}function Cp(e,t){return!!(t=null==t?qu:t)&&("number"==typeof e||lp.test(e))&&e>-1&&e%1==0&&e<t}var Op=Array.isArray;function Ip(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=qu}(e.length)&&!function(e){var t=bp(e)?gp.call(e):"";return t==ep||t==tp}(e)}function bp(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ep(e){return!!e&&"object"==typeof e}var Lp=function(e,t,r,n){var i;e=Ip(e)?e:(i=e)?pp(i,function(e){return Ip(e)?wp(e):xp(e)}(i)):[],r=r&&!n?function(e){var t=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||Ep(e)&&gp.call(e)==np}(e))return Qu;if(bp(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bp(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ip,"");var r=ap.test(e);return r||op.test(e)?cp(e.slice(2),r?2:8):sp.test(e)?Qu:+e}(e),e===Yu||e===-Yu){return(e<0?-1:1)*Ju}return e==e?e:0}(e),r=t%1;return t==t?r?t-r:t:0}(r):0;var s=e.length;return r<0&&(r=Sp(s+r,0)),function(e){return"string"==typeof e||!Op(e)&&Ep(e)&&gp.call(e)==rp}(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&function(e,t,r){if(t!=t)return function(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,up,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r)>-1},_p=Object.prototype.toString;var Pp=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==_p.call(e)},Tp=1/0,Vp=17976931348623157e292,Ap=NaN,Np="[object Symbol]",Dp=/^\s+|\s+$/g,kp=/^[-+]0x[0-9a-f]+$/i,Mp=/^0b[01]+$/i,Rp=/^0o[0-7]+$/i,Bp=parseInt,Fp=Object.prototype.toString;function Gp(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var Wp=function(e){return"number"==typeof e&&e==function(e){var t=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Fp.call(e)==Np}(e))return Ap;if(Gp(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gp(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Dp,"");var r=Mp.test(e);return r||Rp.test(e)?Bp(e.slice(2),r?2:8):kp.test(e)?Ap:+e}(e),e===Tp||e===-Tp){return(e<0?-1:1)*Vp}return e==e?e:0}(e),r=t%1;return t==t?r?t-r:t:0}(e)};Object.prototype.toString;var Up=Function.prototype,$p=Object.prototype,jp=Up.toString,Hp=$p.hasOwnProperty,Xp=jp.call(Object),zp=$p.toString,Kp=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var Yp=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=zp.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=Kp(e);if(null===t)return!0;var r=Hp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&jp.call(r)==Xp},qp=Object.prototype.toString,Jp=Array.isArray;var Qp=function(e){return"string"==typeof e||!Jp(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==qp.call(e)};parseInt,Object.prototype.toString;const Zp=Nu,ef=Lp,tf=Pp,rf=Wp,nf=Yp,sf=Qp,{KeyObject:af,createSecretKey:of,createPrivateKey:lf}=f.default,cf=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Zp&&cf.splice(3,0,"PS256","PS384","PS512");ef.bind(null,cf);var uf=Do,pf=function(e,t,r,n){let i;if("function"!=typeof r||n||(n=r,r={}),r||(r={}),r=Object.assign({},r),i=n||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return i(new Du("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return i(new Du("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return i(new Du("allowInvalidAsymmetricKeyTypes must be a boolean"));const s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Du("jwt must be provided"));if("string"!=typeof e)return i(new Du("jwt must be a string"));const a=e.split(".");if(3!==a.length)return i(new Du("jwt malformed"));let o;try{o=Ru(e,{complete:!0})}catch(e){return i(e)}if(!o)return i(new Du("invalid token"));const l=o.header;let c;if("function"==typeof t){if(!n)return i(new Du("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(e,r){return r(null,t)};return c(l,(function(t,n){if(t)return i(new Du("error in secret or public key callback: "+t.message));const c=""!==a[2].trim();if(!c&&n)return i(new Du("jwt signature is required"));if(c&&!n)return i(new Du("secret or public key must be provided"));if(!c&&!r.algorithms)return i(new Du('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=n&&!(n instanceof Uu))try{n=ju(n)}catch(e){try{n=$u("string"==typeof n?Buffer.from(n):n)}catch(e){return i(new Du("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===n.type?r.algorithms=Ku:["rsa","rsa-pss"].includes(n.asymmetricKeyType)?r.algorithms=zu:"ec"===n.asymmetricKeyType?r.algorithms=Xu:r.algorithms=Hu),-1===r.algorithms.indexOf(o.header.alg))return i(new Du("invalid algorithm"));if(l.alg.startsWith("HS")&&"secret"!==n.type)return i(new Du(`secretOrPublicKey must be a symmetric key when using ${l.alg}`));if(/^(?:RS|PS|ES)/.test(l.alg)&&"public"!==n.type)return i(new Du(`secretOrPublicKey must be an asymmetric key when using ${l.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Fu(l.alg,n)}catch(e){return i(e)}let u;try{u=Wu.verify(e,o.header.alg,n)}catch(e){return i(e)}if(!u)return i(new Du("invalid signature"));const p=o.payload;if(void 0!==p.nbf&&!r.ignoreNotBefore){if("number"!=typeof p.nbf)return i(new Du("invalid nbf value"));if(p.nbf>s+(r.clockTolerance||0))return i(new ku("jwt not active",new Date(1e3*p.nbf)))}if(void 0!==p.exp&&!r.ignoreExpiration){if("number"!=typeof p.exp)return i(new Du("invalid exp value"));if(s>=p.exp+(r.clockTolerance||0))return i(new Mu("jwt expired",new Date(1e3*p.exp)))}if(r.audience){const e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(p.aud)?p.aud:[p.aud]).some((function(t){return e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))})))return i(new Du("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer){if("string"==typeof r.issuer&&p.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(p.iss))return i(new Du("jwt issuer invalid. expected: "+r.issuer))}if(r.subject&&p.sub!==r.subject)return i(new Du("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&p.jti!==r.jwtid)return i(new Du("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&p.nonce!==r.nonce)return i(new Du("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof p.iat)return i(new Du("iat required when maxAge is specified"));const e=Bu(r.maxAge,p.iat);if(void 0===e)return i(new Du('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=e+(r.clockTolerance||0))return i(new Mu("maxAge exceeded",new Date(1e3*e)))}if(!0===r.complete){const e=o.signature;return i(null,{header:l,payload:p,signature:e})}return i(null,p)}))},ff=function(e){var t=d.createHash("md5").update(e).digest("hex");return"".concat(t.substring(0,8),"-").concat(t.substring(8,12),"-").concat(t.substring(12,16),"-").concat(t.substring(16,20),"-").concat(t.substring(20,32))},df=function(){var e=I(C().mark((function e(t){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=I(C().mark((function e(r,n){var i,s,a,o,l;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.baseboard();case 3:return i=e.sent,s="".concat(i.manufacturer,"-:-").concat(i.model,"-:-").concat(i.version,"-::-"),e.next=7,b.system();case 7:a=e.sent,o="".concat(a.serial,"-:-").concat(a.uuid),l=ff(s+o).toUpperCase(),r("NI-".concat(t||"APP","-").concat(l)),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),n();case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();e.decodeLicense=function(e,t){return new Promise((function(r,n){var i=uf(e,t||{});i?r(i):n(new Error("Cannot decode token"))}))},e.getNodeInfo=df,e.verifyLicense=function(e,t,r){return new Promise((function(n,i){if(e&&""!==e.trim())pf(t,r||"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA45UBf0Yjw8nGDZDFk9jG\nHPvxW0LO/2k395nnwg/DdrP0WOQOxmxG68Z19+Uk5ISEu441VnDpEcYluvzfGOkR\nbLgx3nAcB818obIoRVZ+Y3xvYrXjJOlzrss++jDMyfIEqMBusm21v3r3PDGa8VpL\nt3/OXL/m6gWt6PAFTs6P307e1oebI53XBod0oTRfcv9sAwX+DosMWoKyR65yKuVg\nTqe9EmjqzZggbwGNQFYv4vUGAg36tFE1BzFsaqQkiXNcDYh3w6OMC9ktrLVX7gJi\nWY4EHImAWEGVCe/1BXY5tJEub2xFL0cyUnoVihwzn/x5ktQ1Bb7B/9PqiMFx98Lx\noQIDAQAB\n-----END PUBLIC KEY-----",function(){var t=I(C().mark((function t(r,s){var a,o,l,c,u,p,f;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=4;break}i(r),t.next=21;break;case 4:if(!s.hasOwnProperty("nodeinfo")){t.next=20;break}if(a=s.application.name,o=s.libraries||[],l=o.map((function(e){return e.name.toLowerCase()})),(c=e.toLowerCase())!==a.toLocaleLowerCase()&&!l.includes(c)){t.next=16;break}return t.next=12,df(a);case 12:u=t.sent,s.nodeinfo===u?n(s):(p=new Error("Node info does not match"),i(p)),t.next=18;break;case 16:f=new Error("appOrLibName '".concat(e,"' not present in application.name or libraries")),i(f);case 18:t.next=21;break;case 20:n(s||{});case 21:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());else{var s=new Error("appOrLibName must be a non-empty string");i(s)}}))},Object.defineProperty(e,"__esModule",{value:!0})}));
3
+ !function(e,t){var r=w.default,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),s.prototype=Object.create(n.prototype),i(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(fa,fa.exports);var da=fa.exports.Buffer,ma=x.default;function ha(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=da.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=da.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}v.default.inherits(ha,ma),ha.prototype.write=function(e){this.buffer=da.concat([this.buffer,da.from(e)]),this.emit("data",e)},ha.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var ga=ha,ya=w.default.Buffer,va=w.default.SlowBuffer,Sa=wa;function wa(e,t){if(!ya.isBuffer(e)||!ya.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}wa.install=function(){ya.prototype.equal=va.prototype.equal=function(e){return wa(this,e)}};var xa=ya.prototype.equal,Ca=va.prototype.equal;function Oa(e){return(e/8|0)+(e%8==0?0:1)}wa.restore=function(){ya.prototype.equal=xa,va.prototype.equal=Ca};var Ia={ES256:Oa(256),ES384:Oa(384),ES512:Oa(521)};var ba=function(e){var t=Ia[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')},Ea=fa.exports.Buffer,La=ba,_a=128;function Pa(e){if(Ea.isBuffer(e))return e;if("string"==typeof e)return Ea.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Ta(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=_a&&--n,n}var Va={derToJose:function(e,t){e=Pa(e);var r=La(t),n=r+1,i=e.length,s=0;if(48!==e[s++])throw new Error('Could not find expected "seq"');var a=e[s++];if(a===(1|_a)&&(a=e[s++]),i-s<a)throw new Error('"seq" specified length of "'+a+'", only "'+(i-s)+'" remaining');if(2!==e[s++])throw new Error('Could not find expected "int" for "r"');var o=e[s++];if(i-s-2<o)throw new Error('"r" specified length of "'+o+'", only "'+(i-s-2)+'" available');if(n<o)throw new Error('"r" specified length of "'+o+'", max of "'+n+'" is acceptable');var l=s;if(s+=o,2!==e[s++])throw new Error('Could not find expected "int" for "s"');var c=e[s++];if(i-s!==c)throw new Error('"s" specified length of "'+c+'", expected "'+(i-s)+'"');if(n<c)throw new Error('"s" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if((s+=c)!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var p=r-o,f=r-c,d=Ea.allocUnsafe(p+o+f+c);for(s=0;s<p;++s)d[s]=0;e.copy(d,s,l+Math.max(-p,0),l+o);for(var m=s=r;s<m+f;++s)d[s]=0;return e.copy(d,s,u+Math.max(-f,0),u+c),d=(d=d.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=Pa(e);var r=La(t),n=e.length;if(n!==2*r)throw new TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var i=Ta(e,0,r),s=Ta(e,r,e.length),a=r-i,o=r-s,l=2+a+1+1+o,c=l<_a,u=Ea.allocUnsafe((c?2:3)+l),p=0;return u[p++]=48,c?u[p++]=l:(u[p++]=1|_a,u[p++]=255&l),u[p++]=2,u[p++]=a,i<0?(u[p++]=0,p+=e.copy(u,p,0,r)):p+=e.copy(u,p,i,r),u[p++]=2,u[p++]=o,s<0?(u[p++]=0,e.copy(u,p,r)):e.copy(u,p,r+s),u}},Aa=Sa,Na=fa.exports.Buffer,Da=f.default,ka=Va,Ma=v.default,Ra="secret must be a string or buffer",Ba="key must be a string or a buffer",Fa="key must be a string, a buffer or an object",Ga="function"==typeof Da.createPublicKey;function Wa(e){if(!Na.isBuffer(e)&&"string"!=typeof e){if(!Ga)throw Ha(Ba);if("object"!=typeof e)throw Ha(Ba);if("string"!=typeof e.type)throw Ha(Ba);if("string"!=typeof e.asymmetricKeyType)throw Ha(Ba);if("function"!=typeof e.export)throw Ha(Ba)}}function Ua(e){if(!Na.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw Ha(Fa)}function $a(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ja(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Ha(e){var t=[].slice.call(arguments,1),r=Ma.format.bind(Ma,e).apply(null,t);return new TypeError(r)}function Xa(e){var t;return t=e,Na.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function za(e){return function(t,r){!function(e){if(!Na.isBuffer(e)){if("string"==typeof e)return e;if(!Ga)throw Ha(Ra);if("object"!=typeof e)throw Ha(Ra);if("secret"!==e.type)throw Ha(Ra);if("function"!=typeof e.export)throw Ha(Ra)}}(r),t=Xa(t);var n=Da.createHmac("sha"+e,r);return $a((n.update(t),n.digest("base64")))}}function Ka(e){return function(t,r,n){var i=za(e)(t,n);return Aa(Na.from(r),Na.from(i))}}function Ya(e){return function(t,r){Ua(r),t=Xa(t);var n=Da.createSign("RSA-SHA"+e);return $a((n.update(t),n.sign(r,"base64")))}}function qa(e){return function(t,r,n){Wa(n),t=Xa(t),r=ja(r);var i=Da.createVerify("RSA-SHA"+e);return i.update(t),i.verify(n,r,"base64")}}function Ja(e){return function(t,r){Ua(r),t=Xa(t);var n=Da.createSign("RSA-SHA"+e);return $a((n.update(t),n.sign({key:r,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function Qa(e){return function(t,r,n){Wa(n),t=Xa(t),r=ja(r);var i=Da.createVerify("RSA-SHA"+e);return i.update(t),i.verify({key:n,padding:Da.constants.RSA_PKCS1_PSS_PADDING,saltLength:Da.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function Za(e){var t=Ya(e);return function(){var r=t.apply(null,arguments);return r=ka.derToJose(r,"ES"+e)}}function eo(e){var t=qa(e);return function(r,n,i){return n=ka.joseToDer(n,"ES"+e).toString("base64"),t(r,n,i)}}function to(){return function(){return""}}function ro(){return function(e,t){return""===t}}Ga&&(Ba+=" or a KeyObject",Ra+="or a KeyObject");var no=function(e){var t={hs:za,rs:Ya,ps:Ja,es:Za,none:to},r={hs:Ka,rs:qa,ps:Qa,es:eo,none:ro},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!n)throw Ha('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var i=(n[1]||n[3]).toLowerCase(),s=n[2];return{sign:t[i](s),verify:r[i](s)}},io=w.default.Buffer,so=function(e){return"string"==typeof e?e:"number"==typeof e||io.isBuffer(e)?e.toString():JSON.stringify(e)},ao=fa.exports.Buffer,oo=ga,lo=no,co=x.default,uo=so,po=v.default;function fo(e,t){return ao.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mo(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,s=lo(t.alg),a=function(e,t,r){r=r||"utf8";var n=fo(uo(e),"binary"),i=fo(uo(t),r);return po.format("%s.%s",n,i)}(t,r,i),o=s.sign(a,n);return po.format("%s.%s",a,o)}function ho(e){var t=e.secret||e.privateKey||e.key,r=new oo(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new oo(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}po.inherits(ho,co),ho.prototype.sign=function(){try{var e=mo({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},ho.sign=mo;var go=ho,yo=fa.exports.Buffer,vo=ga,So=no,wo=x.default,xo=so,Co=v.default,Oo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Io(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}function bo(e){var t=e.split(".",1)[0];return Io(yo.from(t,"base64").toString("binary"))}function Eo(e){return e.split(".")[2]}function Lo(e){return Oo.test(e)&&!!bo(e)}function _o(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var i=Eo(e=xo(e)),s=function(e){return e.split(".",2).join(".")}(e);return So(t).verify(s,i,r)}function Po(e,t){if(t=t||{},!Lo(e=xo(e)))return null;var r=bo(e);if(!r)return null;var n=function(e,t){t=t||"utf8";var r=e.split(".")[1];return yo.from(r,"base64").toString(t)}(e);return("JWT"===r.typ||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:Eo(e)}}function To(e){var t=(e=e||{}).secret||e.publicKey||e.key,r=new vo(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new vo(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}Co.inherits(To,wo),To.prototype.verify=function(){try{var e=_o(this.signature.buffer,this.algorithm,this.key.buffer),t=Po(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},To.decode=Po,To.isValid=Lo,To.verify=_o;var Vo=go,Ao=To;pa.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],pa.sign=Vo.sign,pa.verify=Ao.verify,pa.decode=Ao.decode,pa.isValid=Ao.isValid,pa.createSign=function(e){return new Vo(e)},pa.createVerify=function(e){return new Ao(e)};var No=pa,Do=function(e,t){t=t||{};var r=No.decode(e,t);if(!r)return null;var n=r.payload;if("string"==typeof n)try{var i=JSON.parse(n);null!==i&&"object"==typeof i&&(n=i)}catch(e){}return!0===t.complete?{header:r.header,payload:n,signature:r.signature}:n},ko=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};(ko.prototype=Object.create(Error.prototype)).constructor=ko;var Mo=ko,Ro=Mo,Bo=function(e,t){Ro.call(this,e),this.name="NotBeforeError",this.date=t};(Bo.prototype=Object.create(Ro.prototype)).constructor=Bo;var Fo=Bo,Go=Mo,Wo=function(e,t){Go.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};(Wo.prototype=Object.create(Go.prototype)).constructor=Wo;var Uo=Wo,$o=1e3,jo=60*$o,Ho=60*jo,Xo=24*Ho,zo=7*Xo,Ko=365.25*Xo;function Yo(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}var qo=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*Ko;case"weeks":case"week":case"w":return r*zo;case"days":case"day":case"d":return r*Xo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ho;case"minutes":case"minute":case"mins":case"min":case"m":return r*jo;case"seconds":case"second":case"secs":case"sec":case"s":return r*$o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=Xo)return Yo(e,t,Xo,"day");if(t>=Ho)return Yo(e,t,Ho,"hour");if(t>=jo)return Yo(e,t,jo,"minute");if(t>=$o)return Yo(e,t,$o,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=Xo)return Math.round(e/Xo)+"d";if(t>=Ho)return Math.round(e/Ho)+"h";if(t>=jo)return Math.round(e/jo)+"m";if(t>=$o)return Math.round(e/$o)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Jo=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var n=qo(e);if(void 0===n)return;return Math.floor(r+n/1e3)}return"number"==typeof e?r+e:void 0},Qo={exports:{}};var Zo={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var el="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Zo,s=el,a=(t=e.exports={}).re=[],o=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[p,n]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=u++;s(e,i,t),c[e]=i,l[i]=t,a[i]=new RegExp(t,r?"g":void 0),o[i]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),d("FULL",`^${l[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),d("LOOSE",`^${l[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),d("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),d("COERCERTL",l[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Qo,Qo.exports);const tl=Object.freeze({loose:!0}),rl=Object.freeze({});var nl=e=>e?"object"!=typeof e?tl:e:rl;const il=/^[0-9]+$/,sl=(e,t)=>{const r=il.test(e),n=il.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var al={compareIdentifiers:sl,rcompareIdentifiers:(e,t)=>sl(t,e)};const ol=el,{MAX_LENGTH:ll,MAX_SAFE_INTEGER:cl}=Zo,{safeRe:ul,t:pl}=Qo.exports,fl=nl,{compareIdentifiers:dl}=al;class ml{constructor(e,t){if(t=fl(t),e instanceof ml){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ll)throw new TypeError(`version is longer than ${ll} characters`);ol("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?ul[pl.LOOSE]:ul[pl.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>cl||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cl||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cl||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<cl)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ol("SemVer.compare",this.version,this.options,e),!(e instanceof ml)){if("string"==typeof e&&e===this.version)return 0;e=new ml(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ml||(e=new ml(e,this.options)),dl(this.major,e.major)||dl(this.minor,e.minor)||dl(this.patch,e.patch)}comparePre(e){if(e instanceof ml||(e=new ml(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(ol("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return dl(r,n)}while(++t)}compareBuild(e){e instanceof ml||(e=new ml(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(ol("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return dl(r,n)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===dl(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var hl=ml;const gl=hl;var yl=(e,t,r=!1)=>{if(e instanceof gl)return e;try{return new gl(e,t)}catch(e){if(!r)return null;throw e}};const vl=yl;var Sl=(e,t)=>{const r=vl(e,t);return r?r.version:null};const wl=yl;var xl=(e,t)=>{const r=wl(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const Cl=hl;var Ol=(e,t,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new Cl(e instanceof Cl?e.version:e,r).inc(t,n,i).version}catch(e){return null}};const Il=yl;var bl=(e,t)=>{const r=Il(e,null,!0),n=Il(t,null,!0),i=r.compare(n);if(0===i)return null;const s=i>0,a=s?r:n,o=s?n:r,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l)return o.patch||o.minor?a.patch?"patch":a.minor?"minor":"major":"major";const c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};const El=hl;var Ll=(e,t)=>new El(e,t).major;const _l=hl;var Pl=(e,t)=>new _l(e,t).minor;const Tl=hl;var Vl=(e,t)=>new Tl(e,t).patch;const Al=yl;var Nl=(e,t)=>{const r=Al(e,t);return r&&r.prerelease.length?r.prerelease:null};const Dl=hl;var kl=(e,t,r)=>new Dl(e,r).compare(new Dl(t,r));const Ml=kl;var Rl=(e,t,r)=>Ml(t,e,r);const Bl=kl;var Fl=(e,t)=>Bl(e,t,!0);const Gl=hl;var Wl=(e,t,r)=>{const n=new Gl(e,r),i=new Gl(t,r);return n.compare(i)||n.compareBuild(i)};const Ul=Wl;var $l=(e,t)=>e.sort(((e,r)=>Ul(e,r,t)));const jl=Wl;var Hl=(e,t)=>e.sort(((e,r)=>jl(r,e,t)));const Xl=kl;var zl=(e,t,r)=>Xl(e,t,r)>0;const Kl=kl;var Yl=(e,t,r)=>Kl(e,t,r)<0;const ql=kl;var Jl=(e,t,r)=>0===ql(e,t,r);const Ql=kl;var Zl=(e,t,r)=>0!==Ql(e,t,r);const ec=kl;var tc=(e,t,r)=>ec(e,t,r)>=0;const rc=kl;var nc=(e,t,r)=>rc(e,t,r)<=0;const ic=Jl,sc=Zl,ac=zl,oc=tc,lc=Yl,cc=nc;var uc=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return ic(e,r,n);case"!=":return sc(e,r,n);case">":return ac(e,r,n);case">=":return oc(e,r,n);case"<":return lc(e,r,n);case"<=":return cc(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const pc=hl,fc=yl,{safeRe:dc,t:mc}=Qo.exports;var hc,gc,yc,vc,Sc,wc,xc,Cc,Oc,Ic,bc=(e,t)=>{if(e instanceof pc)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=dc[mc.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),dc[mc.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;dc[mc.COERCERTL].lastIndex=-1}else r=e.match(dc[mc.COERCE]);return null===r?null:fc(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function Ec(){if(vc)return yc;function e(t){var r=this;if(r instanceof e||(r=new e),r.tail=null,r.head=null,r.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){r.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)r.push(arguments[n]);return r}function t(e,t,r){var n=t===e.head?new i(r,null,t,e):new i(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function r(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function n(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,r,n){if(!(this instanceof i))return new i(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}vc=1,yc=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},e.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},e.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},e.prototype.map=function(t,r){r=r||this;for(var n=new e,i=this.head;null!==i;)n.push(t.call(r,i.value,this)),i=i.next;return n},e.prototype.mapReverse=function(t,r){r=r||this;for(var n=new e,i=this.tail;null!==i;)n.push(t.call(r,i.value,this)),i=i.prev;return n},e.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},e.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},e.prototype.slice=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var i=0,s=this.head;null!==s&&i<t;i++)s=s.next;for(;null!==s&&i<r;i++,s=s.next)n.push(s.value);return n},e.prototype.sliceReverse=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var n=new e;if(r<t||r<0)return n;t<0&&(t=0),r>this.length&&(r=this.length);for(var i=this.length,s=this.tail;null!==s&&i>r;i--)s=s.prev;for(;null!==s&&i>t;i--,s=s.prev)n.push(s.value);return n},e.prototype.splice=function(e,r,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;var a=[];for(i=0;s&&i<r;i++)a.push(s.value),s=this.removeNode(s);null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(i=0;i<n.length;i++)s=t(this,s,n[i]);return a},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{(gc?hc:(gc=1,hc=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return yc}function Lc(){if(Cc)return xc;Cc=1;class e{constructor(t,r){if(r=n(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&h(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,n=r.get(t);if(n)return n;const a=this.options.loose,h=a?o[l.HYPHENRANGELOOSE]:o[l.HYPHENRANGE];e=e.replace(h,L(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(o[l.COMPARATORTRIM],c),s("comparator trim",e),e=e.replace(o[l.TILDETRIM],u),s("tilde trim",e),e=e.replace(o[l.CARETTRIM],p),s("caret trim",e);let g=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));a&&(g=g.filter((e=>(s("loose invalid filter",e,this.options),!!e.match(o[l.COMPARATORLOOSE]))))),s("range list",g);const v=new Map,S=g.map((e=>new i(e,this.options)));for(const e of S){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return r.set(t,w),w}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,r)&&t.set.some((t=>g(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(_(this.set[t],e,this.options))return!0;return!1}}xc=e;const t=function(){if(wc)return Sc;wc=1;const e=Ec(),t=Symbol("max"),r=Symbol("length"),n=Symbol("lengthCalculator"),i=Symbol("allowStale"),s=Symbol("maxAge"),a=Symbol("dispose"),o=Symbol("noDisposeOnSet"),l=Symbol("lruList"),c=Symbol("cache"),u=Symbol("updateAgeOnGet"),p=()=>1,f=(e,t,r)=>{const n=e[c].get(t);if(n){const t=n.value;if(d(e,t)){if(h(e,n),!e[i])return}else r&&(e[u]&&(n.value.now=Date.now()),e[l].unshiftNode(n));return t.value}},d=(e,t)=>{if(!t||!t.maxAge&&!e[s])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[s]&&r>e[s]},m=e=>{if(e[r]>e[t])for(let n=e[l].tail;e[r]>e[t]&&null!==n;){const t=n.prev;h(e,n),n=t}},h=(e,t)=>{if(t){const n=t.value;e[a]&&e[a](n.key,n.value),e[r]-=n.length,e[c].delete(n.key),e[l].removeNode(t)}};class g{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const y=(e,t,r,n)=>{let s=r.value;d(e,s)&&(h(e,r),e[i]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};return Sc=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const r=e.length||p;if(this[n]="function"!=typeof r?p:r,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[s]=e.maxAge||0,this[a]=e.dispose,this[o]=e.noDisposeOnSet||!1,this[u]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,m(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[s]=e,m(this)}get maxAge(){return this[s]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[n]&&(this[n]=e,this[r]=0,this[l].forEach((e=>{e.length=this[n](e.value,e.key),this[r]+=e.length}))),m(this)}get lengthCalculator(){return this[n]}get length(){return this[r]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let r=this[l].tail;null!==r;){const n=r.prev;y(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[l].head;null!==r;){const n=r.next;y(this,e,r,t),r=n}}keys(){return this[l].toArray().map((e=>e.key))}values(){return this[l].toArray().map((e=>e.value))}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach((e=>this[a](e.key,e.value))),this[c]=new Map,this[l]=new e,this[r]=0}dump(){return this[l].map((e=>!d(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[l]}set(e,i,u){if((u=u||this[s])&&"number"!=typeof u)throw new TypeError("maxAge must be a number");const p=u?Date.now():0,f=this[n](i,e);if(this[c].has(e)){if(f>this[t])return h(this,this[c].get(e)),!1;const n=this[c].get(e).value;return this[a]&&(this[o]||this[a](e,n.value)),n.now=p,n.maxAge=u,n.value=i,this[r]+=f-n.length,n.length=f,this.get(e),m(this),!0}const d=new g(e,i,f,p,u);return d.length>this[t]?(this[a]&&this[a](e,i),!1):(this[r]+=d.length,this[l].unshift(d),this[c].set(e,this[l].head),m(this),!0)}has(e){if(!this[c].has(e))return!1;const t=this[c].get(e).value;return!d(this,t)}get(e){return f(this,e,!0)}peek(e){return f(this,e,!1)}pop(){const e=this[l].tail;return e?(h(this,e),e.value):null}del(e){h(this,this[c].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[c].forEach(((e,t)=>f(this,t,!1)))}},Sc}(),r=new t({max:1e3}),n=nl,i=_c(),s=el,a=hl,{safeRe:o,t:l,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:p}=Qo.exports,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=Zo,m=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},y=(e,t)=>(s("comp",e,t),e=x(e,t),s("caret",e),e=S(e,t),s("tildes",e),e=O(e,t),s("xrange",e),e=b(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?o[l.TILDELOOSE]:o[l.TILDE];return e.replace(r,((t,r,n,i,a)=>{let o;return s("tilde",e,t,r,n,i,a),v(r)?o="":v(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:a?(s("replaceTilde pr",a),o=`>=${r}.${n}.${i}-${a} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",o),o}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{s("caret",e,t);const r=t.loose?o[l.CARETLOOSE]:o[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,a,o)=>{let l;return s("caret",e,t,r,i,a,o),v(r)?l="":v(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(a)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(s("replaceCaret pr",o),l="0"===r?"0"===i?`>=${r}.${i}.${a}-${o} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a}-${o} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${a}${n} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a} <${+r+1}.0.0-0`),s("caret return",l),l}))},O=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?o[l.XRANGELOOSE]:o[l.XRANGE];return e.replace(r,((r,n,i,a,o,l)=>{s("xRange",e,r,n,i,a,o,l);const c=v(i),u=c||v(a),p=u||v(o),f=p;return"="===n&&f&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(a=0),o=0,">"===n?(n=">=",u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===n&&(n="<",u?i=+i+1:a=+a+1),"<"===n&&(l="-0"),r=`${n+i}.${a}.${o}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${a}.0${l} <${i}.${+a+1}.0-0`),s("xRange return",r),r}))},b=(e,t)=>(s("replaceStars",e,t),e.trim().replace(o[l.STAR],"")),E=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(o[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),L=e=>(t,r,n,i,s,a,o,l,c,u,p,f,d)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${e?"-0":""}`:v(s)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=v(c)?"":v(u)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${p}-${f}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),_=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return xc}function _c(){if(Ic)return Oc;Ic=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){if(i=r(i),n instanceof t){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),a("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new o(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new o(t,this.options)}catch(e){return!1}return s(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,n).test(this.value):""===e.operator?""===e.value||new l(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(s(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(s(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Oc=t;const r=nl,{safeRe:n,t:i}=Qo.exports,s=uc,a=el,o=hl,l=Lc();return Oc}const Pc=Lc();var Tc=(e,t,r)=>{try{t=new Pc(t,r)}catch(e){return!1}return t.test(e)};const Vc=Lc();var Ac=(e,t)=>new Vc(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Nc=hl,Dc=Lc();var kc=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Dc(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new Nc(n,r)))})),n};const Mc=hl,Rc=Lc();var Bc=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Rc(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new Mc(n,r)))})),n};const Fc=hl,Gc=Lc(),Wc=zl;var Uc=(e,t)=>{e=new Gc(e,t);let r=new Fc("0.0.0");if(e.test(r))return r;if(r=new Fc("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let i=null;n.forEach((e=>{const t=new Fc(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Wc(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!Wc(r,i)||(r=i)}return r&&e.test(r)?r:null};const $c=Lc();var jc=(e,t)=>{try{return new $c(e,t).range||"*"}catch(e){return null}};const Hc=hl,Xc=_c(),{ANY:zc}=Xc,Kc=Lc(),Yc=Tc,qc=zl,Jc=Yl,Qc=nc,Zc=tc;var eu=(e,t,r,n)=>{let i,s,a,o,l;switch(e=new Hc(e,n),t=new Kc(t,n),r){case">":i=qc,s=Qc,a=Jc,o=">",l=">=";break;case"<":i=Jc,s=Zc,a=qc,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Yc(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const c=t.set[r];let u=null,p=null;if(c.forEach((e=>{e.semver===zc&&(e=new Xc(">=0.0.0")),u=u||e,p=p||e,i(e.semver,u.semver,n)?u=e:a(e.semver,p.semver,n)&&(p=e)})),u.operator===o||u.operator===l)return!1;if((!p.operator||p.operator===o)&&s(e,p.semver))return!1;if(p.operator===l&&a(e,p.semver))return!1}return!0};const tu=eu;var ru=(e,t,r)=>tu(e,t,">",r);const nu=eu;var iu=(e,t,r)=>nu(e,t,"<",r);const su=Lc();var au=(e,t,r)=>(e=new su(e,r),t=new su(t,r),e.intersects(t,r));const ou=Tc,lu=kl;const cu=Lc(),uu=_c(),{ANY:pu}=uu,fu=Tc,du=kl,mu=[new uu(">=0.0.0-0")],hu=[new uu(">=0.0.0")],gu=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===pu){if(1===t.length&&t[0].semver===pu)return!0;e=r.includePrerelease?mu:hu}if(1===t.length&&t[0].semver===pu){if(r.includePrerelease)return!0;t=hu}const n=new Set;let i,s,a,o,l,c,u;for(const t of e)">"===t.operator||">="===t.operator?i=yu(i,t,r):"<"===t.operator||"<="===t.operator?s=vu(s,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&s){if(a=du(i.semver,s.semver,r),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==s.operator))return null}for(const e of n){if(i&&!fu(e,String(i),r))return null;if(s&&!fu(e,String(s),r))return null;for(const n of t)if(!fu(e,String(n),r))return!1;return!0}let p=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver,f=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;p&&1===p.prerelease.length&&"<"===s.operator&&0===p.prerelease[0]&&(p=!1);for(const e of t){if(u=u||">"===e.operator||">="===e.operator,c=c||"<"===e.operator||"<="===e.operator,i)if(f&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===f.major&&e.semver.minor===f.minor&&e.semver.patch===f.patch&&(f=!1),">"===e.operator||">="===e.operator){if(o=yu(i,e,r),o===e&&o!==i)return!1}else if(">="===i.operator&&!fu(i.semver,String(e),r))return!1;if(s)if(p&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===p.major&&e.semver.minor===p.minor&&e.semver.patch===p.patch&&(p=!1),"<"===e.operator||"<="===e.operator){if(l=vu(s,e,r),l===e&&l!==s)return!1}else if("<="===s.operator&&!fu(s.semver,String(e),r))return!1;if(!e.operator&&(s||i)&&0!==a)return!1}return!(i&&c&&!s&&0!==a)&&(!(s&&u&&!i&&0!==a)&&(!f&&!p))},yu=(e,t,r)=>{if(!e)return t;const n=du(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},vu=(e,t,r)=>{if(!e)return t;const n=du(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var Su=(e,t,r={})=>{if(e===t)return!0;e=new cu(e,r),t=new cu(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=gu(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0};const wu=Qo.exports,xu=Zo,Cu=hl,Ou=al,Iu=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort(((e,t)=>lu(e,t,r)));for(const e of a){ou(e,t,r)?(s=e,i||(i=e)):(s&&n.push([i,s]),s=null,i=null)}i&&n.push([i,null]);const o=[];for(const[e,t]of n)e===t?o.push(e):t||e!==a[0]?t?e===a[0]?o.push(`<=${t}`):o.push(`${e} - ${t}`):o.push(`>=${e}`):o.push("*");const l=o.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length<c.length?l:t};var bu={parse:yl,valid:Sl,clean:xl,inc:Ol,diff:bl,major:Ll,minor:Pl,patch:Vl,prerelease:Nl,compare:kl,rcompare:Rl,compareLoose:Fl,compareBuild:Wl,sort:$l,rsort:Hl,gt:zl,lt:Yl,eq:Jl,neq:Zl,gte:tc,lte:nc,cmp:uc,coerce:bc,Comparator:_c(),Range:Lc(),satisfies:Tc,toComparators:Ac,maxSatisfying:kc,minSatisfying:Bc,minVersion:Uc,validRange:jc,outside:eu,gtr:ru,ltr:iu,intersects:au,simplifyRange:Iu,subset:Su,SemVer:Cu,re:wu.re,src:wu.src,tokens:wu.t,SEMVER_SPEC_VERSION:xu.SEMVER_SPEC_VERSION,RELEASE_TYPES:xu.RELEASE_TYPES,compareIdentifiers:Ou.compareIdentifiers,rcompareIdentifiers:Ou.rcompareIdentifiers};var Eu=bu.satisfies(process.version,">=15.7.0");var Lu=bu.satisfies(process.version,">=16.9.0");const _u=Eu,Pu=Lu,Tu={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Vu={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var Au=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const n=Tu[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(_u)switch(r){case"ec":const r=t.asymmetricKeyDetails.namedCurve,n=Vu[e];if(r!==n)throw new Error(`"alg" parameter "${e}" requires curve "${n}".`);break;case"rsa-pss":if(Pu){const r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:i,saltLength:s}=t.asymmetricKeyDetails;if(n!==`sha${r}`||i!==n)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==s&&s>r>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}},Nu=bu.satisfies(process.version,"^6.12.0 || >=8.0.0");const Du=Mo,ku=Fo,Mu=Uo,Ru=Do,Bu=Jo,Fu=Au,Gu=Nu,Wu=pa,{KeyObject:Uu,createSecretKey:$u,createPublicKey:ju}=f.default,Hu=["RS256","RS384","RS512"],Xu=["ES256","ES384","ES512"],zu=["RS256","RS384","RS512"],Ku=["HS256","HS384","HS512"];Gu&&(Hu.splice(Hu.length,0,"PS256","PS384","PS512"),zu.splice(zu.length,0,"PS256","PS384","PS512"));var Yu=1/0,qu=9007199254740991,Ju=17976931348623157e292,Qu=NaN,Zu="[object Arguments]",ep="[object Function]",tp="[object GeneratorFunction]",rp="[object String]",np="[object Symbol]",ip=/^\s+|\s+$/g,sp=/^[-+]0x[0-9a-f]+$/i,ap=/^0b[01]+$/i,op=/^0o[0-7]+$/i,lp=/^(?:0|[1-9]\d*)$/,cp=parseInt;function up(e){return e!=e}function pp(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}(t,(function(t){return e[t]}))}var fp,dp,mp=Object.prototype,hp=mp.hasOwnProperty,gp=mp.toString,yp=mp.propertyIsEnumerable,vp=(fp=Object.keys,dp=Object,function(e){return fp(dp(e))}),Sp=Math.max;function wp(e,t){var r=Op(e)||function(e){return function(e){return Ep(e)&&Ip(e)}(e)&&hp.call(e,"callee")&&(!yp.call(e,"callee")||gp.call(e)==Zu)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var s in e)!t&&!hp.call(e,s)||i&&("length"==s||Cp(s,n))||r.push(s);return r}function xp(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||mp,t!==n)return vp(e);var t,r,n,i=[];for(var s in Object(e))hp.call(e,s)&&"constructor"!=s&&i.push(s);return i}function Cp(e,t){return!!(t=null==t?qu:t)&&("number"==typeof e||lp.test(e))&&e>-1&&e%1==0&&e<t}var Op=Array.isArray;function Ip(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=qu}(e.length)&&!function(e){var t=bp(e)?gp.call(e):"";return t==ep||t==tp}(e)}function bp(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ep(e){return!!e&&"object"==typeof e}var Lp=function(e,t,r,n){var i;e=Ip(e)?e:(i=e)?pp(i,function(e){return Ip(e)?wp(e):xp(e)}(i)):[],r=r&&!n?function(e){var t=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||Ep(e)&&gp.call(e)==np}(e))return Qu;if(bp(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bp(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ip,"");var r=ap.test(e);return r||op.test(e)?cp(e.slice(2),r?2:8):sp.test(e)?Qu:+e}(e),e===Yu||e===-Yu){return(e<0?-1:1)*Ju}return e==e?e:0}(e),r=t%1;return t==t?r?t-r:t:0}(r):0;var s=e.length;return r<0&&(r=Sp(s+r,0)),function(e){return"string"==typeof e||!Op(e)&&Ep(e)&&gp.call(e)==rp}(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&function(e,t,r){if(t!=t)return function(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}(e,up,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r)>-1},_p=Object.prototype.toString;var Pp=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==_p.call(e)},Tp=1/0,Vp=17976931348623157e292,Ap=NaN,Np="[object Symbol]",Dp=/^\s+|\s+$/g,kp=/^[-+]0x[0-9a-f]+$/i,Mp=/^0b[01]+$/i,Rp=/^0o[0-7]+$/i,Bp=parseInt,Fp=Object.prototype.toString;function Gp(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var Wp=function(e){return"number"==typeof e&&e==function(e){var t=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Fp.call(e)==Np}(e))return Ap;if(Gp(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gp(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Dp,"");var r=Mp.test(e);return r||Rp.test(e)?Bp(e.slice(2),r?2:8):kp.test(e)?Ap:+e}(e),e===Tp||e===-Tp){return(e<0?-1:1)*Vp}return e==e?e:0}(e),r=t%1;return t==t?r?t-r:t:0}(e)};Object.prototype.toString;var Up=Function.prototype,$p=Object.prototype,jp=Up.toString,Hp=$p.hasOwnProperty,Xp=jp.call(Object),zp=$p.toString,Kp=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var Yp=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=zp.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=Kp(e);if(null===t)return!0;var r=Hp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&jp.call(r)==Xp},qp=Object.prototype.toString,Jp=Array.isArray;var Qp=function(e){return"string"==typeof e||!Jp(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==qp.call(e)};parseInt,Object.prototype.toString;const Zp=Nu,ef=Lp,tf=Pp,rf=Wp,nf=Yp,sf=Qp,{KeyObject:af,createSecretKey:of,createPrivateKey:lf}=f.default,cf=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Zp&&cf.splice(3,0,"PS256","PS384","PS512");ef.bind(null,cf);var uf=Do,pf=function(e,t,r,n){let i;if("function"!=typeof r||n||(n=r,r={}),r||(r={}),r=Object.assign({},r),i=n||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return i(new Du("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return i(new Du("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return i(new Du("allowInvalidAsymmetricKeyTypes must be a boolean"));const s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Du("jwt must be provided"));if("string"!=typeof e)return i(new Du("jwt must be a string"));const a=e.split(".");if(3!==a.length)return i(new Du("jwt malformed"));let o;try{o=Ru(e,{complete:!0})}catch(e){return i(e)}if(!o)return i(new Du("invalid token"));const l=o.header;let c;if("function"==typeof t){if(!n)return i(new Du("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(e,r){return r(null,t)};return c(l,(function(t,n){if(t)return i(new Du("error in secret or public key callback: "+t.message));const c=""!==a[2].trim();if(!c&&n)return i(new Du("jwt signature is required"));if(c&&!n)return i(new Du("secret or public key must be provided"));if(!c&&!r.algorithms)return i(new Du('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=n&&!(n instanceof Uu))try{n=ju(n)}catch(e){try{n=$u("string"==typeof n?Buffer.from(n):n)}catch(e){return i(new Du("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===n.type?r.algorithms=Ku:["rsa","rsa-pss"].includes(n.asymmetricKeyType)?r.algorithms=zu:"ec"===n.asymmetricKeyType?r.algorithms=Xu:r.algorithms=Hu),-1===r.algorithms.indexOf(o.header.alg))return i(new Du("invalid algorithm"));if(l.alg.startsWith("HS")&&"secret"!==n.type)return i(new Du(`secretOrPublicKey must be a symmetric key when using ${l.alg}`));if(/^(?:RS|PS|ES)/.test(l.alg)&&"public"!==n.type)return i(new Du(`secretOrPublicKey must be an asymmetric key when using ${l.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Fu(l.alg,n)}catch(e){return i(e)}let u;try{u=Wu.verify(e,o.header.alg,n)}catch(e){return i(e)}if(!u)return i(new Du("invalid signature"));const p=o.payload;if(void 0!==p.nbf&&!r.ignoreNotBefore){if("number"!=typeof p.nbf)return i(new Du("invalid nbf value"));if(p.nbf>s+(r.clockTolerance||0))return i(new ku("jwt not active",new Date(1e3*p.nbf)))}if(void 0!==p.exp&&!r.ignoreExpiration){if("number"!=typeof p.exp)return i(new Du("invalid exp value"));if(s>=p.exp+(r.clockTolerance||0))return i(new Mu("jwt expired",new Date(1e3*p.exp)))}if(r.audience){const e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(p.aud)?p.aud:[p.aud]).some((function(t){return e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))})))return i(new Du("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer){if("string"==typeof r.issuer&&p.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(p.iss))return i(new Du("jwt issuer invalid. expected: "+r.issuer))}if(r.subject&&p.sub!==r.subject)return i(new Du("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&p.jti!==r.jwtid)return i(new Du("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&p.nonce!==r.nonce)return i(new Du("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof p.iat)return i(new Du("iat required when maxAge is specified"));const e=Bu(r.maxAge,p.iat);if(void 0===e)return i(new Du('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=e+(r.clockTolerance||0))return i(new Mu("maxAge exceeded",new Date(1e3*e)))}if(!0===r.complete){const e=o.signature;return i(null,{header:l,payload:p,signature:e})}return i(null,p)}))},ff=function(e){var t=d.createHash("md5").update(e).digest("hex");return"".concat(t.substring(0,8),"-").concat(t.substring(8,12),"-").concat(t.substring(12,16),"-").concat(t.substring(16,20),"-").concat(t.substring(20,32))},df=function(){var e=I(C().mark((function e(t){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=I(C().mark((function e(r,n){var i,s,a,o,l;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b.baseboard();case 3:return i=e.sent,s="".concat(i.manufacturer,"-:-").concat(i.model,"-:-").concat(i.version,"-::-"),e.next=7,b.system();case 7:a=e.sent,o="".concat(a.serial,"-:-").concat(a.uuid),l=ff(s+o).toUpperCase(),r("NI-".concat(t||"APP","-").concat(l)),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),n();case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();e.decodeLicense=function(e,t){return new Promise((function(r,n){var i=uf(e,t||{});i?r(i):n(new Error("Cannot decode token"))}))},e.getNodeInfo=df,e.verifyLicense=function(e,t,r){return new Promise((function(n,i){if(e&&""!==e.trim())pf(t,r||"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA45UBf0Yjw8nGDZDFk9jG\nHPvxW0LO/2k395nnwg/DdrP0WOQOxmxG68Z19+Uk5ISEu441VnDpEcYluvzfGOkR\nbLgx3nAcB818obIoRVZ+Y3xvYrXjJOlzrss++jDMyfIEqMBusm21v3r3PDGa8VpL\nt3/OXL/m6gWt6PAFTs6P307e1oebI53XBod0oTRfcv9sAwX+DosMWoKyR65yKuVg\nTqe9EmjqzZggbwGNQFYv4vUGAg36tFE1BzFsaqQkiXNcDYh3w6OMC9ktrLVX7gJi\nWY4EHImAWEGVCe/1BXY5tJEub2xFL0cyUnoVihwzn/x5ktQ1Bb7B/9PqiMFx98Lx\noQIDAQAB\n-----END PUBLIC KEY-----",function(){var t=I(C().mark((function t(r,s){var a,o,l,c,u,p,f,d;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=4;break}i(r),t.next=25;break;case 4:if(s.hasOwnProperty("application")&&(a=s.application.name),s.hasOwnProperty("product")&&(a=s.product.name),a){t.next=9;break}return o=new Error("Neither 'application' nor 'product' was found"),t.abrupt("return",i(o));case 9:if(!s.hasOwnProperty("nodeinfo")){t.next=24;break}if(l=s.libraries||[],c=l.map((function(e){return e.name.toLowerCase()})),(u=e.toLowerCase())!==a.toLocaleLowerCase()&&!c.includes(u)){t.next=20;break}return t.next=16,df(a);case 16:p=t.sent,s.nodeinfo===p?n(s):(f=new Error("Node info does not match"),i(f)),t.next=22;break;case 20:d=new Error("appOrLibName '".concat(e,"' not present in application.name or libraries")),i(d);case 22:t.next=25;break;case 24:n(s||{});case 25:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());else{var s=new Error("appOrLibName must be a non-empty string");i(s)}}))},Object.defineProperty(e,"__esModule",{value:!0})}));