@ibm/sourceorbit
Version:
IBM i dependency management tool
3 lines • 171 kB
JavaScript
#! /usr/bin/env node
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={131:function(e,t,s){"use strict";var n,r=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=n(e),o=0;o<s.length;o++)"default"!==s[o]&&r(t,e,s[o]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.getFolderOptions=function(e){const t=(0,u.getFiles)(e,"**/.ibmi.json");let s={};for(const n of t){const t=a.relative(e,n),r=a.dirname(t);try{s[r]=JSON.parse((0,c.readFileSync)(n,{encoding:"utf-8"}))}catch(e){(0,l.warningOut)(`make: Failed to read ${t}.`)}}return s};const a=o(s(6928)),c=s(9896),l=s(6110),u=s(205)},205:function(e,t,s){"use strict";var n,r=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=n(e),o=0;o<s.length;o++)"default"!==s[o]&&r(t,e,s[o]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSystemNameFromPath=function(e){const t=e.toUpperCase().endsWith(".TEST");let s=e.includes("-")?e.split("-")[0]:e;if(t&&(s=s.substring(0,s.length-5)),s.length<=10&&!t)return s.toUpperCase();let n="",r=s;if(s.includes("_")){const e=s.split("_");n=e[0],r=e[1]}t&&(n="T",r=r.toUpperCase());let i=n;for(let e=0;e<r.length&&i.length<=10;e++){const t=r[e];t!==t.toUpperCase()&&0!==e||(i+=t)}return 1===i.length&&(i=r.substring(0,10)),i.toUpperCase()},t.getFiles=function(e,t,s={}){let n=c.default.sync(t,{cwd:e,absolute:!0,nocase:!0,...s});return"win32"===h.platform()&&(n=n.map((e=>e.split(p.posix.sep).join(p.sep)))),n},t.asPosix=function(e){return e?e.split(p.sep).join(p.posix.sep):""},t.toLocalPath=function(e){return"win32"===h.platform()?e.split(p.posix.sep).join(p.sep):e.split(p.win32.sep).join(p.sep)},t.replaceIncludes=function(e){(0,l.warningOut)("Starting include fix process. Do not end process.");const t=e.getAllLogs();for(const e in t){const s=u.readFileSync(e,{encoding:"utf8"}),n=s.includes("\r\n")?"\r\n":"\n",r=s.split(n),i=t[e].filter((e=>"includeFix"===e.type&&e.line));if(i.length>0){for(const e of i)e.change&&e.change.lineContent&&(r[e.line]=e.change.lineContent);(0,l.infoOut)(`${e} changes: ${i.length}`),u.writeFileSync(e,r.join(n))}}},t.renameFiles=function(e){(0,l.warningOut)("Starting rename process. Do not end process.");const t=e.getAllLogs();let s={};for(const e in t){const n=t[e].filter((e=>"rename"===e.type));for(const e of n)if(e.change&&e.change.rename){const t=e.change.rename;s[t.path]=t.newName}}for(const e in s)u.renameSync(e,p.join(p.dirname(e),s[e])),(0,l.infoOut)(`'${e}' -> '${s[e]}'`)},t.getReferenceObjectsFrom=function(e){const t=[],s=e.includes("\r\n")?"\r\n":"\n",n=e.split(s);let r;for(let e of n){const s=e.trim().toUpperCase();if(0!==s.length&&!s.startsWith("#"))if(e.startsWith(" ")||e.startsWith("\t"))r&&r.exports.push(s);else{const e=s.split(".");e[0].length>10&&(0,l.warningOut)(`Trying to add referenced object: object name '${e[0]}' is too long.`),r={systemName:e[0],type:e[1],exports:[],reference:!0},t.push(r)}}return t},t.fromCl=function(e){let t=!1,s=0,n="",r="",i="",o={};for(const a of e.split(""))"("===a?s++:")"===a?(1===s&&(o[r.toLowerCase()]=i,i="",r=""),s--):" "!==a||t?" "===a&&t?r=r.trim():s>0?i+=a:t?r+=a:n+=a:(t=!0,n=n.trim());return{command:n,parameters:o}},t.toCl=function(e,t){let s=e;if(t)for(const[e,n]of Object.entries(t)){let t;n&&""!==n.trim()&&(n===n.toLocaleUpperCase()?t=n:(t=n.replace(/'/g,"''"),t=`'${t}'`),s+=` ${e.toUpperCase()}(${t})`)}return s},t.checkFileExists=function(e){return u.promises.access(e,u.constants.F_OK).then((()=>!0)).catch((()=>!1))};const c=a(s(3577)),l=s(6110),u=o(s(9896)),p=o(s(6928)),h=o(s(857))},857:e=>{"use strict";e.exports=require("os")},1057:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(s(6310)),i=s(7097);class o extends r.default{constructor(e,t){super(e,t),this.tokens=e,this.range=t,this.type=i.DefinitionType.File,this.file=this.processFile()}processFile(){const e=this.getParms().FILE;let t;if(e?e.block&&(t=e.block):t=this.getPreParm(),t){if(3===t.length&&"forwardslash"===t[1].type&&t[0].value&&t[2].value)return{library:t[0].value,name:t[2].value};if(1===t.length&&t[0].value)return{name:t[0].value}}}getOpenID(){const e=this.getParms().OPNID;if(e&&e.block){const t=e.block;if(1===t.length&&"word"===t[0].type&&t[0].value)return t[0].value}}}t.default=o},1198:(e,t,s)=>{function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.setopts=function(e,t,s){if(s||(s={}),s.matchBase&&-1===t.indexOf("/")){if(s.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!s.silent,e.pattern=t,e.strict=!1!==s.strict,e.realpath=!!s.realpath,e.realpathCache=s.realpathCache||Object.create(null),e.follow=!!s.follow,e.dot=!!s.dot,e.mark=!!s.mark,e.nodir=!!s.nodir,e.nodir&&(e.mark=!0),e.sync=!!s.sync,e.nounique=!!s.nounique,e.nonull=!!s.nonull,e.nosort=!!s.nosort,e.nocase=!!s.nocase,e.stat=!!s.stat,e.noprocess=!!s.noprocess,e.absolute=!!s.absolute,e.fs=s.fs||r,e.maxLength=s.maxLength||1/0,e.cache=s.cache||Object.create(null),e.statCache=s.statCache||Object.create(null),e.symlinks=s.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(u))}(e,s),e.changedCwd=!1;var o=process.cwd();n(s,"cwd")?(e.cwd=i.resolve(s.cwd),e.changedCwd=e.cwd!==o):e.cwd=o,e.root=s.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=a(e.cwd)?e.cwd:p(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!s.nomount,s.nonegate=!0,s.nocomment=!0,s.allowWindowsEscape=!1,e.minimatch=new c(t,s),e.options=e.minimatch.options},t.ownProp=n,t.makeAbs=p,t.finish=function(e){for(var t=e.nounique,s=t?[]:Object.create(null),n=0,r=e.matches.length;n<r;n++){var i=e.matches[n];if(i&&0!==Object.keys(i).length){var o=Object.keys(i);t?s.push.apply(s,o):o.forEach((function(e){s[e]=!0}))}else if(e.nonull){var a=e.minimatch.globSet[n];t?s.push(a):s[a]=!0}}if(t||(s=Object.keys(s)),e.nosort||(s=s.sort(l)),e.mark){for(n=0;n<s.length;n++)s[n]=e._mark(s[n]);e.nodir&&(s=s.filter((function(t){var s=!/\/$/.test(t),n=e.cache[t]||e.cache[p(e,t)];return s&&n&&(s="DIR"!==n&&!Array.isArray(n)),s})))}e.ignore.length&&(s=s.filter((function(t){return!h(e,t)}))),e.found=s},t.mark=function(e,t){var s=p(e,t),n=e.cache[s],r=t;if(n){var i="DIR"===n||Array.isArray(n),o="/"===t.slice(-1);if(i&&!o?r+="/":!i&&o&&(r=r.slice(0,-1)),r!==t){var a=p(e,r);e.statCache[a]=e.statCache[s],e.cache[a]=e.cache[s]}}return r},t.isIgnored=h,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return!(!e.gmatcher||!e.gmatcher.match(t))}))};var r=s(9896),i=s(6928),o=s(4027),a=s(2641),c=o.Minimatch;function l(e,t){return e.localeCompare(t,"en")}function u(e){var t=null;if("/**"===e.slice(-3)){var s=e.replace(/(\/\*\*)+$/,"");t=new c(s,{dot:!0})}return{matcher:new c(e,{dot:!0}),gmatcher:t}}function p(e,t){var s=t;return s="/"===t.charAt(0)?i.join(e.root,t):a(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(s=s.replace(/\\/g,"/")),s}function h(e,t){return!!e.ignore.length&&e.ignore.some((function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))}))}},1440:function(e,t,s){"use strict";var n,r=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=n(e),o=0;o<s.length;o++)"default"!==s[o]&&r(t,e,s[o]);return i(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=t.allExtensions=t.ImpactMarkdown=t.BobProject=t.MakeProject=t.Targets=void 0;const c=s(9896),l=s(6326),u=s(4528),p=a(s(6928)),h=s(6110),d=s(2726),f=s(9431),m=s(2572),g=s(2316),y=s(205),b=s(1833);async function E(e,t,s){const n=p.default.join(e,s);let[r,i]=s.split(".");r&&(r=r.toUpperCase()),i&&(i=i.toUpperCase());let o=t.getResolvedObjects().find((e=>e.systemName===r&&e.type===i));o||(o=await t.resolvePathToObject(n));const a=t.getTargets();let c=[];!function e(t){console.log(`${"".padEnd(c.length,"\t")}${t.systemName}.${t.type} (${t.relativePath||"no source"})`),c.push(t);for(const s of a){const n=s.deps.some((e=>e.systemName===t.systemName&&e.type===t.type)),r=c.some((e=>e.systemName===s.systemName&&e.type===s.type));n&&!r&&e(s)}c.pop()}(o)}(process.argv.length>=2&&(process.argv[1].endsWith("so")||process.argv[1].endsWith("index.js"))||process.env.VSCODE_INSPECTOR_OPTIONS)&&(h.cliSettings.cliMode=!0,async function(){const e=process.argv.slice(2);let t=process.cwd(),s=`**/*.{${m.allExtensions.join(",")},${m.allExtensions.map((e=>e.toUpperCase())).join(",")}}`;for(let n=0;n<e.length;n++)switch(e[n]){case"-g":case"--glob":s=e[n+1],n++;break;case"-d":case"--cwd":t=e[n+1],n++;break;case"-ar":(0,h.warningOut)("Auto rename enabled. No makefile will be generated."),h.cliSettings.autoRename=!0;break;case"-fi":(0,h.warningOut)("Include fix enabled enabled."),h.cliSettings.fixIncludes=!0;break;case"--verbose":h.cliSettings.infoMessages=!0;break;case"-bf":h.cliSettings.buildFile=e[n+1],n++;break;case"-nc":case"--no-children":h.cliSettings.makeFileNoChildren=!0;break;case"-ap":case"--assume-programs":h.cliSettings.assumeSourcesArePrograms=!0;break;case"-bl":h.cliSettings.userBranch=e[n+1],n++;break;case"-f":case"--files":case"-l":h.cliSettings.fileList=!0;break;case"-h":case"--help":console.log(""),console.log("\t-d <dir>"),console.log("\t--cwd <dir>\tTo see the directory of where source code lives."),console.log("\t\t\tThe default is the current working directory."),console.log(""),console.log("\t-f <relative paths>"),console.log("\t--files <relative paths>"),console.log("\t\t\tthis option will still scan the entire working"),console.log("\t\t\tdirectory, but will single out these specific files"),console.log("\t\t\twhen generating other files. If no build file is"),console.log("\t\t\tspecified, dependencies will be printed."),console.log(""),console.log("\t-bf make|bob|imd|json\tCreate build files of a specific format"),console.log("\t\t\t\tExample: -bf make"),console.log(""),console.log("\t-bl <name>\tSet the BRANCHLIB environment variable based on "),console.log("\t\t\ta user provided branch name, and will write it out."),console.log("\t\t\tExample: -bl feature/123-cool-idea"),console.log("\t\t\t\t -bl bug/123-bad-move"),console.log(""),console.log("\t-ap"),console.log("\t--assume-programs"),console.log("\t\t\tAssume that all sources are programs. This is useful"),console.log("\t\t\tif your program sources do not use the .pgm notation."),console.log(""),console.log("Options for project cleanup:"),console.log(""),console.log("\t-ar\t\tRun the auto-rename process after scanning all code"),console.log("\t\t\tEnsure it is run inside of source control."),console.log("\t\t\tRename program sources to have the '.pgm.' attribute in the name"),console.log("\t\t\tRename RPGLE copybooks found (based on include statements) to be '.rpgleinc'"),console.log(""),console.log("\t-fi\t\tFix includes for RPGLE sources"),console.log("\t\t\tEnsure it is run inside of source control."),console.log("\t\t\tFixes all include/copy directives to use local source if available"),console.log(""),console.log("\t--verbose\tPrint all the detail."),console.log(""),console.log("Options specific to '-bf make':"),console.log(""),console.log("\t-nc"),console.log("\t--no-children\tUsed with '-bf make' and won't include children of"),console.log("\t\t\tobjects in the makefile. Useful in conjuction with '-f'."),console.log(""),process.exit(0);break;default:h.cliSettings.fileList&&h.cliSettings.lookupFiles.push(e[n])}if(h.cliSettings.userBranch){const e=(0,g.getBranchLibraryName)(h.cliSettings.userBranch);console.log(e),process.env.BRANCHLIB=e,process.exit(0)}const n=new b.ReadFileSystem,r=new l.Targets(t,n);let i;r.setSuggestions({includes:h.cliSettings.fixIncludes,renames:h.cliSettings.autoRename}),r.setAssumePrograms(h.cliSettings.assumeSourcesArePrograms);try{i=await n.getFiles(t,s)}catch(e){(0,h.error)(e.message||e),process.exit(1)}const o=p.default.join(t,m.referencesFileName);await n.exists(o)&&((0,h.infoOut)(`Found reference file: ${o}`),r.handleRefsFile(o)),r.loadObjectsFromPaths(i);for(const e of i)await r.parseFile(e)||(0,h.error)("Report this issue to us with an example: github.com/IBM/sourceorbit/issues");let a=!1;if(h.cliSettings.autoRename&&((0,y.renameFiles)(r.logger),a=!0),h.cliSettings.fixIncludes&&((0,y.replaceIncludes)(r.logger),a=!0),a&&process.exit(),r.resolveBinder(),h.cliSettings.lookupFiles&&"none"===h.cliSettings.buildFile)for(const e of h.cliSettings.lookupFiles)await E(t,r,e);switch(h.cliSettings.buildFile){case"bob":const e=new d.BobProject(r).createRules();for(const s in e)(0,c.writeFileSync)(p.default.join(t,s),e[s]);break;case"make":const s=new u.MakeProject(t,r,n);await s.setupSettings(),s.setNoChildrenInBuild(h.cliSettings.makeFileNoChildren);let i=h.cliSettings.fileList?h.cliSettings.lookupFiles.map((e=>r.getResolvedObject(p.default.join(t,e)))).filter((e=>e)):void 0;(0,c.writeFileSync)(p.default.join(t,"makefile"),s.getMakefile(i).join("\n"));break;case"imd":const o=new f.ImpactMarkdown(t,r,h.cliSettings.lookupFiles);(0,c.writeFileSync)(p.default.join(t,"impact.md"),o.getContent().join("\n"));break;case"json":const a={targets:r.getTargets(),resolved:r.getResolvedObjects(),exports:r.getExports(),messages:r.logger.getAllLogs()};(0,c.writeFileSync)(p.default.join(t,"sourceorbit.json"),JSON.stringify(a,null,2))}}());var v=s(6326);Object.defineProperty(t,"Targets",{enumerable:!0,get:function(){return v.Targets}});var T=s(4528);Object.defineProperty(t,"MakeProject",{enumerable:!0,get:function(){return T.MakeProject}});var O=s(2726);Object.defineProperty(t,"BobProject",{enumerable:!0,get:function(){return O.BobProject}});var k=s(9431);Object.defineProperty(t,"ImpactMarkdown",{enumerable:!0,get:function(){return k.ImpactMarkdown}});var N=s(2572);Object.defineProperty(t,"allExtensions",{enumerable:!0,get:function(){return N.allExtensions}}),t.Utils=o(s(205))},1455:(e,t,s)=>{e.exports=u,u.realpath=u,u.sync=p,u.realpathSync=p,u.monkeypatch=function(){n.realpath=u,n.realpathSync=p},u.unmonkeypatch=function(){n.realpath=r,n.realpathSync=i};var n=s(9896),r=n.realpath,i=n.realpathSync,o=process.version,a=/^v[0-5]\./.test(o),c=s(6674);function l(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function u(e,t,s){if(a)return r(e,t,s);"function"==typeof t&&(s=t,t=null),r(e,t,(function(n,r){l(n)?c.realpath(e,t,s):s(n,r)}))}function p(e,t){if(a)return i(e,t);try{return i(e,t)}catch(s){if(l(s))return c.realpathSync(e,t);throw s}}},1517:(e,t)=>{var s;s=function(e){e.version="1.2.3";var t=function(){for(var e=0,t=new Array(256),s=0;256!=s;++s)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=s)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1)?-2097792136^e>>>1:e>>>1,t[s]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),s=function(e){var t=0,s=0,n=0,r="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)r[n]=e[n];for(n=0;256!=n;++n)for(s=e[n],t=256+n;t<4096;t+=256)s=r[t]=s>>>8^e[255&s];var i=[];for(n=1;16!=n;++n)i[n-1]="undefined"!=typeof Int32Array?r.subarray(256*n,256*n+256):r.slice(256*n,256*n+256);return i}(t),n=s[0],r=s[1],i=s[2],o=s[3],a=s[4],c=s[5],l=s[6],u=s[7],p=s[8],h=s[9],d=s[10],f=s[11],m=s[12],g=s[13],y=s[14];e.table=t,e.bstr=function(e,s){for(var n=~s,r=0,i=e.length;r<i;)n=n>>>8^t[255&(n^e.charCodeAt(r++))];return~n},e.buf=function(e,s){for(var b=~s,E=e.length-15,v=0;v<E;)b=y[e[v++]^255&b]^g[e[v++]^b>>8&255]^m[e[v++]^b>>16&255]^f[e[v++]^b>>>24]^d[e[v++]]^h[e[v++]]^p[e[v++]]^u[e[v++]]^l[e[v++]]^c[e[v++]]^a[e[v++]]^o[e[v++]]^i[e[v++]]^r[e[v++]]^n[e[v++]]^t[e[v++]];for(E+=15;v<E;)b=b>>>8^t[255&(b^e[v++])];return~b},e.str=function(e,s){for(var n=~s,r=0,i=e.length,o=0,a=0;r<i;)(o=e.charCodeAt(r++))<128?n=n>>>8^t[255&(n^o)]:o<2048?n=(n=n>>>8^t[255&(n^(192|o>>6&31))])>>>8^t[255&(n^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),a=1023&e.charCodeAt(r++),n=(n=(n=(n=n>>>8^t[255&(n^(240|o>>8&7))])>>>8^t[255&(n^(128|o>>2&63))])>>>8^t[255&(n^(128|a>>6&15|(3&o)<<4))])>>>8^t[255&(n^(128|63&a))]):n=(n=(n=n>>>8^t[255&(n^(224|o>>12&15))])>>>8^t[255&(n^(128|o>>6&63))])>>>8^t[255&(n^(128|63&o))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?s(t):s({})},1813:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(s(6310)),i=s(7097);class o extends r.default{constructor(e,t){super(e,t),this.tokens=e,this.range=t,this.type=i.DefinitionType.Subroutine,this.name=this.processName()}processName(){let e;const t=this.getParms().SUBR;if(t&&t.block&&1===t.block.length&&"word"===t.block[0].type)e=t.block[0];else{const t=this.tokens.find((e=>"word"===e.type&&e.value));t&&(e=t)}return e}}t.default=o},1833:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadFileSystem=void 0;const r=n(s(1943)),i=n(s(9896)),o=s(205),a=s(2572);t.ReadFileSystem=class{constructor(){}async getFiles(e,t=a.scanGlob,s={}){return(0,o.getFiles)(e,t,s)}readFile(e){return r.default.readFile(e,{encoding:"utf8"})}async exists(e){return i.default.existsSync(e)}}},1943:e=>{"use strict";e.exports=require("fs/promises")},1944:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSqlFunction=function(e){return e=e.toUpperCase(),s.includes(e)||n.includes(e)};const s=["ANY_VALUE","ARRAY_AGG","AVG","CORR","CORRELATION","COUNT","COUNT_BIG","COVARIANCE","COVAR","COVAR_SAMP","COVARIANCE_SAMP","GROUPING","JSON_ARRAYAGG","JSON_OBJECTAGG","LISTAGG","MAX","MEDIAN","MIN","PERCENTILE_CONT","PERCENTILE_DISC","STDDEV_POP","STDDEV","STDDEV_SAMP","SUM","VAR_POP","VARIANCE","VAR","VAR_SAMP","VARIANCE_SAMP","XMLAGG","XMLGROUP"],n=["ABS","ABSVAL","ACOS","ADD_DAYS","ADD_HOURS","ADD_MINUTES","ADD_MONTHS","ADD_SECONDS","ADD_YEARS","ANTILOG","ARRAY_MAX_CARDINALITY","ARRAY_TRIM","ASCII","ASIN","ATAN","ATANH","ATAN2","BASE64_DECODE","BASE64_ENCODE","BIGINT","BINARY","BITAND","BITANDNOT","BITOR","BITXOR","and BITNOT","BIT_LENGTH","BLOB","BSON_TO_JSON","CARDINALITY","CEILING","CEIL","CHAR","CHARACTER_LENGTH","CHAR_LENGTH","CHR","CLOB","COALESCE","COMPARE_DECFLOAT","CONCAT","CONTAINS","COS","COSH","COT","CURDATE","CURTIME","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYNAME","DAYOFMONTH","DAYOFWEEK","DAYOFWEEK_ISO","DAYOFYEAR","DAYS","DBCLOB","DBPARTITIONNAME","DBPARTITIONNUM","DECFLOAT","DECFLOAT_FORMAT","DECFLOAT_SORTKEY","DECIMAL","DEC","DECRYPT_BIT","DECRYPT_BINARY","DECRYPT_CHAR","DECRYPT_DB","DEGREES","DIFFERENCE","DIGITS","DLCOMMENT","DLLINKTYPE","DLURLCOMPLETE","DLURLPATH","DLURLPATHONLY","DLURLSCHEME","DLURLSERVER","DLVALUE","DOUBLE_PRECISION","DOUBLE","ENCRYPT_AES","ENCRYPT_AES256","ENCRYPT_RC2","ENCRPYT","ENCRYPT_TDES","EXP","EXTRACT","FIRST_DAY","FLOAT","FLOOR","GENERATE_UNIQUE","GENERATE_UUID","GENERATE_UUID_BINARY","GET_BLOB_FROM_FILE","GET_CLOB_FROM_FILE","GET_DBCLOB_FROM_FILE","GET_XML_FILE","GETHINT","GRAPHIC","GREATEST","HASH_MD5","HASH_SHA1","HASH_SHA256","HASH_SHA512","HASH_ROW","HASH_VALUES","HASHED_VALUE","HEX","HEXTORAW","HOUR","HTML_ENTITY_DECODE","HTML_ENTITY_ENCODE","HTTP_DELETE and HTTP_DELETE_BLOB","HTTP_GET and HTTP_GET_BLOB","HTTP_PATCH and HTTP_PATCH_BLOB","HTTP_POST and HTTP_POST_BLOB","HTTP_PUT and HTTP_PUT_BLOB","IDENTITY_VAL_LOCAL","IFNULL","INSERT","INSTR","INTEGER","INT","INTERPRET","JSON_ARRAY","JSON_OBJECT","JSON_QUERY","JSON_TO_BSON","JSON_UPDATE","JSON_VALUE","JULIAN_DAY","LAND","LAST_DAY","LCASE","LEAST","LEFT","LENGTH","LN","LNOT","LOCATE","LOCATE_IN_STRING","LOG10","LOR","LOWER","LPAD","LTRIM","MAX","MAX_CARDINALITY","MICROSECOND","MIDNIGHT_SECONDS","MIN","MINUTE","MOD","MONTH","MONTHNAME","MONTHS_BETWEEN","MQREAD","MQREADCLOB","MQRECEIVE","MQRECEIVECLOB","MQSEND","MULTIPLY_ALT","NEXT_DAY","NORMALIZE_DECFLOAT","NOW","NULLIF","NVL","OCTET_LENGTH","OVERLAY","PI","POSITION","POSSTR","POWER","POW","QUANTIZE","QUARTER","RADIANS","RAISE_ERROR","RANDOM","RAND","REAL","REGEXP_COUNT","REGEXP_INSTR","REGEXP_REPLACE","REGEXP_SUBSTR","REPEAT","REPLACE","RID","RIGHT","ROUND","ROUND_TIMESTAMP","ROWID","RPAD","RRN","RTRIM","SCORE","SECOND","SIGN","SIN","SINH","SMALLINT","SOUNDEX","SPACE","SQRT","STRIP","STRLEFT","STRPOS","STRRIGHT","SUBSTR","SUBSTRING","TABLE_NAME","TABLE_SCHEMA","TAN","TANH","TIME","TIMESTAMP","TIMESTAMP_FORMAT","TIMESTAMP_ISO","TIMESTAMPDIFF","TIMESTAMPDIFF_BIG","TO_CHAR","TO_CLOB","TO_DATE","TO_NUMBER","TO_TIMESTAMP","TOTALORDER","TRANSLATE","TRIM","TRIM_ARRAY","TRUNCATE","TRUNC","TRUNC_TIMESTAMP","UCASE","UPPER","URL_DECODE","URL_ENCODE","VALUE","VARBINARY","VARBINARY_FORMAT","VARCHAR","VARCHAR_BIT_FORMAT","VARCHAR_FORMAT","VARCHAR_FORMAT_BINARY","VARGRAPHIC","VERIFY_GROUP_FOR_USER","WEEK","WEEK_ISO","WRAP","XMLATTRIBUTES","XMLCOMMENT","XMLCONCAT","XMLDOCUMENT","XMLELEMENT","XMLFOREST","XMLNAMESPACES","XMLPARSE","XMLPI","XMLROW","XMLSERIALIZE","XMLTEXT","XMLVALIDATE","XOR","XSLTRANSFORM","YEAR","ZONED"]},2005:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.iProject=void 0;const r=n(s(6928)),i=s(2316);t.iProject=class{constructor(){this.includePaths=[],this.compiles=(0,i.getDefaultCompiles)(),this.objectAttributes={},this.binders=[]}getCompileDataForType(e){return Object.values(this.compiles).find((t=>t.becomes===e))}getCompileDataForSource(e){const t=r.default.parse(e);let s=t.ext.toLowerCase();return t.name.includes(".")&&(s=r.default.parse(t.name).ext.toLowerCase()+s),s.startsWith(".")&&(s=s.substring(1)),this.compiles[s]}applySettings(e){if(e.includePaths&&e.includePaths.length>0&&(this.includePaths=e.includePaths),e.binders&&e.binders.length>0&&(this.binders=e.binders),e.compiles)for(const[t,s]of Object.entries(e.compiles))this.compiles[t]={...this.compiles[t]||{},...s}}}},2017:(e,t,s)=>{try{var n=s(9023);if("function"!=typeof n.inherits)throw"";e.exports=n.inherits}catch(t){e.exports=s(6698)}},2316:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getBranchLibraryName=function(e){return`VS${((0,r.str)(e,0)>>>0).toString(16).toUpperCase()}`},t.extCanBeProgram=function(e){return["MODULE","PGM"].includes(o(e))},t.getTrueBasename=function(e){const t=i.default.parse(e);return t.ext&&[".PGM",".SRVPGM",".TEST"].includes(t.ext.toUpperCase())&&(e=t.name),e.includes("-")&&(e=e.substring(0,e.indexOf("-"))),e},t.getObjectType=o,t.getDefaultCompiles=function(){const e={becomes:"SRVPGM",preCommands:['-system -q "CRTBNDDIR BNDDIR($(BIN_LIB)/$(APP_BNDDIR))"'],command:"CRTSRVPGM",parameters:{srvpgm:"$(BIN_LIB)/$*",module:"*MODULES",srcstmf:"'$<'",bnddir:"$(BNDDIR)",replace:"*YES"},postCommands:['-system -q "ADDBNDDIRE BNDDIR($(BIN_LIB)/$(APP_BNDDIR)) OBJ((*LIBL/$* *SRVPGM *IMMED))"']};return{pgm:{becomes:"PGM",command:"CRTPGM",parameters:{pgm:"$(BIN_LIB)/$*",entmod:"$*",module:"*MODULES",tgtrls:"*CURRENT",bnddir:"$(BNDDIR)",actgrp:"*NEW"}},"pgm.rpgle":{becomes:"PGM",command:"CRTBNDRPG",parameters:{pgm:"$(BIN_LIB)/$*",srcstmf:"'$<'",option:"*EVENTF",dbgview:"*SOURCE",tgtrls:"*CURRENT",tgtccsid:"*JOB",bnddir:"$(BNDDIR)",dftactgrp:"*NO"}},"pgm.sqlrpgle":{becomes:"PGM",command:"CRTSQLRPGI",parameters:{obj:"$(BIN_LIB)/$*",srcstmf:"'$<'",commit:"*NONE",dbgview:"*SOURCE",option:"*EVENTF",rpgppopt:"*LVL2",compileopt:"TGTCCSID(*JOB) BNDDIR($(BNDDIR)) DFTACTGRP(*no)"}},rpgle:{becomes:"MODULE",command:"CRTRPGMOD",parameters:{module:"$(BIN_LIB)/$*",srcstmf:"'$<'",option:"*EVENTF",dbgview:"*SOURCE",tgtrls:"*CURRENT",tgtccsid:"*JOB"}},sqlrpgle:{becomes:"MODULE",command:"CRTSQLRPGI",parameters:{obj:"$(BIN_LIB)/$*",srcstmf:"'$<'",commit:"*NONE",dbgview:"*SOURCE",compileopt:"'TGTCCSID(*JOB)'",rpgppopt:"*LVL2",option:"*EVENTF",objtype:"*MODULE"}},"pgm.clle":{becomes:"PGM",command:"CRTBNDCL",parameters:{pgm:"$(BIN_LIB)/$*",srcstmf:"'$<'",option:"*EVENTF",dbgview:"*SOURCE",tgtrls:"*CURRENT",dftactgrp:"*NO"}},dspf:{becomes:"FILE",member:!0,command:"CRTDSPF",parameters:{file:"$(BIN_LIB)/$*",srcfile:"$(BIN_LIB)/$(SRCPF)",srcmbr:"$*",option:"*EVENTF"}},prtf:{becomes:"FILE",member:!0,command:"CRTPRTF",parameters:{file:"$(BIN_LIB)/$*",srcfile:"$(BIN_LIB)/$(SRCPF)",srcmbr:"$*",option:"*EVENTF"}},cmd:{becomes:"CMD",member:!0,command:"CRTCMD",parameters:{cmd:"$(BIN_LIB)/$*",pgm:"$(BIN_LIB)/$*",srcfile:"$(BIN_LIB)/$(SRCPF)",option:"*EVENTF"}},sql:{becomes:"FILE",command:"RUNSQLSTM",parameters:{srcstmf:"'$<'",commit:"*NONE"}},sqludf:{becomes:"SRVPGM",command:"RUNSQLSTM",parameters:{srcstmf:"'$<'",commit:"*NONE"}},table:{becomes:"FILE",command:"RUNSQLSTM",parameters:{srcstmf:"'$<'",commit:"*NONE"}},binder:e,bnd:e,srvpgm:{becomes:"SRVPGM",preCommands:['-system -q "CRTBNDDIR BNDDIR($(BIN_LIB)/$(APP_BNDDIR))"','-system -q "RMVBNDDIRE BNDDIR($(BIN_LIB)/$(APP_BNDDIR)) OBJ(($(BIN_LIB)/$*))"','-system "DLTOBJ OBJ($(BIN_LIB)/$*) OBJTYPE(*SRVPGM)"'],command:"CRTSRVPGM",parameters:{srvpgm:"$(BIN_LIB)/$*",module:"*MODULES",srcstmf:"'$<'",bnddir:"$(BNDDIR)"},postCommands:['-system -q "ADDBNDDIRE BNDDIR($(BIN_LIB)/$(APP_BNDDIR)) OBJ((*LIBL/$* *SRVPGM *IMMED))"']},bnddir:{sourceOptional:!0,becomes:"BNDDIR",preCommands:['-system -q "CRTBNDDIR BNDDIR($(BIN_LIB)/$*)"','-system -q "ADDBNDDIRE BNDDIR($(BIN_LIB)/$*) OBJ($(patsubst %.SRVPGM,(*LIBL/% *SRVPGM *IMMED),$(notdir $^)))"']},dtaara:{becomes:"DTAARA",commandSource:!0},mnucmd:{becomes:"MENU",member:!0,command:"CRTMNU",parameters:{menu:"$(BIN_LIB)/$*",type:"*DSPF",dspf:"$(BIN_LIB)/$*"}},pf:{becomes:"FILE",member:!0,command:"CRTPF",parameters:{file:"$(BIN_LIB)/$*",srcfile:"$(BIN_LIB)/$(SRCPF)",option:"*EVENTF"}},lf:{becomes:"FILE",member:!0,command:"CRTLF",parameters:{file:"$(BIN_LIB)/$*",srcfile:"$(BIN_LIB)/$(SRCPF)",option:"*EVENTF"}}}};const r=s(1517),i=n(s(6928));function o(e){switch(e.toLowerCase()){case"dspf":case"prtf":case"pf":case"lf":case"sql":case"table":case"view":case"index":case"alias":case"sqludf":case"sqludt":case"sqlalias":case"sqlseq":case"sequence":case"msgf":return"FILE";case"dtaara":return"DTAARA";case"cmd":return"CMD";case"rpgle":case"sqlrpgle":case"clle":case"cl":return"MODULE";case"binder":case"bnd":case"function":return"SRVPGM";case"procedure":case"trigger":case"sqlprc":case"sqltrg":return"PGM";case"bnddir":return"BNDDIR"}}},2332:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s{constructor(e){this.type=e,this.name="",this.keyword={},this.description="",this.tags=[],this.references=[],this.subItems=[],this.readParms=!1,this.range={start:null,end:null}}clone(){const e=new s(this.type);return e.name=this.name,e.keyword=this.keyword,e.description=this.description,e.tags=this.tags,this.position&&(e.position={...this.position}),e.subItems=this.subItems.map((e=>e.clone())),e.range={start:this.range.start,end:this.range.end},e}}t.default=s},2572:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.referencesFileName=t.scanGlob=t.allExtensions=t.objectExtensions=t.cmdExtensions=t.srvPgmExtensions=t.sqlExtensions=t.ddsExtension=t.clExtensions=t.rpgExtensions=void 0,t.rpgExtensions=["sqlrpgle","rpgle"],t.clExtensions=["clle","cl","clp"],t.ddsExtension=["pf","lf","dspf","prtf"],t.sqlExtensions=["sql","table","view","index","alias","sqlprc","sqludf","sqludt","sqltrg","sqlalias","sqlseq"],t.srvPgmExtensions=["binder","bnd"],t.cmdExtensions=["cmd"],t.objectExtensions=["dtaara","mnucmd","msgf","dtaq","bnddir"],t.allExtensions=[...t.rpgExtensions,...t.clExtensions,...t.ddsExtension,...t.sqlExtensions,...t.srvPgmExtensions,...t.cmdExtensions,...t.objectExtensions],t.scanGlob=`**/*.{${t.allExtensions.join(",")},${t.allExtensions.map((e=>e.toUpperCase())).join(",")}}`,t.referencesFileName=".objrefs"},2613:e=>{"use strict";e.exports=require("assert")},2641:e=>{"use strict";function t(e){return"/"===e.charAt(0)}function s(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),s=t[1]||"",n=Boolean(s&&":"!==s.charAt(1));return Boolean(t[2]||n)}e.exports="win32"===process.platform?s:t,e.exports.posix=t,e.exports.win32=s},2724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(){this.matchers=[{name:"VARIABLE",match:[{type:"ampersand"},{type:"word"}],becomes:"variable"},{name:"SPECIAL",match:[{type:"asterisk"},{type:"word"}],becomes:"special"},{name:"LABEL",match:[{type:"word"},{type:"colon"}],becomes:"label"},{name:"NEWLINE",match:[{type:"newliner"},{type:"newline"}],becomes:"newline"},{name:"BIF",match:[{type:"percent"},{type:"word"}],becomes:"builtin"}],this.spaces=[" "],this.OPENBRACKET="(",this.CLOSEBRACKET=")",this.splitParts=[this.OPENBRACKET,this.CLOSEBRACKET,"/","*","+",":","&","%","\n","\r",...this.spaces],this.types={[this.OPENBRACKET]:"openbracket",[this.CLOSEBRACKET]:"closebracket","/":"forwardslash","*":"asterisk","+":"plus",":":"colon","&":"ampersand","%":"percent","\n":"newline","\r":"newliner"},this.stringChar="'",this.comments=["/*","*/"]}parseDocument(e){let t=-1,s=!1,n=!1,r=[],i=0,o="",a=0;for(let c=0;c<e.length;c++)if(s||(e[c]===this.OPENBRACKET&&a++,e[c]===this.CLOSEBRACKET&&a--),0===a&&e[c]&&e[c+1]&&this.comments.includes(e.substring(c,c+2)))s=!s,s?t=c:e=e.substring(0,t)+" ".repeat(c+2-t)+e.substring(c+2),c++;else{if(s)continue;n&&e[c]!==this.stringChar?o+=e[c]:e[c]===this.stringChar?(n?(o+=e[c],r.push({value:o,type:"string",range:{start:i,end:i+o.length}}),o=""):(i=c,o+=e[c]),n=!n):this.splitParts.includes(e[c])&&!1===n?(""!==o.trim()&&(r.push({value:o,type:"word",range:{start:i,end:i+o.length}}),o=""),this.spaces.includes(e[c])||r.push({value:e[c],type:this.types[e[c]],range:{start:c,end:c+e[c].length}}),i=c+1):o+=e[c]}return""!==o.trim()&&(r.push({value:o,type:"word",range:{start:i,end:i+o.length}}),o=""),r=this.fixStatement(r),r=this.createBlocks(r),this.locateCommands(r),r}fixStatement(e){for(let t=0;t<e.length;t++)for(let s=0;s<this.matchers.length;s++){const n=this.matchers[s];let r=!0;for(let s=0;s<n.match.length;s++){const i=n.match[s];if(e[t+s]){if(e[t+s].type!==i.type){r=!1;break}if(i.match){if(!i.match(e[t+s].value)){r=!1;break}r=!0}else r=!0}else r=!1}if(r){const s=e.slice(t,t+n.match.length),r=s.map((e=>e.value)).join("");e.splice(t,n.match.length,{type:n.becomes,value:r,range:{start:s[0].range.start,end:s[s.length-1].range.end}});break}}return e}createBlocks(e){let t=0,s=0;for(let n=0;n<e.length;n++)switch(e[n].type){case"openbracket":0===s&&(t=n),s++;break;case"closebracket":s--,0===s&&(e.splice(t,n-t+1,{type:"block",block:this.createBlocks(e.slice(t+1,n)),range:{start:e[t].range.start,end:e[n].range.end}}),n=t)}return e}locateCommands(e){for(let t=0;t<e.length;t++)"word"===e[t].type&&e[t+1]&&("block"===e[t+1].type?e[t].type="parameter":(!e[t-1]||e[t-1]&&"command"!==e[t-1].type)&&(e[t].type="command"))}static getEOL(e){return(e.match(/\r/)?"\r":"")+(e.match(/\n/)?"\n":"")}}},2726:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BobProject=void 0;const r=s(9896),i=n(s(6928));class o{constructor(e){this.targets=e,this.dirTargets={},this.dirTargets=o.buildDirTargets(e)}static buildDirTargets(e){let t={};for(let s of e.getTargets()){let n;if(s.relativePath)n=i.default.dirname(s.relativePath);else if("PGM"===s.type){const t=e.getTarget({systemName:s.systemName,type:"MODULE"});t&&(n=i.default.dirname(t.relativePath))}e.binderRequired()&&s.deps.some((e=>"SRVPGM"===e.type))&&(s.deps=s.deps.filter((e=>"SRVPGM"!==e.type)),s.deps.push(e.getBinderTarget())),n&&(void 0===t[n]&&(t[n]=[]),t[n].push(s))}return t}createRules(){let e={};const t=Object.keys(this.dirTargets);let s;if(e["Rules.mk"]=`SUBDIRS = ${t.join(" ")}`,this.targets.binderRequired()){const e=this.targets.getResolvedObjects("SRVPGM").map((e=>i.default.dirname(e.relativePath)));if(1===e.length)s=e[0];else if(e.length>1)throw new Error("All service programs must be in the same directory.")}for(const t in this.dirTargets){const n=this.dirTargets[t],o=i.default.join(t,"Rules.mk"),c=i.default.join(this.targets.getCwd(),o);let l=[];(0,r.existsSync)(c)&&(l=(0,r.readFileSync)(c,{encoding:"utf-8"}).split("\n"));const u=new a(t,l);for(let e of n)u.applyRule(e);t===s&&u.applyRule({...this.targets.getBinderTarget(),deps:this.targets.getResolvedObjects("SRVPGM")}),e[o]=u.getContent()}return e}}t.BobProject=o;class a{constructor(e,t){this.subdir=e,this.parsed=[];for(let e of t){let t={ogLine:e};if(e.includes(":")){const[s,n]=e.split(":");t.target=s.trim().toUpperCase(),t.content=n.trim(),t.isUserWritten=n.includes("=")||n.trimStart().startsWith("#")}this.parsed.push(t)}}applyRule(e){const t=`${e.systemName}.${e.type}`,s=this.parsed.find((e=>e.target===t&&!0!==e.isUserWritten)),n=`${e.relativePath?i.default.relative(this.subdir,e.relativePath)+" ":""}${e.headers?e.headers.join(" ")+" ":""}${e.deps.filter((e=>!0!==e.reference)).map((e=>`${e.systemName}.${e.type}`)).join(" ")}`.trimEnd();s?(s.ogLine=`${t}: ${n}`,s.content=n):this.parsed.push({ogLine:`${t}: ${n}`,target:t,content:n})}getContent(){return this.parsed.map((e=>e.ogLine)).join("\n")}}},3069:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProjectActions=void 0;const r=n(s(6928));t.ProjectActions=class{constructor(e,t){this.targets=e,this.readFileSystem=t,this.actions={}}get getActionPaths(){return Object.keys(this.actions)}async loadAllActions(){const e=this.targets.getCwd(),t=await this.readFileSystem.getFiles(e,"**/actions.json",{dot:!0});for(const s of t){const t=r.default.relative(e,s),n=await this.readFileSystem.readFile(s);try{const e=JSON.parse(n);for(const t of e)t.name&&t.command&&t.environment&&t.extensions&&(t.extensions=t.extensions.map((e=>e.toLowerCase())));this.actions[t]=e}catch(e){console.log(`Error parsing actions.json at ${t}:`,e)}}const s=r.default.join(".vscode","actions.json");this.actions[s]&&(this.actions["actions.json"]=this.actions[s],delete this.actions[s])}getActionForPath(e){let t=[],s=e;for(;;){s=r.default.dirname(s);const e=r.default.join(s,"actions.json");if(this.actions[e]&&t.push(...this.actions[e]),"."===s)break}let n=r.default.extname(e).toLowerCase();return n.startsWith(".")&&(n=n.slice(1)),t=t.filter((e=>e.extensions.includes(n))),t[0]}}},3423:(e,t,s)=>{var n=s(6587),r=Object.create(null),i=s(3519);e.exports=n((function(e,t){return r[e]?(r[e].push(t),null):(r[e]=[t],function(e){return i((function t(){var s=r[e],n=s.length,i=function(e){for(var t=e.length,s=[],n=0;n<t;n++)s[n]=e[n];return s}(arguments);try{for(var o=0;o<n;o++)s[o].apply(null,i)}finally{s.length>n?(s.splice(0,n),process.nextTick((function(){t.apply(null,i)}))):delete r[e]}}))}(e))}))},3506:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;const n=s(6110);t.Logger=class{constructor(){this.logs={}}flush(e){e?this.logs[e]=[]:this.logs={}}fileLog(e,t){switch(t.type){case"info":(0,n.infoOut)(`${e}${t.line?`:${t.line}`:""} - ${t.message}`);break;case"warning":(0,n.warningOut)(`${e}${t.line?`:${t.line}`:""} - ${t.message}`)}this.logs[e]||(this.logs[e]=[]),"rename"===t.type&&this.logs[e].some((e=>"rename"===e.type))||this.logs[e].push(t)}exists(e,t){return this.logs[e]&&this.logs[e].some((e=>e.type===t))}getAllLogs(){return this.logs}getLogsFor(e){return this.logs[e]}}},3519:(e,t,s)=>{var n=s(6587);function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},s=e.name||"Function wrapped with `once`";return t.onceError=s+" shouldn't be called more than once",t.called=!1,t}e.exports=n(r),e.exports.strict=n(i),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},3577:(e,t,s)=>{e.exports=b;var n=s(1455),r=s(4027),i=(r.Minimatch,s(2017)),o=s(4434).EventEmitter,a=s(6928),c=s(2613),l=s(2641),u=s(4700),p=s(1198),h=p.setopts,d=p.ownProp,f=s(3423),m=(s(9023),p.childrenIgnored),g=p.isIgnored,y=s(3519);function b(e,t,s){if("function"==typeof t&&(s=t,t={}),t||(t={}),t.sync){if(s)throw new TypeError("callback provided to sync glob");return u(e,t)}return new v(e,t,s)}b.sync=u;var E=b.GlobSync=u.GlobSync;function v(e,t,s){if("function"==typeof t&&(s=t,t=null),t&&t.sync){if(s)throw new TypeError("callback provided to sync glob");return new E(e,t)}if(!(this instanceof v))return new v(e,t,s);h(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof s&&(s=y(s),this.on("error",s),this.on("end",(function(e){s(null,e)})));var r=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var i=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--r._processing,r._processing<=0&&(i?process.nextTick((function(){r._finish()})):r._finish())}i=!1}b.glob=b,b.hasMagic=function(e,t){var s=function(e,t){if(null===t||"object"!=typeof t)return e;for(var s=Object.keys(t),n=s.length;n--;)e[s[n]]=t[s[n]];return e}({},t);s.noprocess=!0;var n=new v(e,s).minimatch.set;if(!e)return!1;if(n.length>1)return!0;for(var r=0;r<n[0].length;r++)if("string"!=typeof n[0][r])return!0;return!1},b.Glob=v,i(v,o),v.prototype._finish=function(){if(c(this instanceof v),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();p.finish(this),this.emit("end",this.found)}},v.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,s=0;s<this.matches.length;s++)this._realpathSet(s,n)}function n(){0==--e&&t._finish()}},v.prototype._realpathSet=function(e,t){var s=this.matches[e];if(!s)return t();var r=Object.keys(s),i=this,o=r.length;if(0===o)return t();var a=this.matches[e]=Object.create(null);r.forEach((function(s,r){s=i._makeAbs(s),n.realpath(s,i.realpathCache,(function(n,r){n?"stat"===n.syscall?a[s]=!0:i.emit("error",n):a[r]=!0,0==--o&&(i.matches[e]=a,t())}))}))},v.prototype._mark=function(e){return p.mark(this,e)},v.prototype._makeAbs=function(e){return p.makeAbs(this,e)},v.prototype.abort=function(){this.aborted=!0,this.emit("abort")},v.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},v.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var s=e[t];this._emitMatch(s[0],s[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);for(this._processQueue.length=0,t=0;t<n.length;t++){var r=n[t];this._processing--,this._process(r[0],r[1],r[2],r[3])}}}},v.prototype._process=function(e,t,s,n){if(c(this instanceof v),c("function"==typeof n),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,s,n]);else{for(var i,o=0;"string"==typeof e[o];)o++;switch(o){case e.length:return void this._processSimple(e.join("/"),t,n);case 0:i=null;break;default:i=e.slice(0,o).join("/")}var a,u=e.slice(o);null===i?a=".":l(i)||l(e.map((function(e){return"string"==typeof e?e:"[*]"})).join("/"))?(i&&l(i)||(i="/"+i),a=i):a=i;var p=this._makeAbs(a);if(m(this,a))return n();u[0]===r.GLOBSTAR?this._processGlobStar(i,a,p,u,t,s,n):this._processReaddir(i,a,p,u,t,s,n)}},v.prototype._processReaddir=function(e,t,s,n,r,i,o){var a=this;this._readdir(s,i,(function(c,l){return a._processReaddir2(e,t,s,n,r,i,l,o)}))},v.prototype._processReaddir2=function(e,t,s,n,r,i,o,c){if(!o)return c();for(var l=n[0],u=!!this.minimatch.negate,p=l._glob,h=this.dot||"."===p.charAt(0),d=[],f=0;f<o.length;f++)("."!==(g=o[f]).charAt(0)||h)&&(u&&!e?!g.match(l):g.match(l))&&d.push(g);var m=d.length;if(0===m)return c();if(1===n.length&&!this.mark&&!this.stat){for(this.matches[r]||(this.matches[r]=Object.create(null)),f=0;f<m;f++){var g=d[f];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=a.join(this.root,g)),this._emitMatch(r,g)}return c()}for(n.shift(),f=0;f<m;f++)g=d[f],e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(n),r,i,c);c()},v.prototype._emitMatch=function(e,t){if(!this.aborted&&!g(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var s=l(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=s),!this.matches[e][t]){if(this.nodir){var n=this.cache[s];if("DIR"===n||Array.isArray(n))return}this.matches[e][t]=!0;var r=this.statCache[s];r&&this.emit("stat",t,r),this.emit("match",t)}}},v.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var s=this,n=f("lstat\0"+e,(function(n,r){if(n&&"ENOENT"===n.code)return t();var i=r&&r.isSymbolicLink();s.symlinks[e]=i,i||!r||r.isDirectory()?s._readdir(e,!1,t):(s.cache[e]="FILE",t())}));n&&s.fs.lstat(e,n)}},v.prototype._readdir=function(e,t,s){if(!this.aborted&&(s=f("readdir\0"+e+"\0"+t,s))){if(t&&!d(this.symlinks,e))return this._readdirInGlobStar(e,s);if(d(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return s();if(Array.isArray(n))return s(null,n)}this.fs.readdir(e,function(e,t,s){return function(n,r){n?e._readdirError(t,n,s):e._readdirEntries(t,r,s)}}(this,e,s))}},v.prototype._readdirEntries=function(e,t,s){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r="/"===e?e+r:e+"/"+r,this.cache[r]=!0}return this.cache[e]=t,s(null,t)}},v.prototype._readdirError=function(e,t,s){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(t.code+" invalid cwd "+this.cwd);r.path=this.cwd,r.code=t.code,this.emit("error",r),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return s()}},v.prototype._processGlobStar=function(e,t,s,n,r,i,o){var a=this;this._readdir(s,i,(function(c,l){a._processGlobStar2(e,t,s,n,r,i,l,o)}))},v.prototype._processGlobStar2=function(e,t,s,n,r,i,o,a){if(!o)return a();var c=n.slice(1),l=e?[e]:[],u=l.concat(c);this._process(u,r,!1,a);var p=this.symlinks[s],h=o.length;if(p&&i)return a();for(var d=0;d<h;d++)if("."!==o[d].charAt(0)||this.dot){var f=l.concat(o[d],c);this._process(f,r,!0,a);var m=l.concat(o[d],n);this._process(m,r,!0,a)}a()},v.prototype._processSimple=function(e,t,s){var n=this;this._stat(e,(function(r,i){n._processSimple2(e,t,r,i,s)}))},v.prototype._processSimple2=function(e,t,s,n,r){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return r();if(e&&l(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=a.join(this.root,e):(e=a.resolve(this.root,e),i&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),r()},v.prototype._stat=function(e,t){var s=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&d(this.cache,s)){var r=this.cache[s];if(Array.isArray(r)&&(r="DIR"),!n||"DIR"===r)return t(null,r);if(n&&"FILE"===r)return t()}var i=this.statCache[s];if(void 0!==i){if(!1===i)return t(null,i);var o=i.isDirectory()?"DIR":"FILE";return n&&"FILE"===o?t():t(null,o,i)}var a=this,c=f("stat\0"+s,(function(n,r){if(r&&r.isSymbolicLink())return a.fs.stat(s,(function(n,i){n?a._stat2(e,s,null,r,t):a._stat2(e,s,n,i,t)}));a._stat2(e,s,n,r,t)}));c&&a.fs.lstat(s,c)},v.prototype._stat2=function(e,t,s,n,r){if(s&&("ENOENT"===s.code||"ENOTDIR"===s.code))return this.statCache[t]=!1,r();var i="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return r(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,i&&"FILE"===o?r():r(null,o,n)}},3966:function(e,t,s){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(s(2332));class i{constructor(e={}){this.keyword={},this.parameters=e.parameters||[],this.subroutines=e.subroutines||[],this.procedures=e.procedures||[],this.files=e.files||[],this.variables=e.variables||[],this.structs=e.structs||[],this.constants=e.constants||[],this.sqlReferences=e.sqlReferences||[],this.indicators=e.indicators||[...[...Array(98).keys(),"LR","KL"].map((e=>`IN${e.toString().padStart(2,"0")}`)).map((e=>{const t=new r.default("variable");return t.name=e,t.keyword={IND:!0},t}))],this.includes=e.includes||[],this.tags=e.tags||[]}merge(e){return e?new i({parameters:[...this.parameters,...e.parameters],subroutines:[...this.subroutines,...e.subroutines],procedures:[...this.procedures,...e.procedures],variables:[...this.variables,...e.variables],files:[...this.files,...e.files],structs:[...this.structs,...e.structs],constants:[...this.constants,...e.constants],sqlReferences:[...this.sqlReferences,...e.sqlReferences],indicators:[...this.indicators,...e.indicators]}):this}getNames(){const e=new Set;return this.parameters.forEach((t=>e.add(t.name))),this.constants.forEach((t=>e.add(t.name))),this.procedures.forEach((t=>e.add(t.name))),this.files.forEach((t=>e.add(t.name))),this.files.forEach((t=>t.subItems.forEach((t=>e.add(t.name))))),this.subroutines.forEach((t=>e.add(t.name))),this.variables.forEach((t=>e.add(t.name))),this.structs.forEach((t=>e.add(t.name))),this.tags.forEach((t=>e.add(t.name))),Array.from(e)}getDefinitionBlockEnd(e){const t=[this.procedures.filter((t=>t.position.path===e&&void 0!==t.keyword.EXTPROC)).pop(),this.structs.filter((t=>t.position.path===e)).pop(),this.variables.filter((t=>t.position.path===e)).pop(),this.constants.filter((t=>t.position.path===e)).pop(),this.files.filter((t=>t.position.path===e)).pop()].filter((e=>void 0!==e)).map((e=>e.range&&e.range.end?e.range.end:e.position.range.line)).sort(((e,t)=>t-e));return t.length>=1?t[0]:0}find(e,t){e=e.toUpperCase();const s=[...this.files.flatMap((e=>e.subItems)),...this.structs],n=[this.parameters,this.constants,this.procedures,this.files,s,this.subroutines,this.variables,this.indicators,this.tags];for(const t of n){const s=t.find((t=>t.name.toUpperCase()===e));if(s)return s}if(t){const s=this.procedures.find((e=>e.name.toUpperCase()===t));if(s){const t=s.scope.find(e);if(t)return t}}if(s.length>0)for(const t of s)if(!0!==t.keyword.QUALIFIED){const s=t.subItems.find((t=>t.name.toUpperCase()===e));if(s)return s}}findDefinition(e,t){const s=this.procedures.find((t=>e>=t.range.start&&e<=t.range.end));if(s&&s.scope){const e=s.scope.find(t);if(e)return e}const n=this.find(t);if(n)return n}findConstByValue(e,t){const s=this.procedures.find((t=>e>=t.range.start&&e<=t.range.end));if(s&&s.scope){const e=s.scope.constants.find((e=>e.keyword.CONST===t));if(e)return e}const n=this.constants.find((e=>e.keyword.CONST===t));if(n)return n}fixProcedures(){this.procedures.length>0&&this.procedures.forEach((e=>{e.scope&&e.subItems.length>0&&(e.scope.parameters=[...e.subItems],e.scope.fixProcedures())}))}referencesInRange(e,t){let s=[];for(let n=t.start;n<=t.end;n++){const r=i.referenceByOffset(e,this,n);if(r){if(s.some((e=>e.dec.name===r.name)))continue;s.push({dec:r,refs:r.references.filter((e=>e.offset.start>=t.start&&e.offset.end<=t.end)).map((e=>e.offset))})}}return s}static referenceByOffset(e,t,s){const n=["parameters","subroutines","proc