export const IBMI_KNOWN_EXTENSIONS=new Set(['.rpgle','.sqlrpgle','.clle','.cl','.clp','.dspf','.pf','.lf','.prtf','.table.sql','.index.sql','.proc.sql','.bnd','.msgf','.bnddir']);const INELIGIBLE_EXTENSIONS=new Set(['.md','.yml','.yaml','.xml','.html','.htm','.css','.js','.ts','.json','.lock','.log','.sh','.bat','.cmd','.mk','.png','.jpg','.jpeg','.gif','.svg','.ico','.zip','.tar','.gz','.pdf']),INELIGIBLE_FILENAMES=new Set(['.gitignore','.gitattributes','.gitmodules','.editorconfig','.prettierrc','.eslintrc','.npmrc','.env','license','makefile','dockerfile','jenkinsfile','.dockerignore']);export function getIbmiExtension(_0x37d8f3){const _0xb063d0=_0x37d8f3['split']('/')['pop']();for(const _0x5528a1 of IBMI_KNOWN_EXTENSIONS){if(_0x5528a1['includes']('.')&&_0x5528a1!=='.'+_0xb063d0['split']('.')['pop']()){if(_0xb063d0['toLowerCase']()['endsWith'](_0x5528a1))return _0x5528a1;}}const _0x3cb881=_0xb063d0['lastIndexOf']('.');return _0x3cb881>=0x0?_0xb063d0['substring'](_0x3cb881)['toLowerCase']():'';}export function getMemberName(_0x173b27){const _0x24783a=_0x173b27['split']('/')['pop'](),_0x39c0b2=getIbmiExtension(_0x173b27);return _0x39c0b2?_0x24783a['substring'](0x0,_0x24783a['length']-_0x39c0b2['length']):_0x24783a;}export function getSourceFileName(_0x5c85f3){const _0x4f2067=_0x5c85f3['split']('/');return _0x4f2067['length']>=0x2?_0x4f2067[_0x4f2067['length']-0x2]:'';}export function validateIbmiFile(_0x1497ea){const _0x344fb5=_0x1497ea['split']('/')['pop'](),_0x1cbb13=_0x344fb5['toLowerCase']();if(INELIGIBLE_FILENAMES['has'](_0x1cbb13))return{'valid':![],'reason':'\x22'+_0x344fb5+'\x22\x20is\x20not\x20an\x20IBM\x20i\x20source\x20type'};const _0x42665a=_0x1cbb13['lastIndexOf']('.');if(_0x42665a>=0x0){const _0x552d8c=_0x1cbb13['substring'](_0x42665a);if(INELIGIBLE_EXTENSIONS['has'](_0x552d8c))return{'valid':![],'reason':'\x22'+_0x552d8c+'\x22\x20files\x20are\x20not\x20IBM\x20i\x20source\x20types'};}const _0x12d3b6=getSourceFileName(_0x1497ea),_0x34f4d4=getMemberName(_0x1497ea);if(_0x12d3b6['length']>0xa)return{'valid':![],'reason':'Directory\x20name\x20\x22'+_0x12d3b6+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20source\x20file\x20name\x20limit)'};if(_0x34f4d4['length']>0xa)return{'valid':![],'reason':'File\x20name\x20\x22'+_0x34f4d4+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20name\x20limit)'};const _0x55ff9d=getIbmiExtension(_0x1497ea);if(_0x55ff9d){const _0x1d0a2d=_0x55ff9d['startsWith']('.')?_0x55ff9d['substring'](0x1):_0x55ff9d;if(_0x1d0a2d['length']>0xa)return{'valid':![],'reason':'Extension\x20\x22'+_0x55ff9d+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20type\x20limit)'};}return{'valid':!![]};}export function hasKnownIbmiExtension(_0x3b6d5c){const _0x1edf29=getIbmiExtension(_0x3b6d5c);return IBMI_KNOWN_EXTENSIONS['has'](_0x1edf29);}