"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHtmlName=exports.isApp=void 0;const fs_extra_1=__importDefault(require("fs-extra")),path_1=__importDefault(require("path")),simulator_1=require("../../../types/simulator"),defaultEntry="index.html";function isApp(e){if(!!e.includes("://"))return Promise.resolve(simulator_1.CompilePathType.sourceCode);if(e.endsWith(".html"))return Promise.resolve(simulator_1.CompilePathType.sourceCode);try{if(fs_extra_1.default.lstatSync(e).isDirectory()&&fs_extra_1.default.readdirSync(e).some(e=>"index.html"===e))return Promise.resolve(simulator_1.CompilePathType.sourceCode)}catch(e){}return Promise.resolve(simulator_1.CompilePathType.unknown)}function getHtmlName(e){return!e.includes("://")&&fs_extra_1.default.lstatSync(e).isDirectory()&&fs_extra_1.default.readdirSync(e).some(e=>"index.html"===e)?path_1.default.join(e,"index.html"):e}exports.isApp=isApp,exports.getHtmlName=getHtmlName;