"use strict";
exports.id = 522;
exports.ids = [522];
exports.modules = {

/***/ 522:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Z: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9648);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([axios__WEBPACK_IMPORTED_MODULE_0__]);
axios__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];

const fetchData = async (endpoint, language = "ar")=>{
    const config = {
        headers: {
            "Accept-Language": language
        }
    };
    const baseUrl = "https://back-soft.softlabprog.cloud/api";
    try {
        const response = await axios__WEBPACK_IMPORTED_MODULE_0__["default"].get(`${baseUrl}/${endpoint}`, config);
        if (response.status !== 200) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.data;
    } catch (error) {
        console.error("Error fetching data:", error);
        return {
            data: []
        };
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fetchData);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ })

};
;