"use strict";var TcHmi;!function(TcHmi){!function(Functions){!function(Beckhoff){Beckhoff.TeachAsNewRecipe=function(ctx,recipeReference,newRecipeName,newRecipePath){if(!ctx)throw new TypeError("Parameter 'ctx' must be defined.");if(!ctx.success||!ctx.error)throw new TypeError("Parameter 'ctx' must be defined properly. Either 'success' or 'error' or both are missing.");if("function"!=typeof ctx.success||"function"!=typeof ctx.error)throw new TypeError("Parameter 'ctx' must be defined properly. Either 'success' or 'error' or both are not of type 'function'.");recipeReference&&newRecipeName?TcHmi.Server.RecipeManagement.teachAsNewRecipe(recipeReference,null,newRecipeName,newRecipePath,function(data){return data.error?void ctx.error(data.error,{code:data.error,message:TcHmi.Errors[data.error],reason:"Recipe "+recipeReference+" teaching failed",domain:"TcHmi.Functions.Beckhoff.TeachAsNewRecipe",errors:data.details?[data.details]:void 0}):(TcHmi.Log.info("[Source=Function, Module=TcHmi.Functions.Beckhoff.TeachAsNewRecipe] Recipe "+recipeReference+" teached successful."),void ctx.success())}):ctx.success()}}(Functions.Beckhoff||(Functions.Beckhoff={}))}(TcHmi.Functions||(TcHmi.Functions={}))}(TcHmi||(TcHmi={})),TcHmi.Functions.registerFunctionEx("TeachAsNewRecipe","TcHmi.Functions.Beckhoff",TcHmi.Functions.Beckhoff.TeachAsNewRecipe);