import{a as r}from"./asyncComputed-Dxf4RCwC.js";import"./jwt-decode.esm-BYfS37aG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="36eb7df7-00ff-4054-9d81-7a07782abc0d",t._sentryDebugIdIdentifier="sentry-dbid-36eb7df7-00ff-4054-9d81-7a07782abc0d")}catch{}})();class o{async check(){return(await fetch("/_editor/api/linters/check")).json()}async fix(e,s){const i=await fetch(`/_editor/api/linters/fix/${e}/${s}`,{method:"POST"});if(!i.ok)throw new Error("Failed to fix");return n.refetch(),i.json()}}const a=new o,n=r(async()=>(await a.check()).map(e=>new f(e)));class c{name;label;ruleName;constructor(e,s){this.name=e.name,this.label=e.label,this.ruleName=s}async fix(){await a.fix(this.ruleName,this.name)}}class l{constructor(e,s){this.ruleName=s,this.label=e.label,this.fixes=e.fixes.map(i=>new c(i,s))}label;fixes}class f{name;label;type;issues;fixWithAi;constructor(e){this.name=e.name,this.label=e.label,this.type=e.type,this.issues=e.issues.map(s=>new l(s,this.name)),this.fixWithAi=e.fixWithAi}static get asyncComputed(){return n}static fromName(e){const s=n.result.value?.find(i=>i.name===e);if(!s)throw new Error(`Rule ${e} not found`);return s}}export{f as L};
//# sourceMappingURL=linters-D57S9tZc.js.map
