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(_0x2d9fe){const _0x2547f0=_0x2d9fe['split']('/')['pop']();for(const _0x1b152b of IBMI_KNOWN_EXTENSIONS){if(_0x1b152b['includes']('.')&&_0x1b152b!=='.'+_0x2547f0['split']('.')['pop']()){if(_0x2547f0['toLowerCase']()['endsWith'](_0x1b152b))return _0x1b152b;}}const _0x144d44=_0x2547f0['lastIndexOf']('.');return _0x144d44>=0x0?_0x2547f0['substring'](_0x144d44)['toLowerCase']():'';}export function getMemberName(_0x2a4318){const _0x4a5c92=_0x2a4318['split']('/')['pop'](),_0xad44a9=getIbmiExtension(_0x2a4318);return _0xad44a9?_0x4a5c92['substring'](0x0,_0x4a5c92['length']-_0xad44a9['length']):_0x4a5c92;}export function getSourceFileName(_0x4d360f){const _0x5c2902=_0x4d360f['split']('/');return _0x5c2902['length']>=0x2?_0x5c2902[_0x5c2902['length']-0x2]:'';}export function validateIbmiFile(_0x1cdea3){const _0x17abc4=_0x1cdea3['split']('/')['pop'](),_0x27aa14=_0x17abc4['toLowerCase']();if(INELIGIBLE_FILENAMES['has'](_0x27aa14))return{'valid':![],'reason':'\x22'+_0x17abc4+'\x22\x20is\x20not\x20an\x20IBM\x20i\x20source\x20type'};const _0x4c2cc4=_0x27aa14['lastIndexOf']('.');if(_0x4c2cc4>=0x0){const _0x28b626=_0x27aa14['substring'](_0x4c2cc4);if(INELIGIBLE_EXTENSIONS['has'](_0x28b626))return{'valid':![],'reason':'\x22'+_0x28b626+'\x22\x20files\x20are\x20not\x20IBM\x20i\x20source\x20types'};}const _0xb75144=getSourceFileName(_0x1cdea3),_0x5aef6d=getMemberName(_0x1cdea3);if(_0xb75144['length']>0xa)return{'valid':![],'reason':'Directory\x20name\x20\x22'+_0xb75144+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20source\x20file\x20name\x20limit)'};if(_0x5aef6d['length']>0xa)return{'valid':![],'reason':'File\x20name\x20\x22'+_0x5aef6d+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20name\x20limit)'};const _0x13eb67=getIbmiExtension(_0x1cdea3);if(_0x13eb67){const _0x998943=_0x13eb67['startsWith']('.')?_0x13eb67['substring'](0x1):_0x13eb67;if(_0x998943['length']>0xa)return{'valid':![],'reason':'Extension\x20\x22'+_0x13eb67+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20type\x20limit)'};}return{'valid':!![]};}export function hasKnownIbmiExtension(_0x3c7ccb){const _0x448793=getIbmiExtension(_0x3c7ccb);return IBMI_KNOWN_EXTENSIONS['has'](_0x448793);}