(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[20],{

/***/ "./src/services/AlimentosDietaService.js":
/*!***********************************************!*\
  !*** ./src/services/AlimentosDietaService.js ***!
  \***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _services_Api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/services/Api */ \"./src/services/Api.js\");\n\n\nvar resource = 'informacion/nutricional/dietas/alimentos';\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  fetchGrupoAlimentos: function fetchGrupoAlimentos() {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/lista\"));\n  },\n  fetchAlimentosByGrupo: function fetchAlimentosByGrupo(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/\").concat(id)); //return Api().get(`informacion/nutricional/dietas/paciente/alimentos/${id}`)\n  },\n  fetchAlimentosByGrupo2: function fetchAlimentosByGrupo2(id) {\n    //return Api().get(`${resource}/${id}`)\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"informacion/nutricional/dietas/paciente/alimentos/\".concat(id));\n  },\n  alimentosReceta: function alimentosReceta(id) {\n    //return Api().get(`${resource}/${id}`)\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"informacion/nutricional/dietas/menus/obtener/alimento/\".concat(id));\n  },\n  todosAlimentos: function todosAlimentos(listQuery, perPage, page) {\n    //return Api().get(`${resource}/${id}`)\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/catalogo/por-usuario/smae/\".concat(perPage, \"/\").concat(page), listQuery);\n  },\n  guardartodosAlimentos: function guardartodosAlimentos(id_alimento, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/catalogo/por/usuario/smae/actualizar/\".concat(id_alimento), form);\n  },\n  deleteAlimento: function deleteAlimento(id_alimento, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/catalogo/eliminar/smae/\".concat(id_alimento), form);\n  },\n  todosAlimentosSMAE: function todosAlimentosSMAE() {\n    //return Api().get(`${resource}/${id}`)\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"/catalogo/completo/smae\");\n  },\n  recetas: function recetas(listQuery, perPage, page) {\n    //return Api().get(`${resource}/${id}`)\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/informacion/nutricional/dietas/lista/paginada/nutriologo/\".concat(perPage, \"/\").concat(page), listQuery);\n  },\n  activarReceta: function activarReceta(id_dieta, estatus) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().put(\"informacion/nutricional/dietas/nutriologo/\".concat(id_dieta, \"/guardar/\").concat(estatus));\n  },\n  sintomas: function sintomas(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"/informacion/nutricional/dieteticos/sintomas/\".concat(id));\n  },\n  sintomasExtras: function sintomasExtras(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"/informacion/nutricional/dieteticos/sintomas/extras/\".concat(id));\n  },\n  postSintomas: function postSintomas(id, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/informacion/nutricional/dieteticos/sintomas/guardar/\".concat(id), form);\n  },\n  postSintomasExtra: function postSintomasExtra(id, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/informacion/nutricional/dieteticos/sintomas/guardar/extra/\".concat(id), form);\n  },\n  deleteSintomaExtra: function deleteSintomaExtra(monitoreo, id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"/informacion/nutricional/dieteticos/sintomas/delete/extra/\".concat(monitoreo, \"/\").concat(id));\n  }\n});\n\n//# sourceURL=webpack:///./src/services/AlimentosDietaService.js?");

/***/ }),

