var Le=Object.create;var C=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var R=n=>C(n,"__esModule",{value:!0});var w=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Ne=(n,t)=>{R(n);for(var e in t)C(n,e,{get:t[e],enumerable:!0})},He=(n,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fe(t))!Ve.call(n,r)&&r!=="default"&&C(n,r,{get:()=>t[r],enumerable:!(e=Oe(t,r))||e.enumerable});return n},L=n=>He(R(C(n!=null?Le(qe(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var te=w(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});var Be=require("os"),Ge=require("child_process"),We=require("fs"),Ue=require("path");function O(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var F=O(Be),S=O(We),T=O(Ue),Je=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;let r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))},G=/\s+at.*(?:\(|\s)(.*)\)?/,Xe=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,Ye=typeof F.default.homedir=="undefined"?"":F.default.homedir(),Ke=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
`).filter(e=>{let r=e.match(G);if(r===null||!r[1])return!0;let a=r[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!Xe.test(a)}).filter(e=>e.trim()!=="").map(e=>t.pretty?e.replace(G,(r,a)=>r.replace(a,a.replace(Ye,"~"))):e).join(`
`)),ze=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),W=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let e=t.map(r=>typeof r.stack=="string"?ze(Ke(r.stack)):String(r)).join(`
`);e=`
`+Je(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(let t of this._errors)yield t}},Qe=W,Ze=async(n,t,{concurrency:e=1/0,stopOnError:r=!0}={})=>new Promise((a,i)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===1/0)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);let s=[],l=[],u=n[Symbol.iterator](),o=!1,c=!1,f=0,d=0,p=()=>{if(o)return;let g=u.next(),h=d;if(d++,g.done){c=!0,f===0&&(!r&&l.length!==0?i(new Qe(l)):a(s));return}f++,(async()=>{try{let m=await g.value;s[h]=await t(m,h),f--,p()}catch(m){r?(o=!0,i(m)):(l.push(m),f--,p())}})()};for(let g=0;g<e&&(p(),!c);g++);}),U=(n,t,e)=>new Promise((r,a)=>{if(e=Object.assign({concurrency:1/0},e),typeof t!="function")throw new TypeError("Mapper function is required");let{concurrency:i}=e;if(!(typeof i=="number"&&i>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${i}\` (${typeof i})`);let s=[],l=n[Symbol.iterator](),u=!1,o=!1,c=0,f=0,d=()=>{if(u)return;let p=l.next(),g=f;if(f++,p.done){o=!0,c===0&&r(s);return}c++,Promise.resolve(p.value).then(h=>t(h,g)).then(h=>{s[g]=h,c--,d()},h=>{u=!0,a(h)})};for(let p=0;p<i&&(d(),!o);p++);}),J=U,et=U;J.default=et;var X=async(n,t,e)=>(await J(n,(a,i)=>Promise.all([t(a,i),a]),e)).filter(a=>Boolean(a[0])).map(a=>a[1]),Y=X,tt=X;Y.default=tt;var b=typeof atom!="undefined",nt=typeof atom!="undefined"&&(atom.inDevMode()||atom.inSpecMode()),q="atom-package-deps.ignored";var rt=/["'&<>]/,K=at;function at(n){var t=""+n,e=rt.exec(t);if(!e)return t;var r,a="",i=0,s=0;for(i=e.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=r}return s!==i?a+t.substring(s,i):a}async function it(n,t,e){let r=Ge.spawn(n,t,e),a=new Promise((i,s)=>{let l={stdout:r.stdout?[]:null,stderr:r.stderr?[]:null};r.on("error",s),r.stdout&&r.stdout.on("data",function(u){l.stdout.push(u),e.handleStdout&&e.handleStdout(u)}),r.stderr&&r.stderr.on("data",function(u){l.stderr.push(u),e.handleStderr&&e.handleStderr(u)}),r.on("close",u=>{let o=null;l.stdout!=null&&(o=e.encoding===null||e.encoding==="buffer"?Buffer.concat(l.stdout):l.stdout.join(""));let c=null;l.stderr!=null&&(c=e.encoding===null||e.encoding==="buffer"?Buffer.concat(l.stderr):l.stderr.join("")),i({exitCode:u,stdout:o,stderr:c})})});return e.handleChildProcess(r),a}function ot(n,t,e){let r,a=it(n,t,{...e,handleChildProcess(i){r=i}});return a.kill=function(i){return r.kill(i)},a}var st=function(t,e){for(var r=t.split("."),a=e.split("."),i=0;i<3;i++){var s=Number(r[i]),l=Number(a[i]);if(s>l)return 1;if(l>s)return-1;if(!isNaN(s)&&isNaN(l))return 1;if(isNaN(s)&&!isNaN(l))return-1}return 0};async function lt(n){let t=atom.packages.getLoadedPackage(n),e=t&&t.metadata["package-deps"];return Array.isArray(e)?e:[]}async function ct(n){return atom.packages.resolvePackagePath(n)}async function ut(n){var t;let e=atom.packages.getLoadedPackage(n.name);return e==null?null:(t=e.metadata.version)!==null&&t!==void 0?t:null}async function ft(n){let t=null;try{t=await S.default.promises.stat(n)}catch(a){}if(t==null||!t.isDirectory())throw new Error("[Package-Deps] Expected packageName to be a readable directory in Node.js invocation");let e=null;try{let a=await S.default.promises.readFile(T.default.join(n,"package.json"),"utf8");e=JSON.parse(a)}catch(a){}let r=e==null||typeof e!="object"?[]:e["package-deps"];return Array.isArray(r)?r:[]}async function dt(n){var t;let e=T.default.join((t=process.env.ATOM_HOME)!==null&&t!==void 0?t:T.default.join(F.default.homedir(),".atom"),"packages",n);try{return await S.default.promises.access(e,S.default.constants.R_OK),e}catch(r){return null}}async function pt(n){var t,e;let{directory:r}=n;if(r==null)return null;let a=null;try{a=JSON.parse(await S.default.promises.readFile(T.default.join(r,"package.json"),"utf8"))}catch(i){return null}return(t=(e=a)===null||e===void 0?void 0:e.version)!==null&&t!==void 0?t:null}async function gt(n){if(b){let t=await ut(n);if(t)return t}return pt(n)}var z=b?ct:dt;function E(n,t){if(!n)throw new Error(t??"Invariant violation")}async function ht(n){let t=await(b?lt(n):ft(n));return nt&&(E(Array.isArray(t),`Dependencies for ${n} are not a valid array`),t.forEach((e,r)=>{if(Array.isArray(e))e.forEach((a,i)=>{let s=`Dependency#${r}#${i} for ${n} is invalid`;E(typeof a.name=="string"&&a.name.length>0,s),E(a.minimumVersion==null||typeof a.minimumVersion=="string"&&a.minimumVersion.length>0,s)}),E(e.length>0,`Dependency#${r} for ${n} has no group items`);else{let a=`Dependency#${r} for ${n} is invalid`;E(typeof e.name=="string"&&e.name.length>0,a),E(e.minimumVersion==null||typeof e.minimumVersion=="string"&&e.minimumVersion.length>0,a)}})),t}async function Q(n){if(n.directory==null)return!0;if(n.minimumVersion==null)return!1;let t=await gt(n);return t==null?!0:st(n.minimumVersion,t)===1}function mt(n){var t;return b?!!((t=atom.config.get(q))!==null&&t!==void 0?t:[]).includes(n):!1}function vt(n){var t;if(!b)return;let e=new Set((t=atom.config.get(q))!==null&&t!==void 0?t:[]);e.add(n),atom.config.set(q,Array.from(e))}var yt=new Set(["\u2713","done"]),wt=/(?:Installing|Moving) (.*?) to .* (.*)/;async function bt(n){let t=b?`"${atom.packages.getApmPath()}"`:"apm",{stdout:e,stderr:r}=await ot(t,["install",n.name,"--production","--color","false"],{shell:!0}),a=wt.exec(e.trim());if(a!=null&&yt.has(a[2]))return;let i=new Error(`Error installing dependency: ${n.name}`);throw i.stack=r.trim(),i}async function Z(n){if(typeof n=="string")return{name:n,directory:await z(n)};if("name"in n)return{...n,directory:await z(n.name)};throw console.error("This package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works",{entry:n}),Error("The package-deps entry is not valid. Please see https://github.com/steelbrain/package-deps#how-it-works")}var ee=!0;function Et({packageName:n,dependencies:t}){return new Promise(e=>{let r=t.filter(c=>!Array.isArray(c)),a=t.filter(c=>Array.isArray(c)),i=a.length===0,s=i?r.map(c=>c.name).join(", "):"Something went wrong. Check your developer console",l=a.map(c=>c[0]);atom.packages.isPackageDisabled("notifications")&&console.warn(`Enable notifications to install dependencies for ${n}`);let u=atom.notifications.addInfo(`${n} needs to install dependencies`,{dismissable:!0,icon:"cloud-download",detail:s,description:`Install dependenc${t.length===1?"y":"ies"}?`,buttons:[{text:"Yes",onDidClick:()=>{e(i?r:r.concat(l)),u.dismiss()}},{text:"No Thanks",onDidClick:()=>{u.dismiss()}},{text:"Never",onDidClick:()=>{vt(n),ee&&(ee=!1,atom.notifications.addInfo("How to reset package-deps memory",{dismissable:!0,description:"To modify the list of ignored files invoke 'Application: Open Your Config' and change the 'atom-package-deps' section"})),u.dismiss()}}]});if(u.onDidDismiss(()=>e([])),!i)try{var o;let c=atom.views.getView(u),f=(o=c==null?void 0:c.element)!==null&&o!==void 0?o:null;if(f==null)throw new Error("Unable to get notification element from view");let d=f.querySelector(".detail-content");if(d==null)throw new Error("Content detail container not found inside the notification");if(d.innerHTML="",r.length>0){let h=document.createElement("div");h.innerHTML=`Packages without choices: <br /><ul><li>${r.map(m=>K(m.name)).join("</li><li>")}</li></ul>`,d.appendChild(h)}let p=document.createElement("div");p.innerHTML="Packages with choices:",d.appendChild(p);let g=document.createElement("ul");a.forEach((h,m)=>{let M=document.createElement("li"),D=document.createElement("select");D.innerHTML=h.map(A=>`<option>${K(A.name)}</option>`).join(`
`),D.addEventListener("change",()=>{let A=h.find(Me=>Me.name===D.value);A!=null&&(l[m]=A)}),M.style.marginTop="5px",M.appendChild(D),g.appendChild(M)}),d.appendChild(g)}catch(c){console.error("[Package-Deps] Error during showing package choices to user",c)}})}function kt({packageName:n,dependencies:t}){let e=[],r=atom.notifications.addInfo(`Installing ${n} dependencies`,{detail:`Installing ${t.map(s=>s.name).join(", ")}`,dismissable:!0}),a=document.createElement("progress");a.max=t.length,a.style.width="100%";try{var i;let s=atom.views.getView(r),l=(i=s==null?void 0:s.element)!==null&&i!==void 0?i:null;if(l==null)throw new Error("Unable to get notification element from view");let u=l.querySelector(".detail-content");if(u==null)throw new Error("Content detail container not found inside the notification");u.appendChild(a)}catch(s){console.error("[Package-Deps] Error during showing installation progress to user",s)}return{handleFailure({dependency:s,error:l}){var u;e.push(s.name),a.value+=1,console.error(`[Package-Deps] Unable to install ${s.name}, Error:`,(u=l==null?void 0:l.stack)!==null&&u!==void 0?u:l)},handleDependencyInstalled(s){a.value+=1},handleComplete(){r.dismiss(),e.length>0?atom.notifications.addWarning(`Failed to install ${n} dependencies`,{detail:`These packages were not installed, check your console
for more info.
${e.join(`
`)}`,dismissable:!0}):atom.notifications.addSuccess(`Installed ${n} dependencies`,{detail:`Installed ${t.map(s=>s.name).join(", ")}`}),Promise.all(t.map(s=>e.includes(s.name)?null:atom.packages.activatePackage(s.name))).catch(s=>{console.error(`[Package-Deps] Error activating installed packages for ${n}`,s)})}}}async function _t({dependencies:n}){return n.map(t=>Array.isArray(t)?t[0]:t)}function xt({dependencies:n}){let t=!1;return console.log(`Installing dependencies:
${n.map(e=>`  - ${e.name}`).join(`
`)}`),{handleFailure({dependency:e,error:r}){var a;t=!0,console.error(`Unable to install ${e.name}, Error:`,(a=r==null?void 0:r.stack)!==null&&a!==void 0?a:r)},handleDependencyInstalled(e){console.log("Successfully installed",e.name)},handleComplete(){console.log("Installation complete"),t&&(process.exitCode=1)}}}var Pt=b?kt:xt,It=b?Et:_t;async function St(n,t=!1){if(E(typeof n=="string"&&n.length>0,"[Package-Deps] Package name is required"),mt(n))return;let e=await ht(n);if(e.length===0)return;let r=await Promise.all(e.map(async l=>Array.isArray(l)?Promise.all(l.map(Z)):Z(l))),a=await Y(r,async function(l){return Array.isArray(l)?(await Promise.all(l.map(u=>Q(u)))).every(Boolean):Q(l)});if(a.length===0)return;let i;if(t?i=a.map(l=>Array.isArray(l)?l[0]:l):i=await It({packageName:n,dependencies:a}),i.length===0)return;let s=Pt({packageName:n,dependencies:i});await Ze(i,async function(l){try{await bt(l),s.handleDependencyInstalled(l)}catch(u){s.handleFailure({dependency:l,error:u})}},{concurrency:2}),s.handleComplete()}V.install=St});var re=w((cn,N)=>{"use strict";var ne=()=>{let n=Error.prepareStackTrace;Error.prepareStackTrace=(e,r)=>r;let t=new Error().stack.slice(1);return Error.prepareStackTrace=n,t};N.exports=ne;N.exports.default=ne});var ie=w((un,ae)=>{"use strict";var Dt=re();ae.exports=({depth:n=0}={})=>{let t=[],e=new Set;for(let r of Dt()){let a=r.getFileName(),i=r.getTypeName()!==null&&a!==null;if(e.has(a)||(e.add(a),t.unshift(r)),i)return t[n]}}});var ce=w(v=>{"use strict";var At=v&&v.__awaiter||function(n,t,e,r){function a(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function l(c){try{o(r.next(c))}catch(f){s(f)}}function u(c){try{o(r.throw(c))}catch(f){s(f)}}function o(c){c.done?i(c.value):a(c.value).then(l,u)}o((r=r.apply(n,t||[])).next())})},Ct=v&&v.__generator||function(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return u([o,c])}}function u(o){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,a&&(i=o[0]&2?a.return:o[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;switch(a=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){e.label=o[1];break}if(o[0]===6&&e.label<i[1]){e.label=i[1],i=o;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(o);break}i[2]&&e.ops.pop(),e.trys.pop();continue}o=t.call(n,e)}catch(c){o=[6,c],a=0}finally{r=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(v,"__esModule",{value:!0});v.readManifestSync=v.readManifest=void 0;var oe=require("path"),Tt=oe.resolve,$t=oe.sep,se=require("fs"),jt=se.promises,Mt=se.readFileSync,Lt=ie();function Ot(n){return n===void 0&&(n=""),At(this,void 0,void 0,function(){var t,e,r;return Ct(this,function(a){switch(a.label){case 0:t=le(n),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,jt.readFile(t,"utf8")];case 2:return e=a.sent(),[2,JSON.parse(e)];case 3:return r=a.sent(),[2,null];case 4:return[2]}})})}v.readManifest=Ot;function Ft(n){n===void 0&&(n="");var t=le(n);try{var e=Mt(t,"utf8");return JSON.parse(e)}catch(r){return null}}v.readManifestSync=Ft;function le(n){n=(n==null?void 0:n.length)?n:qt();var t=atom.packages.resolvePackagePath(n),e=Tt(t,"package.json");return e}function qt(){var n=Lt().getFileName(),t=atom.packages.getPackageDirPaths(),e=t.filter(function(r){return n.startsWith(r)});return(e==null?void 0:e.length)&&n.replace(e[0],"").split($t).filter(function(r){return r})[0]||""}});var ue=w(y=>{"use strict";var $=y&&y.__assign||function(){return $=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},$.apply(this,arguments)},Vt=y&&y.__awaiter||function(n,t,e,r){function a(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function l(c){try{o(r.next(c))}catch(f){s(f)}}function u(c){try{o(r.throw(c))}catch(f){s(f)}}function o(c){c.done?i(c.value):a(c.value).then(l,u)}o((r=r.apply(n,t||[])).next())})},Nt=y&&y.__generator||function(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(c){return u([o,c])}}function u(o){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,a&&(i=o[0]&2?a.return:o[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;switch(a=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return e.label++,{value:o[1],done:!1};case 5:e.label++,a=o[1],o=[0];continue;case 7:o=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){e.label=o[1];break}if(o[0]===6&&e.label<i[1]){e.label=i[1],i=o;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(o);break}i[2]&&e.ops.pop(),e.trys.pop();continue}o=t.call(n,e)}catch(c){o=[6,c],a=0}finally{r=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};Object.defineProperty(y,"__esModule",{value:!0});y.satisfyDependencies=void 0;var Ht=te(),Rt=ce(),Bt={logger:console.log};function Gt(n,t){return t===void 0&&(t={}),Vt(this,void 0,void 0,function(){var e,r;return Nt(this,function(a){switch(a.label){case 0:return e=$($({},Bt),t),[4,Rt.readManifest(n)];case 1:return r=a.sent(),[4,Ht.install(r.name)];case 2:return a.sent(),Wt(r["package-deps"],e),[2]}})})}y.satisfyDependencies=Gt;function Wt(n,t){t.enableDependencies&&n["package-deps"].map(function(e){atom.packages.isPackageDisabled(e)&&(atom.inDevMode()&&t.logger("["+n.name+"] Enabling package dependency '"+e+"'"),atom.packages.enablePackage(e))})}});var me=w((vn,he)=>{he.exports=ge;ge.sync=Xt;var de=require("fs");function Jt(n,t){var e=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!e||(e=e.split(";"),e.indexOf("")!==-1))return!0;for(var r=0;r<e.length;r++){var a=e[r].toLowerCase();if(a&&n.substr(-a.length).toLowerCase()===a)return!0}return!1}function pe(n,t,e){return!n.isSymbolicLink()&&!n.isFile()?!1:Jt(t,e)}function ge(n,t,e){de.stat(n,function(r,a){e(r,r?!1:pe(a,n,t))})}function Xt(n,t){return pe(de.statSync(n),n,t)}});var Ee=w((yn,be)=>{be.exports=ye;ye.sync=Yt;var ve=require("fs");function ye(n,t,e){ve.stat(n,function(r,a){e(r,r?!1:we(a,t))})}function Yt(n,t){return we(ve.statSync(n),t)}function we(n,t){return n.isFile()&&Kt(n,t)}function Kt(n,t){var e=n.mode,r=n.uid,a=n.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),o=parseInt("001",8),c=l|u,f=e&o||e&u&&a===s||e&l&&r===i||e&c&&i===0;return f}});var _e=w((bn,ke)=>{var wn=require("fs"),j;process.platform==="win32"||global.TESTING_WINDOWS?j=me():j=Ee();ke.exports=H;H.sync=zt;function H(n,t,e){if(typeof t=="function"&&(e=t,t={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,a){H(n,t||{},function(i,s){i?a(i):r(s)})})}j(n,t||{},function(r,a){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,a=!1),e(r,a)})}function zt(n,t){try{return j.sync(n,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES")return!1;throw e}}});var Ce=w((En,Ae)=>{var P=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",xe=require("path"),Qt=P?";":":",Pe=_e(),Ie=n=>Object.assign(new Error(`not found: ${n}`),{code:"ENOENT"}),Se=(n,t)=>{let e=t.colon||Qt,r=n.match(/\//)||P&&n.match(/\\/)?[""]:[...P?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(e)],a=P?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=P?a.split(e):[""];return P&&n.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:a}},De=(n,t,e)=>{typeof t=="function"&&(e=t,t={}),t||(t={});let{pathEnv:r,pathExt:a,pathExtExe:i}=Se(n,t),s=[],l=o=>new Promise((c,f)=>{if(o===r.length)return t.all&&s.length?c(s):f(Ie(n));let d=r[o],p=/^".*"$/.test(d)?d.slice(1,-1):d,g=xe.join(p,n),h=!p&&/^\.[\\\/]/.test(n)?n.slice(0,2)+g:g;c(u(h,o,0))}),u=(o,c,f)=>new Promise((d,p)=>{if(f===a.length)return d(l(c+1));let g=a[f];Pe(o+g,{pathExt:i},(h,m)=>{if(!h&&m)if(t.all)s.push(o+g);else return d(o+g);return d(u(o,c,f+1))})});return e?l(0).then(o=>e(null,o),e):l(0)},Zt=(n,t)=>{t=t||{};let{pathEnv:e,pathExt:r,pathExtExe:a}=Se(n,t),i=[];for(let s=0;s<e.length;s++){let l=e[s],u=/^".*"$/.test(l)?l.slice(1,-1):l,o=xe.join(u,n),c=!u&&/^\.[\\\/]/.test(n)?n.slice(0,2)+o:o;for(let f=0;f<r.length;f++){let d=c+r[f];try{if(Pe.sync(d,{pathExt:a}))if(t.all)i.push(d);else return d}catch(p){}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Ie(n)};Ae.exports=De;De.sync=Zt});Ne(exports,{activate:()=>tn,config:()=>B,deactivate:()=>nn,provideBuilder:()=>en});var k="build-lessc";var B={customArguments:{title:"Custom Arguments",description:"Specify your preferred arguments for `lessc`",type:"string",default:"--no-color",order:0},outputFile:{title:"Output File",description:"Specify the default name of the output file, supports [replacement](https://github.com/noseglid/atom-build#replacement) placeholders",type:"string",default:"{FILE_ACTIVE_NAME_BASE}.css",order:1},manageDependencies:{title:"Manage Dependencies",description:"When enabled, third-party dependencies will be installed automatically",type:"boolean",default:!0,order:2},alwaysEligible:{title:"Always Eligible",description:"The build provider will be available in your project, even when not eligible",type:"boolean",default:!1,order:3}};function I(n){return atom.config.get(`${k}.${n}`)}var Te=L(require("events")),$e=L(ue());function _(n,t){for(var e=0,r=t.length,a=n.length;e<r;e++,a++)n[a]=t[e];return n}var Ut=function(){function n(t){t===void 0&&(t={}),this.name=t.name,this.styleSheet=`
      background-color: `+(t.backgroundColor||"darkgrey")+`;
      border-radius: 2px;
      color: `+(t.color||"white")+`;
      line-height: 1.5;
      padding: 1px 4px;
      text-shadow: 0 1px 0px rgba(0, 0, 0, 0.2);
    `}return n.prototype.__console__=function(t){for(var e,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];!(atom==null?void 0:atom.inDevMode())||(r.unshift("%c"+this.name+"%c",this.styleSheet,""),(e=window.console)[t].apply(e,r))},n.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["debug"],t))},n.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["error"],t))},n.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["info"],t))},n.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["log"],t))},n.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["trace"],t))},n.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.__console__.apply(this,_(["warn"],t))},n}(),fe=Ut;var x=new fe({name:k,backgroundColor:"rosybrown"});var je=L(Ce());function en(){return class extends Te.EventEmitter{constructor(t){super();this.cwd=t,atom.config.observe("build-lessc.outputFile",()=>this.emit("refresh")),atom.config.observe("build-lessc.customArguments",()=>this.emit("refresh"))}getNiceName(){return"Less"}isEligible(){return I("alwaysEligible")===!0?(x.log("Always eligible"),!0):je.default.sync("lessc",{nothrow:!0})?(x.log("Build provider is eligible"),!0):(x.error("Build provider isn't eligible"),!1)}settings(){let t=["(?<message>\\w+Error: .*) in (?<file>(/|\\\\).*) on line (?<line>\\d+), column (?<col>\\d+)"],e=I("outputFile"),r=I("customArguments").trim().split(" ");return r.push("{FILE_ACTIVE}"),r.push(e),[{name:"Less",exec:"lessc",args:["--no-color","{FILE_ACTIVE}",e],cwd:"{FILE_ACTIVE_PATH}",sh:!1,atomCommandName:"less:compile",errorMatch:t},{name:"Less (user)",exec:"lessc",args:r,cwd:"{FILE_ACTIVE_PATH}",sh:!1,atomCommandName:"less:compile-with-user-settings",errorMatch:t}]}}}function tn(){x.log("Activating package"),I("manageDependencies")===!0&&(0,$e.satisfyDependencies)(k)}function nn(){x.log("Deactivating package")}0&&(module.exports={activate,config,deactivate,provideBuilder});
/*!
 * escape-html
 * Copyright(c) 2012-2013 TJ Holowaychuk
 * Copyright(c) 2015 Andreas Lubbe
 * Copyright(c) 2015 Tiancheng "Timothy" Gu
 * MIT Licensed
 */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
//# sourceMappingURL=provider.js.map
