"use strict";(function(){"use strict";var e=require("fs");var r=require("util");var a=require("events");var t=require("path");var n=require("./jsUtil");function v(){if(false===this instanceof v){return new v}}r.inherits(v,a.EventEmitter);function i(r){var a=n.getRootPath();var v=e.readFileSync(t.join(a,r),"utf-8");return JSON.parse(v)}v.prototype.getDiagSupportInfos=function(){var e="/db/collect/checkRulePath.json";var r=i(e);var a="/db/collect/modelToType.json";var t=i(a);var n=r.relation;var v=new Array;for(var s=0;s<n.length;s++){var l=n.name;var f=n[s].deviceType;var c=n[s].path;var p=o(f,t.relation);var h=u(c);v[s]={name:n[s].name,deviceModel:p,subTypes:h}}return v};function o(e,r){var a=false;for(var t=0;t<r.length;t++){a=false;var n=r[t];var v=n.devices;if(e.length!==v.length){continue}for(var i=0;i<e.length;i++){for(var o=0;o<v.length;o++){if(v[o]==e[i]){a=true;break}}if(a==false){break}if(a==true){return n.deviceModel}a=false}}return""}function u(e){var r=i(e);var a=new Array;var t=r.checkItems;var n=0;for(var v=0;v<t.length;v++){var o=t[v].subTypes;for(var u=0;u<o.length;u++){a[n]={typeName:o[u].typeName,supportNewDiag:o[u].supportNewDiag};n++}}return a}module.exports=v})();