/***/ "./src/services/RecetaService.js":
/*!***************************************!*\
  !*** ./src/services/RecetaService.js ***!
  \***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _services_Api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/services/Api */ \"./src/services/Api.js\");\n\n\nvar resource = 'informacion/nutricional/dietas';\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  fetchList: function fetchList(listQuery) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/trae/recetas\"), {\n      params: listQuery\n    });\n  },\n  fetchListP: function fetchListP(listQuery, perPage, page) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"\".concat(resource, \"/trae/recetas/paginado/\").concat(perPage, \"/\").concat(page), listQuery);\n  },\n  fetchAll: function fetchAll() {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/trae/cat/recetas\"));\n  },\n  eliminar: function eliminar(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().delete(\"\".concat(resource, \"/receta/suprimir/\").concat(id));\n  },\n  create: function create(form) {\n    var config = {\n      headers: {\n        'Content-Type': 'multipart/form-data'\n      }\n    };\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"\".concat(resource, \"/agregar/receta\"), form, config);\n  },\n  getById: function getById(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/trae/receta/\").concat(id));\n  },\n  update: function update(id, form) {\n    var config = {\n      headers: {\n        'Content-Type': 'multipart/form-data'\n      }\n    };\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"\".concat(resource, \"/actualizar/receta/\").concat(id), form, config);\n  },\n  // fetchListAlimentos() {\n  //   return Api().get(`${resource}/`)\n  // },\n  addAlimento: function addAlimento(idDieta, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"\".concat(resource, \"/agregar/alimentos/\").concat(idDieta), form);\n  },\n  addAlimentoMenu: function addAlimentoMenu(dietaMenu, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"\".concat(resource, \"/menus/agregar/alimento/\").concat(dietaMenu), form);\n  },\n  deleteAlimento: function deleteAlimento(id) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().delete(\"\".concat(resource, \"/elimina/ingrediente/\").concat(id));\n  },\n  updateIngrediente: function updateIngrediente(idIngrediente, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().put(\"\".concat(resource, \"/actualizar/ingrediente/cantidad/\").concat(idIngrediente), form);\n  },\n  updateIngredienteE: function updateIngredienteE(idIngrediente, form) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().put(\"\".concat(resource, \"/actualizar/ingrediente/equivalente/\").concat(idIngrediente), form);\n  },\n  uploadFile: function uploadFile(form) {\n    var config = {\n      headers: {\n        'Content-Type': 'multipart/form-data'\n      }\n    };\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().post(\"informacion/nutricional/carga/masiva/recetas\", form, config);\n  },\n  activarReceta: function activarReceta(id_dieta, estatus) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().put(\"\".concat(resource, \"/nutriologo/\").concat(id_dieta, \"/guardar/\").concat(estatus));\n  },\n  listaDietas: function listaDietas() {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().get(\"\".concat(resource, \"/lista/nutriologo\"));\n  },\n  duplicarReceta: function duplicarReceta(id_monitoreo, id_dieta) {\n    return Object(_services_Api__WEBPACK_IMPORTED_MODULE_1__[\"default\"])().put(\"\".concat(resource, \"/duplicar/\").concat(id_monitoreo, \"/\").concat(id_dieta));\n  }\n});\n\n//# sourceURL=webpack:///./src/services/RecetaService.js?");

/***/ }),

