{"version":3,"sources":["jsdelivr-header.js","/npm/languagetool-api@1.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,SAAW,QAAQ,kBACnB,QAAW,QAAQ,WACtB,WAAa,CAAC,EAEjB,IAAI,IAAM,KAEV,WAAW,YAAc,SAAS,GACjC,IAAM,CACP,EAEA,WAAW,MAAQ,SAAS,GAC3B,IAAI,EAAM,UAAU,kDAAoD,IAAM,SAAW,GACzF,QAAQ,GAAK,SAAS,EAAO,EAAU,GACtC,GAAI,GAAgC,KAAvB,EAAS,WAiBnB,QAAQ,IAAI,OAjByB,CACrC,IAAI,EAAS,KAAK,MAAM,GACI,GAAzB,EAAO,QAAQ,OAClB,QAAQ,IAAI,8BAEZ,EAAO,QAAQ,SAAQ,SAAS,GAC/B,QAAQ,IAAI,qBAA4B,EAAK,OAAO,EAAM,OAAQ,EAAM,QAAU,KAClD,GAA7B,EAAM,aAAa,OACnB,QAAQ,IAAI,iBAAmB,EAAM,aAAa,GAAG,MAAQ,KAEhE,QAAQ,IAAI,qCAEb,IAEA,QAAQ,IAAI,KACZ,QAAQ,IAAI,6BAA+B,EAAO,SAAS,KAAO,sBAAwB,EAAO,SAAS,QAAU,IACvH,CAGD,GACD,EAEA,WAAW,cAAgB,WAC1B,QAAQ,6CAA6C,SAAS,EAAO,EAAU,GAC1D,KAAK,MAAM,GACjB,SAAQ,SAAS,GAC9B,QAAQ,IAAI,EAAS,KAAO,KAAO,EAAS,SAC7C,GACD,GACD,EAEA,WAAW,KAAO,WACjB,QAAQ,IAAI,SAAS,KAAO,QAAU,SAAS,QAC/C,QAAQ,IAAI,oBAAsB,SAAS,QAC5C,EAEA,OAAO,QAAU","file":"/npm/languagetool-api@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/languagetool-api@1.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const pkg_info = require(\"./package.json\"),\r\n      request  = require(\"request\"),\r\n\t  export_obj = {};\r\n\t  \r\nlet lng = null\r\n\t \r\nexport_obj.setLanguage = function(language_code){\r\n\tlng = language_code\r\n}\r\n\r\nexport_obj.check = function(text){\r\n\tlet url = encodeURI(\"https://languagetool.org/api/v2/check?language=\" + lng + \"&text=\" + text);\r\n\trequest(url, function(error, response, body){\r\n\t\tif(!error && response.statusCode == 200){\r\n\t\t   var output = JSON.parse(body);\r\n\t\t   if(output.matches.length == 0){\r\n\t\t\t  console.log(\"Your spelling was correct.\");\r\n\t\t   } else{\r\n\t\t\t  output.matches.forEach(function(match){\r\n\t\t\t\t  console.log(\"Mistake detected\" + \" (\" + text.substr(match.offset, match.length) + \")\");\r\n\t\t\t\t  if(match.replacements.length != 0){\r\n\t\t\t\t     console.log(\"Did you mean: \" + match.replacements[0].value + \"?\");\r\n\t\t\t\t  } else{\r\n\t\t\t\t\t console.log(\"There are no suggestions avalible.\")\r\n\t\t\t\t  }\r\n\t\t\t  });\t\t\t  \r\n\t\t   }\r\n\t\t   console.log(\" \");\r\n\t\t   console.log(\"This wrapper was made for \" + output.software.name + \" (current version: \" + output.software.version + \")\");\r\n\t\t} else{\r\n\t\t   console.log(error);\r\n\t\t}\r\n\t})\r\n}\r\n\r\nexport_obj.languageCodes = function(){\r\n\trequest(\"https://languagetool.org/api/v2/languages\", function(error, response, body){\r\n\t\tvar language_list = JSON.parse(body);\r\n\t\tlanguage_list.forEach(function(language){\r\n\t\t\tconsole.log(language.name + \": \" + language.longCode);\r\n\t\t});\r\n\t});\r\n}\r\n\t  \r\nexport_obj.info = function(){\r\n\tconsole.log(pkg_info.name + \" by: \" + pkg_info.author);\r\n\tconsole.log(\"Current version: \" + pkg_info.version);\r\n}\r\n\r\nmodule.exports = export_obj"]}