const require_fetcher = require('../fetcher.cjs');
const require_built = require('../config/dist/esm/built.cjs');

//#region ../@intlayer/webpack/dist/esm/chokidar/dist/esm/api/dist/esm/getIntlayerAPI/search.mjs
const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
	const backendURL = intlayerConfig?.editor?.backendURL ?? require_built.built_default?.editor?.backendURL;
	if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
	const AI_API_ROUTE = `${backendURL}/api/search`;
	/**
	* Search documentation
	* @param params - Search parameters containing the input query.
	* @returns Search results with GitHub URLs.
	*/
	const searchDoc = async (params, otherOptions = {}) => await require_fetcher.fetcher(`${AI_API_ROUTE}/doc`, authAPIOptions, otherOptions, {
		method: "GET",
		params
	});
	return { searchDoc };
};

//#endregion
exports.getSearchAPI = getSearchAPI;
//# sourceMappingURL=search.cjs.map