/***/ "./src/views/Recetas/useRecetas.js":
/*!*****************************************!*\
  !*** ./src/views/Recetas/useRecetas.js ***!
  \*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! regenerator-runtime/runtime.js */ \"./node_modules/regenerator-runtime/runtime.js\");\n/* harmony import */ var regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _vue_composition_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @vue/composition-api */ \"./node_modules/@vue/composition-api/dist/vue-composition-api.mjs\");\n/* harmony import */ var vue_toastification_composition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-toastification/composition */ \"./node_modules/vue-toastification/composition/index.js\");\n/* harmony import */ var vue_toastification_composition__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_toastification_composition__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @core/components/toastification/ToastificationContent.vue */ \"./src/@core/components/toastification/ToastificationContent.vue\");\n/* harmony import */ var _services_AlimentosDietaService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/services/AlimentosDietaService */ \"./src/services/AlimentosDietaService.js\");\n/* harmony import */ var _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/services/RecetaService */ \"./src/services/RecetaService.js\");\n\n\n // Notification\n\n\n\n\n\n\nvar UseRecetas = function UseRecetas() {\n  var perPage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n  var toast = Object(vue_toastification_composition__WEBPACK_IMPORTED_MODULE_3__[\"useToast\"])();\n  var loading = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(false);\n  var saving = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(false);\n  var grupoAlimentos = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var todosLosAlimentos = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var alimentos = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var gramosCH = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var vitaminas = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])({});\n  var minerales = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])({});\n  var gramosG = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var gramosP = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var kcalT = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var alimentosSeleccionados = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var currentPage = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(1);\n  var page = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(1);\n  var paginador = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(5);\n  var perPage2 = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(6);\n  var blank = {\n    id: \"\",\n    titulo: \"\",\n    file: null,\n    foto: \"\",\n    tiempo_preparacion: '',\n    dificultad_id: '',\n    url_video: '',\n    preparacion: '',\n    receta_ingrediente: [],\n    alimentos: [],\n    alimentosSeleccionados: [],\n    tipo_receta_id: null\n  };\n  var receta = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"reactive\"])(blank);\n  var recetas = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var catalogoRecetas = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])([]);\n  var listQuery = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"reactive\"])({\n    total: 0,\n    per_page: perPage,\n    page: 1,\n    totalPages: 1,\n    query: '',\n    statusFilter: '',\n    deviceTypeFilter: '',\n    sort: 'asc',\n    sortBy: 'id',\n    from: 0,\n    to: 0\n  });\n  Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"watch\"])(function () {\n    return listQuery.per_page;\n  }, function (currentValue, oldValue) {\n    return fetchList();\n  });\n  Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"watch\"])(function () {\n    return listQuery.page;\n  }, function (currentValue, oldValue) {\n    return fetchList();\n  });\n  Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"watch\"])(function () {\n    return listQuery.query;\n  }, function (currentValue, oldValue) {\n    return fetchList();\n  });\n  Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"watch\"])(function () {\n    return listQuery.deviceTypeFilter;\n  }, function (n, old) {\n    return fetchList();\n  });\n  Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"watch\"])(function () {\n    return listQuery.statusFilter;\n  }, function (n, old) {\n    return fetchList();\n  });\n\n  var fetchList = function fetchList(receta, porPagina, pagina, palabra) {\n    loading.value = true; // const form = new FormData\n    // form.append('usuarioID', receta.usuarioID)\n    // form.append('tipoUsuario', receta.tipoUsuario)\n    // form.append('busqueda', palabra)\n\n    _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].fetchListP(palabra, porPagina, pagina).then(function (response) {\n      recetas.value = response.data.cuerpo[0];\n      paginador.value = response.data.cuerpo[1];\n      setTimeout(function () {\n        loading.value = false;\n      }, 990); // callback(response.data)\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar Recetas\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var fetchAll = function fetchAll() {\n    loading.value = true;\n    _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].fetchAll().then(function (response) {\n      catalogoRecetas.value = response.data.cuerpo;\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar Recetas\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var eliminarReceta = function eliminarReceta(id) {\n    loading.value = true;\n    _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].eliminar(id).then(function (response) {\n      //catalogoRecetas.value = response.data.cuerpo\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Datos eliminados Correctamente!\",\n          icon: 'CheckCircleIcon',\n          variant: 'success'\n        }\n      });\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar Recetas\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var save = /*#__PURE__*/function () {\n    var _ref = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee(receta) {\n      var form, response;\n      return regeneratorRuntime.wrap(function _callee$(_context) {\n        while (1) {\n          switch (_context.prev = _context.next) {\n            case 0:\n              saving.value = true;\n              form = new FormData();\n              form.append('titulo', receta.titulo);\n              form.append('tiempo_preparacion', receta.tiempo_preparacion);\n              form.append('dificultad_id', receta.dificultad_id);\n              form.append('url_video', receta.url_video);\n              form.append('preparacion', receta.preparacion);\n              form.append('cat_tipo_receta_id', receta.cat_tipo_receta_id);\n              form.append('usuarioID', receta.usuarioID);\n              form.append('tipoUsuario', receta.tipoUsuario);\n              form.append('tipo_receta_id', receta.tipo_receta_id);\n\n              if (receta.file) {\n                form.append('foto', receta.file);\n              }\n\n              _context.prev = 12;\n              _context.next = 15;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].create(form);\n\n            case 15:\n              response = _context.sent;\n              saving.value = false;\n              resetData();\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Receta registrada correctamente!!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context.abrupt(\"return\", response);\n\n            case 22:\n              _context.prev = 22;\n              _context.t0 = _context[\"catch\"](12);\n              saving.value = false;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al guardar receta\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context.t0;\n\n            case 27:\n            case \"end\":\n              return _context.stop();\n          }\n        }\n      }, _callee, null, [[12, 22]]);\n    }));\n\n    return function save(_x) {\n      return _ref.apply(this, arguments);\n    };\n  }();\n\n  var update = /*#__PURE__*/function () {\n    var _ref2 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id, receta) {\n      var form, response;\n      return regeneratorRuntime.wrap(function _callee2$(_context2) {\n        while (1) {\n          switch (_context2.prev = _context2.next) {\n            case 0:\n              saving.value = true;\n              form = new FormData();\n              form.append('titulo', receta.titulo);\n              form.append('tiempo_preparacion', receta.tiempo_preparacion);\n              form.append('dificultad_id', receta.dificultad_id);\n              form.append('url_video', receta.url_video);\n              form.append('preparacion', receta.preparacion);\n              form.append('cat_tipo_receta_id', receta.cat_tipo_receta_id);\n              form.append('tipo_receta_id', receta.tipo_receta_id);\n              form.append('_method', 'PUT');\n\n              if (receta.file) {\n                form.append('foto', receta.file);\n              }\n\n              _context2.prev = 11;\n              _context2.next = 14;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].update(id, form);\n\n            case 14:\n              response = _context2.sent;\n              saving.value = false;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Receta actualizada correctamente!!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context2.abrupt(\"return\", response);\n\n            case 20:\n              _context2.prev = 20;\n              _context2.t0 = _context2[\"catch\"](11);\n              saving.value = false;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al actualizar receta\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context2.t0;\n\n            case 25:\n            case \"end\":\n              return _context2.stop();\n          }\n        }\n      }, _callee2, null, [[11, 20]]);\n    }));\n\n    return function update(_x2, _x3) {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n\n  var updateCantidadIngrediente = /*#__PURE__*/function () {\n    var _ref3 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(idIngrediente, data) {\n      var response;\n      return regeneratorRuntime.wrap(function _callee3$(_context3) {\n        while (1) {\n          switch (_context3.prev = _context3.next) {\n            case 0:\n              _context3.prev = 0;\n              _context3.next = 3;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].updateIngrediente(idIngrediente, data);\n\n            case 3:\n              response = _context3.sent;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Ingrediente actualizado correctamente!!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context3.abrupt(\"return\", response);\n\n            case 8:\n              _context3.prev = 8;\n              _context3.t0 = _context3[\"catch\"](0);\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al actualizar ingrediente\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context3.t0;\n\n            case 12:\n            case \"end\":\n              return _context3.stop();\n          }\n        }\n      }, _callee3, null, [[0, 8]]);\n    }));\n\n    return function updateCantidadIngrediente(_x4, _x5) {\n      return _ref3.apply(this, arguments);\n    };\n  }();\n\n  var updateCantidadIngredienteE = /*#__PURE__*/function () {\n    var _ref4 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(idIngrediente, data) {\n      var response;\n      return regeneratorRuntime.wrap(function _callee4$(_context4) {\n        while (1) {\n          switch (_context4.prev = _context4.next) {\n            case 0:\n              _context4.prev = 0;\n              _context4.next = 3;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].updateIngredienteE(idIngrediente, data);\n\n            case 3:\n              response = _context4.sent;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Ingrediente actualizado correctamente!!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context4.abrupt(\"return\", response);\n\n            case 8:\n              _context4.prev = 8;\n              _context4.t0 = _context4[\"catch\"](0);\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al actualizar ingrediente\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context4.t0;\n\n            case 12:\n            case \"end\":\n              return _context4.stop();\n          }\n        }\n      }, _callee4, null, [[0, 8]]);\n    }));\n\n    return function updateCantidadIngredienteE(_x6, _x7) {\n      return _ref4.apply(this, arguments);\n    };\n  }();\n\n  var getGrupoAlimentos = function getGrupoAlimentos() {\n    loading.value = true;\n    _services_AlimentosDietaService__WEBPACK_IMPORTED_MODULE_5__[\"default\"].fetchGrupoAlimentos().then(function (response) {\n      grupoAlimentos.value = response.data.cuerpo;\n      loading.value = false;\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar Grupo de alimentos\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var getAllAlimentos = function getAllAlimentos() {\n    loading.value = true;\n    _services_AlimentosDietaService__WEBPACK_IMPORTED_MODULE_5__[\"default\"].todosAlimentosSMAE().then(function (response) {\n      todosLosAlimentos.value = response.data.cuerpo;\n      loading.value = false;\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar todos los alimentos\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var getReceta = function getReceta(id) {\n    loading.value = true;\n    _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getById(id).then(function (response) {\n      // grupoAlimentos.value = response.data.cuerpo\n      Object.assign(receta, response.data.cuerpo.resultado);\n      vitaminas.value = response.data.cuerpo.vitaminas;\n      minerales.value = response.data.cuerpo.minerales;\n      gramosCH.value = response.data.cuerpo.resultado.gramos_carbohidratos_receta;\n      gramosG.value = response.data.cuerpo.resultado.gramos_grasas_receta;\n      gramosP.value = response.data.cuerpo.resultado.gramos_proteinas_receta;\n      kcalT.value = response.data.cuerpo.resultado.kcal_receta;\n      loading.value = false;\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar receta\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var getAlimentosByGrupo = function getAlimentosByGrupo(idGrupo) {\n    loading.value = true;\n    _services_AlimentosDietaService__WEBPACK_IMPORTED_MODULE_5__[\"default\"].fetchAlimentosByGrupo(idGrupo).then(function (response) {\n      alimentos.value = response.data.cuerpo;\n      loading.value = false;\n    }).catch(function (e) {\n      loading.value = false;\n      toast({\n        component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n        props: {\n          title: \"Error al cargar alimentos\",\n          icon: 'AlertTriangleIcon',\n          variant: 'danger'\n        }\n      });\n    });\n  };\n\n  var resetData = function resetData() {\n    Object.assign(receta, blank);\n  };\n\n  var addIngrediente = /*#__PURE__*/function () {\n    var _ref5 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(idReceta, ingrediente) {\n      var response;\n      return regeneratorRuntime.wrap(function _callee5$(_context5) {\n        while (1) {\n          switch (_context5.prev = _context5.next) {\n            case 0:\n              _context5.prev = 0;\n              _context5.next = 3;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].addAlimento(idReceta, ingrediente);\n\n            case 3:\n              response = _context5.sent;\n              resetData();\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Ingrediente agregado correctamente!!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context5.abrupt(\"return\", response);\n\n            case 9:\n              _context5.prev = 9;\n              _context5.t0 = _context5[\"catch\"](0);\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al agregar ingrediente\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context5.t0;\n\n            case 13:\n            case \"end\":\n              return _context5.stop();\n          }\n        }\n      }, _callee5, null, [[0, 9]]);\n    }));\n\n    return function addIngrediente(_x8, _x9) {\n      return _ref5.apply(this, arguments);\n    };\n  }();\n\n  var deleteIngrediente = /*#__PURE__*/function () {\n    var _ref6 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(id) {\n      var response;\n      return regeneratorRuntime.wrap(function _callee6$(_context6) {\n        while (1) {\n          switch (_context6.prev = _context6.next) {\n            case 0:\n              _context6.prev = 0;\n              _context6.next = 3;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].deleteAlimento(id);\n\n            case 3:\n              response = _context6.sent;\n              return _context6.abrupt(\"return\", response);\n\n            case 7:\n              _context6.prev = 7;\n              _context6.t0 = _context6[\"catch\"](0);\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al eliminar ingrediente\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context6.t0;\n\n            case 11:\n            case \"end\":\n              return _context6.stop();\n          }\n        }\n      }, _callee6, null, [[0, 7]]);\n    }));\n\n    return function deleteIngrediente(_x10) {\n      return _ref6.apply(this, arguments);\n    };\n  }();\n\n  var uploading = Object(_vue_composition_api__WEBPACK_IMPORTED_MODULE_2__[\"ref\"])(false);\n\n  var uploadFile = /*#__PURE__*/function () {\n    var _ref7 = Object(_Users_ruben_Development_nutrifull_front_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(data) {\n      var form, response;\n      return regeneratorRuntime.wrap(function _callee7$(_context7) {\n        while (1) {\n          switch (_context7.prev = _context7.next) {\n            case 0:\n              form = new FormData();\n              form.append('archivo', data);\n              uploading.value = true;\n              _context7.prev = 3;\n              _context7.next = 6;\n              return _services_RecetaService__WEBPACK_IMPORTED_MODULE_6__[\"default\"].uploadFile(form);\n\n            case 6:\n              response = _context7.sent;\n              uploading.value = false;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Datos cargados Correctamente!\",\n                  icon: 'CheckCircleIcon',\n                  variant: 'success'\n                }\n              });\n              return _context7.abrupt(\"return\", response);\n\n            case 12:\n              _context7.prev = 12;\n              _context7.t0 = _context7[\"catch\"](3);\n              uploading.value = false;\n              toast({\n                component: _core_components_toastification_ToastificationContent_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n                props: {\n                  title: \"Error al Subir archivo\",\n                  icon: 'AlertTriangleIcon',\n                  variant: 'danger'\n                }\n              });\n              throw _context7.t0;\n\n            case 17:\n            case \"end\":\n              return _context7.stop();\n          }\n        }\n      }, _callee7, null, [[3, 12]]);\n    }));\n\n    return function uploadFile(_x11) {\n      return _ref7.apply(this, arguments);\n    };\n  }();\n\n  return {\n    vitaminas: vitaminas,\n    minerales: minerales,\n    todosLosAlimentos: todosLosAlimentos,\n    getAllAlimentos: getAllAlimentos,\n    gramosCH: gramosCH,\n    gramosG: gramosG,\n    gramosP: gramosP,\n    kcalT: kcalT,\n    eliminarReceta: eliminarReceta,\n    receta: receta,\n    saving: saving,\n    getReceta: getReceta,\n    save: save,\n    update: update,\n    resetData: resetData,\n    updateCantidadIngredienteE: updateCantidadIngredienteE,\n    getGrupoAlimentos: getGrupoAlimentos,\n    getAlimentosByGrupo: getAlimentosByGrupo,\n    grupoAlimentos: grupoAlimentos,\n    alimentos: alimentos,\n    alimentosSeleccionados: alimentosSeleccionados,\n    perPage2: perPage2,\n    currentPage: currentPage,\n    page: page,\n    paginador: paginador,\n    loading: loading,\n    recetas: recetas,\n    catalogoRecetas: catalogoRecetas,\n    listQuery: listQuery,\n    fetchList: fetchList,\n    fetchAll: fetchAll,\n    addIngrediente: addIngrediente,\n    deleteIngrediente: deleteIngrediente,\n    updateCantidadIngrediente: updateCantidadIngrediente,\n    uploadFile: uploadFile,\n    uploading: uploading\n  };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (UseRecetas);\n\n//# sourceURL=webpack:///./src/views/Recetas/useRecetas.js?");

/***/ })

}]);