"use client"
const require_state = require('./state-lPCQsWy5.js');
let react = require("react");
let axios = require("axios");
axios = require_state.__toESM(axios);

//#region recce-source/js/src/lib/api/schemacheck.ts
async function createSchemaDiffCheck(params, client = require_state.axiosClient) {
	return (await client.post("/api/checks", {
		type: "schema_diff",
		params
	})).data;
}

//#endregion
//#region recce-source/js/src/lib/api/select.ts
async function select(input, client = require_state.axiosClient) {
	return (await client.post(`/api/select`, input)).data;
}

//#endregion
//#region recce-source/js/src/lib/api/sessionStorageKeys.ts
const prefix$1 = "recce";
const sessionStorageKeys = {
	recommendationIgnored: `${prefix$1}-recommendation-ignored`,
	recommendationShowed: `${prefix$1}-recommendation-showed`,
	prevRefreshTimeStamp: `${prefix$1}-prev-refresh-timestamp`,
	lineageNotificationDismissed: `${prefix$1}-lineage-notification-dismissed`
};

//#endregion
//#region recce-source/js/src/lib/api/localStorageKeys.ts
const prefix = "recce-";
const localStorageKeys = {
	bypassSaveOverwrite: `${prefix}-bypass-save-overwrite`,
	previewChangeFeedbackID: `${prefix}-preview-change-feedback`,
	prepareEnvGuideID: `${prefix}-prepare-env`
};

//#endregion
//#region recce-source/js/src/lib/api/connectToCloud.ts
async function connectToCloud(client = require_state.axiosClient) {
	return (await client.post("/api/connect")).data;
}

//#endregion
//#region recce-source/js/src/lib/api/user.ts
async function fetchUser(client = require_state.axiosClient) {
	try {
		return (await client.get("/api/users")).data;
	} catch (error) {
		console.error("Error fetching user data:", error);
		throw error;
	}
}
async function fetchGitHubAvatar(userId) {
	try {
		return (await axios.default.get(`https://api.github.com/user/${userId}`)).data.avatar_url;
	} catch (error) {
		console.warn("Failed to fetch GitHub avatar:", error);
		return null;
	}
}

//#endregion
//#region recce-source/js/src/lib/api/version.ts
async function getVersion(client = require_state.axiosClient) {
	return (await client.get("/api/version")).data;
}
function useVersionNumber() {
	const [version, setVersion] = (0, react.useState)("");
	const [latestVersion, setLatestVersion] = (0, react.useState)("");
	const { apiClient } = require_state.useApiConfig();
	(0, react.useEffect)(() => {
		async function fetchVersion() {
			try {
				const { version: version$1, latestVersion: latestVersion$1 } = await getVersion(apiClient);
				setVersion(version$1);
				setLatestVersion(latestVersion$1);
			} catch (error) {
				console.error("Error fetching version number:", error);
			}
		}
		fetchVersion();
	}, [apiClient]);
	return {
		version,
		latestVersion
	};
}

//#endregion
Object.defineProperty(exports, 'connectToCloud', {
  enumerable: true,
  get: function () {
    return connectToCloud;
  }
});
Object.defineProperty(exports, 'createSchemaDiffCheck', {
  enumerable: true,
  get: function () {
    return createSchemaDiffCheck;
  }
});
Object.defineProperty(exports, 'fetchGitHubAvatar', {
  enumerable: true,
  get: function () {
    return fetchGitHubAvatar;
  }
});
Object.defineProperty(exports, 'fetchUser', {
  enumerable: true,
  get: function () {
    return fetchUser;
  }
});
Object.defineProperty(exports, 'getVersion', {
  enumerable: true,
  get: function () {
    return getVersion;
  }
});
Object.defineProperty(exports, 'localStorageKeys', {
  enumerable: true,
  get: function () {
    return localStorageKeys;
  }
});
Object.defineProperty(exports, 'select', {
  enumerable: true,
  get: function () {
    return select;
  }
});
Object.defineProperty(exports, 'sessionStorageKeys', {
  enumerable: true,
  get: function () {
    return sessionStorageKeys;
  }
});
Object.defineProperty(exports, 'useVersionNumber', {
  enumerable: true,
  get: function () {
    return useVersionNumber;
  }
});
//# sourceMappingURL=version-Dh8sZhvs.js.map