@eslint-sukka/eslint-plugin-sukka-full 9.0.1 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +21 -23
  2. package/package.json +6 -6
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- let e,t,r,n;"use strict";var o=Map,a=RegExp,i=Set,s=WeakMap,l=WeakSet;var u,p,c=require("eslint-plugin-sukka"),d=require("@eslint-sukka/shared"),m=require("node:fs"),f=require("node:vm"),g=require("url"),y=require("path"),h=require("fs"),x=require("vm"),b=require("worker_threads"),E=require("node:assert/strict"),v=require("node:util/types"),S=require("node:path"),C=require("node:util"),D=require("eslint/use-at-your-own-risk"),T="u">typeof document?document.currentScript:null;function A(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function w(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function k(e){return e?.type==="MemberExpression"}function I(e){return e?.type==="AwaitExpression"}function j(e,t){return!!w(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function F(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function B(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function R(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function P({create:e,meta:t,name:r}){return t.docs&&!t.docs.url&&(t.docs.url=new URL(r,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,s=(n=t.defaultOptions||[],o=r.options,a=structuredClone(n),null==o||a.forEach((e,t)=>{if(void 0!==o[t]){let r=o[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?a[t]=r:a[t]=function e(t={},r={}){return t?r?Object.fromEntries([...new i([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]})):t:r}(e,r)}}),a);return e(r,s)},meta:t,name:r}}function L(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var N=P({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!j(t.callee.property,"flatMap")||!(B(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(R(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&R(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let $=new i(["href","pathname","search","hash","origin"]);var M=P({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},create:e=>({AssignmentExpression(t){let r=function(e,t){if(j(e,t))return e;for(;k(e);){if(j(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=O(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=O(t.parent);if($.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function O(e){if(k(e)&&w(e.property))return e.property.name}var q=P({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),U=P({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let W=/^toLocale(?<name>Upper|Lower)Case$/g;var V=P({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},create:e=>({CallExpression(t){if(t.arguments.length>0||!k(t.callee)||!w(t.callee.property))return;let{property:r}=t.callee,n=W.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),_=P({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked||""),o=A(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let z=/\P{ASCII}/u;function K(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function G(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=J(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${X(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new i(e.regex.flags);n.add("u");let o=new a(J(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function J(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${X(t)}}`:`\\u${X(t)}`})}function X(e){return e.toString(16).padStart(4,"0").toUpperCase()}P({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"},defaultOptions:[{pattern:z.source,flags:"u",only:void 0}]},create(e,[{pattern:t,flags:r,only:n}]){let o=t?new a(t,r):z;return K(o,(t,r)=>{if(n&&n!==r)return;let a=G(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let Y=/[\u061C\u202A-\u202E\u2066-\u2069]/;var H=P({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},create:e=>K(Y,(t,r)=>{let n=RegExp(Y.source,"gu"),o={kind:r,text:J(t.value,n)},a=G(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let Q=(n=[/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u].map(e=>"string"==typeof e?e:e.source).join(""),RegExp(`[${n}]`,"u"));var Z=P({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},create:e=>K(Q,t=>{let r=G(t,RegExp(Q.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),ee=P({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(et);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&R(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!I(t=r)||A(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${I(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function et(e){return"ReturnStatement"===e.type&&w(e.argument)}var er=P({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},create:e=>({BlockStatement({parent:t,body:r}){if(!B(t))return;let n=function(e,t){let r=t.find(en);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>R(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function en(e){return"ReturnStatement"===e.type&&w(e.argument)}var eo=P({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"},defaultOptions:[{maximumStatements:0}]},create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!B(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),ea=P({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return j(e,"XMLHttpRequest")})(t)||j((r=t).callee,"ActiveXObject")&&F(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return j(e,t)||k(e)&&j(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return j(e,r)&&k(t)&&j(t.property,"load")||k(e)&&j(e.object,r)&&j(e.property,["ajax","get","post","getJSON","getScript"])}(t)||ei(t,"axios")||ei(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function ei(e,t){return j(e.callee,"require")&&F(e.arguments[0],t)}let es=new i(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var el=P({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!es.has(t.callee.name)||function(e){if(!j(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||F(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),eu=P({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},create(e){L(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(j(a,"toString")||F(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),ep=P({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ec=new i(["BigInt","Boolean","Number","String","Symbol"]);var ed=P({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ec.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),em=P({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},create(e){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let ef=/\.(?:[cm]?ts|tsx)$/i,eg=/\.d\.(?:[cm]?ts|ts)$/i;var ey=P({name:"require-project-reference",meta:{type:"problem",docs:{description:"Require project references for local package imports",requiresTypeChecking:!0},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0}},additionalProperties:!1}],messages:{missingReference:"This local package is not covered by a project reference. Add its project to this tsconfig.json references and enable declarationMap."},defaultOptions:[{ignore:[]}]},create(e,[{ignore:t}]){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:r,program:n}=e.sourceCode.parserServices;return{ImportDeclaration(o){var a,i,s,l,u;if(!(!(a=o.source.value).startsWith(".")&&!a.startsWith("/")&&!a.startsWith("node:"))||t.some(e=>o.source.value.startsWith(e)))return;let p=r.get(o.source),c=n.getResolvedModuleFromModuleSpecifier(p)?.resolvedModule;if(!c)return;let d=eh(c.resolvedFileName);if(!d.split(/[\\/]/).includes("node_modules")){if(i=n,s=d,!i.getRootFileNames().some(e=>eh(e)===s)){if(eg.test(d)){let e,t=(l=n,u=c.resolvedFileName,(e=function(e){return e}(l)).getRedirectFromOutput(e.getCanonicalFileName(u)));if(t&&ef.test(t.source)&&ex(n,eh(t.source)))return}else if(!ef.test(d))return;else if(ex(n,d))return;e.report({node:o.source,messageId:"missingReference"})}}}}}});function eh(e){try{return m.realpathSync.native(e)}catch{return e}}function ex(e,t){return e.getResolvedProjectReferences()?.some(e=>e?.commandLine.fileNames.some(e=>eh(e)===t))??!1}let eb={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(let e of Object.keys(eb))Object.freeze(eb[e]);Object.freeze(eb);let eE=new i(["parent","leadingComments","trailingComments"]);function ev(e){return!eE.has(e)&&"_"!==e[0]}function eS(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function eC(e,t){return"Punctuator"===e.type&&e.value===t}function eD(e){return eC(e,"=>")}function eT(e){return eC(e,",")}function eA(e){return eC(e,";")}function ew(e){return eC(e,":")}function ek(e){return eC(e,"(")}function eI(e){return eC(e,")")}function ej(e){return eC(e,"{")}function eF(e){return["Block","Line","Shebang"].includes(e.type)}let eB=e=>!eA(e);function eR(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,eD);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,ek):i.getFirstToken(a,ek)).loc.start}return{start:{...n},end:{...o}}}let eP="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eL=Object.freeze(new i(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),eN=new i([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>"function"==typeof e)),e$=new i([Object.freeze,Object.preventExtensions,Object.seal]),eM=[[Map,new i(["size"])],[RegExp,new i(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new i(["size"])]];function eO(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=eU(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eU(o,t);if(null==e)return null;r.push(e.value)}}return r}let eq=Object.freeze({ArrayExpression(e,t){let r=eO(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eU(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eU(e.left,t),n=eU(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=eO(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eU(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eW(r,t);if(null!=a){let e=o.value,t=a.value;if(eN.has(e[t]))return{value:e[t](...n)};if(e$.has(e[t]))return{value:n[0]}}}}else{let o=eU(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eN.has(t))return{value:t(...n)};if(e$.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eU(e.test,t);return null!=r?r.value?eU(e.consequent,t):eU(e.alternate,t):null},ExpressionStatement:(e,t)=>eU(e.expression,t),Identifier(e,t){if(null!=t){let r=eS(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eL.has(r.name)&&r.name in eP)return{value:eP[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=eU(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(eW(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=eU(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=eU(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eU(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eW(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eM)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eU(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eU(e.callee,t),n=eO(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eN.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=eW(n,t),o=eU(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=eU(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eU(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eU(e.tag,t),n=eO(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=eO(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=eU(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>eU(e.expression,t),TSSatisfiesExpression:(e,t)=>eU(e.expression,t),TSTypeAssertion:(e,t)=>eU(e.expression,t),TSNonNullExpression:(e,t)=>eU(e.expression,t),TSInstantiationExpression:(e,t)=>eU(e.expression,t)});function eU(e,t){return null!=e&&Object.hasOwnProperty.call(eq,e.type)?eq[e.type](e,t):null}function eW(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eU(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function eV(e,t=null){try{return eU(e,t)}catch(e){return null}}function e_(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=eV(e,t);if(r)try{return String(r.value)}catch{}return null}function ez(e,t){switch(e.type){case"MemberExpression":if(e.computed)return e_(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return e_(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function eK(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=ez(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eG=Object.freeze(new i(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eJ=Object.freeze(new i(["-","+","!","~"]));function eX(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eY=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(ev)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eX(e)&&this.$visit(e,t,r))return!0}else if(eX(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eG.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eJ.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eH(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eY.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||eb)}function eQ(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&ek(i)&&eI(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,ek);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ek);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let eZ=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,e0=Function.call.bind(Object.hasOwnProperty),e1=Symbol("read"),e2=Symbol("call"),e3=Symbol("construct"),e8=Symbol("esm"),e6={require:{[e2]:!0}};function e9(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class e5{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);e9(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e9(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e6)){let r=e_(t.arguments[0]);if(null==r||!e0(e,r))continue;let n=e[r],o=[r];n[e1]&&(yield{node:t,path:o,type:e1,info:n[e1]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eZ.test(t.type)||null==t.source)continue;let r=t.source.value;if(!e0(e,r))continue;let n=e[r],o=[r];if(n[e1]&&(yield{node:t,path:o,type:e1,info:n[e1]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[e1]&&(yield{node:t,path:o.concat(e),type:e1,info:r[e1]})}else for(let e of t.specifiers){let t=e0(n,e8),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(e4),(e.path.length>=2||e.type!==e1)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[e1]&&(yield{node:e,path:t,type:e1,info:r[e1]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=ez(o);if(null==e||!e0(r,e))return;t=t.concat(e);let n=r[e];n[e1]&&(yield{node:o,path:t,type:e1,info:n[e1]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[e2]&&(yield{node:o,path:t,type:e2,info:r[e2]});return}if("NewExpression"===o.type){o.callee===n&&r[e3]&&(yield{node:o,path:t,type:e3,info:r[e3]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=eS(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=ez(n);if(null==e||!e0(r,e))continue;let o=t.concat(e),a=r[e];a[e1]&&(yield{node:n,path:o,type:e1,info:a[e1]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!e0(r,o))return;t=t.concat(o);let a=r[o];a[e1]&&(yield{node:e,path:t,type:e1,info:a[e1]}),yield*this._iterateVariableReferences(eS(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(eS(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!e0(r,n))return;t=t.concat(n);let o=r[n];o[e1]&&(yield{node:e,path:t,type:e1,info:o[e1]})}}}function e4(e,t){return 1!==t||"default"!==e}e5.READ=e1,e5.CALL=e2,e5.CONSTRUCT=e3,e5.ESM=e8;let e7=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*te(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=e7,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ek(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eI(o))return[n,o]}(n,t);){let[o]=n;if(r===e7&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,ek);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ek);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":if(r.discriminant===e)return t.sourceCode.getFirstToken(r,1);return;case"WithStatement":if(r.object===e)return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let tt=new s;function tr(e,t){if(!e||!tt.has(e)){let r=[];for(let[n,o]of te(e,t))r.unshift(n),r.push(o);tt.set(e,r)}return tt.get(e)}function tn(e,t){let r=tr(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function to(e,t){let[r,n]=tn(e,t);return t.sourceCode.text.slice(r,n)}function ta(e,t){if(tt.has(e))return tt.get(e).length>0;let r=te(e,t).next().done;return r&&tt.set(e,[]),!r}function ti(e,t){return e?.type==="Literal"&&e.value===t}let ts=e=>e?.type==="Literal"&&"string"==typeof e.value,tl=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),tu=e=>ts(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,tp=e=>"Literal"===e.type&&"number"==typeof e.value,tc=e=>"Literal"===e.type&&!!e.regex,td=e=>e?.type==="Literal"&&"null"===e.raw,tm=e=>"Literal"===e.type&&!!e.bigint;function tf(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let tg={},ty=["CallExpression"],th=["NewExpression"],tx=["CallExpression","NewExpression"];function tb(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t?t={names:[t]}:Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??tg;if(!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return tf(e.callee,n,o)}let tE=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tb(e,t,th)},tv=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tS(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tS(e,t)):"EmptyStatement"===r||!!t?.(e)}let tC=e=>"ArrayExpression"===e.type&&0===e.elements.length,tD=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tT(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tA=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tw(e){return tA.includes(e.type)}let tk=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tI(e){return tk.includes(e.type)}let tj={};function tF(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t?t={properties:[t]}:Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}=t??tj;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!tf(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&tf(e.object,o,a)}let tB={};function tR(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),tb(e,{argumentsLength:(t??=tB).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},ty)&&tF(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tP(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&tp(e.argument)&&1===e.argument.value}function tL(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}let tN=e=>tb(e,{name:"require",argumentsLength:1,optional:!1},ty)&&ts(e.arguments[0]);function t$(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>=0;t--){let n=r[t];if(!n)return!1;if(0===t)return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}}function tM(e,t){return t.some(t=>t$(e,t))}function tO(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tM(e.parent.tag,t))}function tq(e){return e?.type==="Identifier"&&"undefined"===e.name}let tU=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tF(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tF(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&tC(a)||"Object"===r&&tD(a)})(e,{...t,object:"Array"}),tW=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tV=e=>e?.type==="UnaryExpression"&&"!"===e.operator,t_=e=>tV(e.parent)&&e.parent.argument===e,tz=(e,t)=>tK(e.parent,t)&&e.parent.arguments[0]===e,tK=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=eS(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tG(e,t){return!!(tV(e)||t_(e)||tK(e,t)||tz(e,t))||!!tW(e.parent)&&tG(e.parent,t)}function tJ(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"].includes(e.parent.type)&&e.parent.test===e)||!!tW(e.parent)&&tJ(e.parent)}function tX(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
- Please open an issue at ${i}.`)}function tY(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tw(e))return!1;for(let r of t[e.type]??[]){let n=e[r];for(let e of Array.isArray(n)?n:[n])if(e?.type&&tY(e,t))return!0}return!1}let tH={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function tQ(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?tH[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let tZ=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],t0=["globalThis","Infinity","NaN","undefined"];function t1({includeGlobalProperties:e=!1}={}){return new i([...tZ,...e?t0:[]])}let t2=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,t3=`(?!(?:${[...t1({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,t8=new o,t6=new f.Script("returnValue = functionToRun()"),t9=Symbol.for("worker"),t5=Symbol.for("events");class t4{constructor(){Object.defineProperty(this,t5,{value:new o})}dispatchEvent(e){if(e.target=e.currentTarget=this,this["on"+e.type])try{this["on"+e.type](e)}catch(e){console.error(e)}let t=this[t5].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[t5].get(e);r||this[t5].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[t5].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function t7(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var re="function"==typeof Worker?Worker:b.isMainThread?rr():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=b.workerData;if(!e)return rr();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}b.parentPort.on("message",e=>{let t=new t7("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),b.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends t4{postMessage(e,t){b.parentPort.postMessage(e,t)}close(){process.exit()}importScripts(){for(let t=0;t<arguments.length;t++){let r,n=arguments[t];r=/^data:/.test(n)?ro(n).data:h.readFileSync(new g.URL(y.posix.normalize(n),g.pathToFileURL(e)),"utf-8"),x.runInThisContext(r,{filename:n})}}}let s=Object.getPrototypeOf(global);delete s.constructor,Object.defineProperties(i.prototype,s),s=Object.setPrototypeOf(global,new i),["postMessage","addEventListener","removeEventListener","dispatchEvent"].forEach(e=>{s[e]=s[e].bind(global)}),global.name=t,global.WorkerGlobalScope=i;let l=/^data:/.test(e);if("module"===r)import(l?e:g.pathToFileURL(e)).catch(r=>{if(l&&"Not supported"===r.message)return console.warn("Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker."),rn(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?rn(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let rt=g.pathToFileURL(process.cwd()+"/");function rr(){class e extends t4{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:g.fileURLToPath(new g.URL(e,rt));let a=new b.Worker(g.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:T&&"SCRIPT"===T.tagName.toUpperCase()&&T.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,t9,{value:a}),a.on("message",e=>{let t=new t7("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new t7("close"))})}postMessage(e,t){this[t9].postMessage(e,t)}terminate(){this[t9].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function rn(e,t){let{data:r}=ro(e);return x.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function ro(e){let[t,r,n,o]=e.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/)||[];if(!t)throw Error("Invalid Data URL.");if(o=decodeURIComponent(o),n)if("base64"===n.toLowerCase())o=Buffer.from(o,"base64").toString();else throw Error('Unknown Data URL encoding "'+n+'"');return{type:r,data:o}}class ra extends Error{constructor(e){super(e),this.name="TimeoutError"}}class ri extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let rs=e=>void 0===globalThis.DOMException?new ri(e):new DOMException(e),rl=e=>{let t=void 0===e.reason?rs("This operation was aborted."):e.reason;return t instanceof Error?t:rs(t)};function ru(e,t,r){"function"==typeof r&&(r={filter:r});let n=function(e,t,r){let n,o=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0&&(1/0===r.count||Number.isInteger(r.count))))throw TypeError("The `count` option should be at least 0 or more");r.signal?.throwIfAborted();let i=[t].flat(),s=[],{addListener:l,removeListener:u}=(e=>{let t=e.addEventListener||e.on||e.addListener,r=e.removeEventListener||e.off||e.removeListener;if(!t||!r)throw TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}})(e),p=(...e)=>{let t=r.multiArgs?e:e[0];(!r.filter||r.filter(t))&&(s.push(t),r.count===s.length&&(n(),o(s)))},c=e=>{n(),a(e)};for(let e of(n=()=>{for(let e of i)u(e,p);for(let e of r.rejectionEvents)u(e,c)},i))l(e,p);for(let e of r.rejectionEvents)l(e,c);r.signal&&r.signal.addEventListener("abort",()=>{c(r.signal.reason)},{once:!0}),r.resolveImmediately&&o(s)});if(o.cancel=n,"number"==typeof r.timeout){let e=function(e,t){let r,n,{milliseconds:o,fallback:a,message:i,customTimers:s={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof o||1!==Math.sign(o))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(rl(e)),n=()=>{u(rl(e))},e.addEventListener("abort",n,{once:!0})}if(1/0===o)return void e.then(l,u);let p=new ra;r=s.setTimeout.call(void 0,()=>{if(a){try{l(a())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===i?l():i instanceof Error?u(i):(p.message=i??`Promise timed out after ${o} milliseconds`,u(p))},o),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),n&&t.signal&&t.signal.removeEventListener("abort",n)});return l.clear=()=>{s.clearTimeout.call(void 0,r),r=void 0},l}(o,{milliseconds:r.timeout});return e.cancel=n,e}return o}(e,t,r={...r,count:1,resolveImmediately:!1}),o=n.then(e=>e[0]);return o.cancel=n.cancel,o}let rp=!!globalThis.process?.versions?.node;function rc(e){let t,r;if(rp){let t;r=new re((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new re(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function rd(e){let t=`
1
+ let e,t,r,n;"use strict";var o=Map,a=RegExp,i=Set,s=WeakMap,l=WeakSet;var u,p,c=require("eslint-plugin-sukka"),d=require("@eslint-sukka/shared"),m=require("node:fs"),f=require("node:vm"),g=require("url"),y=require("path"),h=require("fs"),x=require("vm"),b=require("worker_threads"),E=require("node:assert/strict"),v=require("node:util/types"),S=require("node:path"),C=require("node:util"),D=require("eslint/use-at-your-own-risk"),T="u">typeof document?document.currentScript:null;function A(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function w(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function k(e){return e?.type==="MemberExpression"}function I(e){return e?.type==="AwaitExpression"}function j(e,t){return!!w(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function F(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function B(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function R(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function P({create:e,meta:t,name:r}){return t.docs&&!t.docs.url&&(t.docs.url=new URL(r,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,s=(n=t.defaultOptions||[],o=r.options,a=structuredClone(n),null==o||a.forEach((e,t)=>{if(void 0!==o[t]){let r=o[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?a[t]=r:a[t]=function e(t={},r={}){return t?r?Object.fromEntries([...new i([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]})):t:r}(e,r)}}),a);return e(r,s)},meta:t,name:r}}function L(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var N=P({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!j(t.callee.property,"flatMap")||!(B(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(R(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&R(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let $=new i(["href","pathname","search","hash","origin"]);var M=P({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},create:e=>({AssignmentExpression(t){let r=function(e,t){if(j(e,t))return e;for(;k(e);){if(j(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=O(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=O(t.parent);if($.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function O(e){if(k(e)&&w(e.property))return e.property.name}var q=P({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),U=P({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let V=/^toLocale(?<name>Upper|Lower)Case$/g;var W=P({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},create:e=>({CallExpression(t){if(t.arguments.length>0||!k(t.callee)||!w(t.callee.property))return;let{property:r}=t.callee,n=V.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),_=P({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked||""),o=A(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let z=/\P{ASCII}/u;function K(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function G(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=J(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${X(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new i(e.regex.flags);n.add("u");let o=new a(J(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function J(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${X(t)}}`:`\\u${X(t)}`})}function X(e){return e.toString(16).padStart(4,"0").toUpperCase()}P({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"},defaultOptions:[{pattern:z.source,flags:"u",only:void 0}]},create(e,[{pattern:t,flags:r,only:n}]){let o=t?new a(t,r):z;return K(o,(t,r)=>{if(n&&n!==r)return;let a=G(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let Y=/[\u061C\u202A-\u202E\u2066-\u2069]/;var H=P({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},create:e=>K(Y,(t,r)=>{let n=RegExp(Y.source,"gu"),o={kind:r,text:J(t.value,n)},a=G(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let Q=(n=[/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u].map(e=>"string"==typeof e?e:e.source).join(""),RegExp(`[${n}]`,"u"));var Z=P({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},create:e=>K(Q,t=>{let r=G(t,RegExp(Q.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),ee=P({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(et);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&R(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!I(t=r)||A(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${I(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function et(e){return"ReturnStatement"===e.type&&w(e.argument)}var er=P({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},create:e=>({BlockStatement({parent:t,body:r}){if(!B(t))return;let n=function(e,t){let r=t.find(en);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>R(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function en(e){return"ReturnStatement"===e.type&&w(e.argument)}var eo=P({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"},defaultOptions:[{maximumStatements:0}]},create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!B(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),ea=P({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return j(e,"XMLHttpRequest")})(t)||j((r=t).callee,"ActiveXObject")&&F(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return j(e,t)||k(e)&&j(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return j(e,r)&&k(t)&&j(t.property,"load")||k(e)&&j(e.object,r)&&j(e.property,["ajax","get","post","getJSON","getScript"])}(t)||ei(t,"axios")||ei(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function ei(e,t){return j(e.callee,"require")&&F(e.arguments[0],t)}let es=new i(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var el=P({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!es.has(t.callee.name)||function(e){if(!j(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||F(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),eu=P({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},create(e){L(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(j(a,"toString")||F(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),ep=P({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ec=new i(["BigInt","Boolean","Number","String","Symbol"]);var ed=P({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ec.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),em=P({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},create(e){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let ef=/\.(?:[cm]?ts|tsx)$/i,eg=/\.d\.(?:[cm]?ts|ts)$/i,ey=new s;var eh=P({name:"require-project-reference",meta:{type:"problem",docs:{description:"Require project references for local package imports",requiresTypeChecking:!0},schema:[{type:"object",properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0}},additionalProperties:!1}],messages:{missingReference:"This local package is not covered by a project reference. Add its project to this tsconfig.json references and enable declarationMap."},defaultOptions:[{ignore:[]}]},create(e,[{ignore:t}]){L(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:r,program:n}=e.sourceCode.parserServices;return{ImportDeclaration(o){var a,i,s,l,u;if(!(!(a=o.source.value).startsWith(".")&&!a.startsWith("/")&&!a.startsWith("node:"))||t.some(e=>o.source.value.startsWith(e)))return;let p=r.get(o.source),c=n.getResolvedModuleFromModuleSpecifier(p)?.resolvedModule;if(!c)return;let d=ex(c.resolvedFileName);if(!d.split(/[\\/]/).includes("node_modules")){if(i=n,s=d,!eE(i).rootFiles.has(s)){if(eg.test(d)){let e,t=(l=n,u=c.resolvedFileName,(e=function(e){return e}(l)).getRedirectFromOutput(e.getCanonicalFileName(u)));if(t&&ef.test(t.source)&&eb(n,ex(t.source)))return}else if(!ef.test(d))return;else if(eb(n,d))return;e.report({node:o.source,messageId:"missingReference"})}}}}}});function ex(e){try{return m.realpathSync.native(e)}catch{return e}}function eb(e,t){return eE(e).projectReferenceFiles.has(t)}function eE(e){let t=ey.get(e);if(t)return t;let r={rootFiles:new i(e.getRootFileNames().map(ex)),projectReferenceFiles:new i(e.getResolvedProjectReferences()?.flatMap(e=>e?.commandLine.fileNames.map(ex)??[])??[])};return ey.set(e,r),r}let ev={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(let e of Object.keys(ev))Object.freeze(ev[e]);Object.freeze(ev);let eS=new i(["parent","leadingComments","trailingComments"]);function eC(e){return!eS.has(e)&&"_"!==e[0]}function eD(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function eT(e,t){return"Punctuator"===e.type&&e.value===t}function eA(e){return eT(e,"=>")}function ew(e){return eT(e,",")}function ek(e){return eT(e,";")}function eI(e){return eT(e,":")}function ej(e){return eT(e,"(")}function eF(e){return eT(e,")")}function eB(e){return eT(e,"{")}function eR(e){return["Block","Line","Shebang"].includes(e.type)}let eP=e=>!ek(e);function eL(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,eA);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,ej):i.getFirstToken(a,ej)).loc.start}return{start:{...n},end:{...o}}}let eN="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},e$=Object.freeze(new i(["Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","isFinite","isNaN","isPrototypeOf","JSON","Map","Math","NaN","Number","Object","parseFloat","parseInt","Promise","Proxy","Reflect","RegExp","Set","String","Symbol","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","WeakMap","WeakSet"])),eM=new i([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,"function"==typeof BigInt?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>"function"==typeof e)),eO=new i([Object.freeze,Object.preventExtensions,Object.seal]),eq=[[Map,new i(["size"])],[RegExp,new i(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new i(["size"])]];function eU(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=eW(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eW(o,t);if(null==e)return null;r.push(e.value)}}return r}let eV=Object.freeze({ArrayExpression(e,t){let r=eU(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eW(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eW(e.left,t),n=eW(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=eU(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eW(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=e_(r,t);if(null!=a){let e=o.value,t=a.value;if(eM.has(e[t]))return{value:e[t](...n)};if(eO.has(e[t]))return{value:n[0]}}}}else{let o=eW(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eM.has(t))return{value:t(...n)};if(eO.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eW(e.test,t);return null!=r?r.value?eW(e.consequent,t):eW(e.alternate,t):null},ExpressionStatement:(e,t)=>eW(e.expression,t),Identifier(e,t){if(null!=t){let r=eD(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&e$.has(r.name)&&r.name in eN)return{value:eN[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=eW(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(e_(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=eW(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=eW(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eW(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=e_(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eq)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eW(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eW(e.callee,t),n=eU(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eM.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=e_(n,t),o=eW(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=eW(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eW(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eW(e.tag,t),n=eU(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=eU(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=eW(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>eW(e.expression,t),TSSatisfiesExpression:(e,t)=>eW(e.expression,t),TSTypeAssertion:(e,t)=>eW(e.expression,t),TSNonNullExpression:(e,t)=>eW(e.expression,t),TSInstantiationExpression:(e,t)=>eW(e.expression,t)});function eW(e,t){return null!=e&&Object.hasOwnProperty.call(eV,e.type)?eV[e.type](e,t):null}function e_(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eW(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function ez(e,t=null){try{return eW(e,t)}catch(e){return null}}function eK(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=ez(e,t);if(r)try{return String(r.value)}catch{}return null}function eG(e,t){switch(e.type){case"MemberExpression":if(e.computed)return eK(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return eK(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function eJ(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=eG(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eX=Object.freeze(new i(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eY=Object.freeze(new i(["-","+","!","~"]));function eH(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eQ=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(eC)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eH(e)&&this.$visit(e,t,r))return!0}else if(eH(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eX.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eY.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eZ(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eQ.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||ev)}function e0(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&ej(i)&&eF(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,ej);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ej);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let e1=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,e2=Function.call.bind(Object.hasOwnProperty),e3=Symbol("read"),e8=Symbol("call"),e6=Symbol("construct"),e9=Symbol("esm"),e5={require:{[e8]:!0}};function e4(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class e7{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);e4(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e4(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e5)){let r=eK(t.arguments[0]);if(null==r||!e2(e,r))continue;let n=e[r],o=[r];n[e3]&&(yield{node:t,path:o,type:e3,info:n[e3]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!e1.test(t.type)||null==t.source)continue;let r=t.source.value;if(!e2(e,r))continue;let n=e[r],o=[r];if(n[e3]&&(yield{node:t,path:o,type:e3,info:n[e3]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[e3]&&(yield{node:t,path:o.concat(e),type:e3,info:r[e3]})}else for(let e of t.specifiers){let t=e2(n,e9),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(te),(e.path.length>=2||e.type!==e3)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[e3]&&(yield{node:e,path:t,type:e3,info:r[e3]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=eG(o);if(null==e||!e2(r,e))return;t=t.concat(e);let n=r[e];n[e3]&&(yield{node:o,path:t,type:e3,info:n[e3]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[e8]&&(yield{node:o,path:t,type:e8,info:r[e8]});return}if("NewExpression"===o.type){o.callee===n&&r[e6]&&(yield{node:o,path:t,type:e6,info:r[e6]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=eD(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=eG(n);if(null==e||!e2(r,e))continue;let o=t.concat(e),a=r[e];a[e3]&&(yield{node:n,path:o,type:e3,info:a[e3]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!e2(r,o))return;t=t.concat(o);let a=r[o];a[e3]&&(yield{node:e,path:t,type:e3,info:a[e3]}),yield*this._iterateVariableReferences(eD(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(eD(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!e2(r,n))return;t=t.concat(n);let o=r[n];o[e3]&&(yield{node:e,path:t,type:e3,info:o[e3]})}}}function te(e,t){return 1!==t||"default"!==e}e7.READ=e3,e7.CALL=e8,e7.CONSTRUCT=e6,e7.ESM=e9;let tt=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*tr(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=tt,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ej(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eF(o))return[n,o]}(n,t);){let[o]=n;if(r===tt&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,ej);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ej);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":if(r.discriminant===e)return t.sourceCode.getFirstToken(r,1);return;case"WithStatement":if(r.object===e)return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let tn=new s;function to(e,t){if(!e||!tn.has(e)){let r=[];for(let[n,o]of tr(e,t))r.unshift(n),r.push(o);tn.set(e,r)}return tn.get(e)}function ta(e,t){let r=to(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function ti(e,t){let[r,n]=ta(e,t);return t.sourceCode.text.slice(r,n)}function ts(e,t){if(tn.has(e))return tn.get(e).length>0;let r=tr(e,t).next().done;return r&&tn.set(e,[]),!r}function tl(e,t){return e?.type==="Literal"&&e.value===t}let tu=e=>e?.type==="Literal"&&"string"==typeof e.value,tp=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),tc=e=>tu(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,td=e=>"Literal"===e.type&&"number"==typeof e.value,tm=e=>"Literal"===e.type&&!!e.regex,tf=e=>e?.type==="Literal"&&"null"===e.raw,tg=e=>"Literal"===e.type&&!!e.bigint;function ty(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let th={},tx=["CallExpression"],tb=["NewExpression"],tE=["CallExpression","NewExpression"];function tv(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t?t={names:[t]}:Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??th;if(!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return ty(e.callee,n,o)}let tS=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tv(e,t,tb)},tC=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tD(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tD(e,t)):"EmptyStatement"===r||!!t?.(e)}let tT=e=>"ArrayExpression"===e.type&&0===e.elements.length,tA=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tw(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tk=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tI(e){return tk.includes(e.type)}let tj=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tF(e){return tj.includes(e.type)}let tB={};function tR(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t?t={properties:[t]}:Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}=t??tB;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!ty(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&ty(e.object,o,a)}let tP={};function tL(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),tv(e,{argumentsLength:(t??=tP).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},tx)&&tR(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tN(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&td(e.argument)&&1===e.argument.value}function t$(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}let tM=e=>tv(e,{name:"require",argumentsLength:1,optional:!1},tx)&&tu(e.arguments[0]);function tO(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>=0;t--){let n=r[t];if(!n)return!1;if(0===t)return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}}function tq(e,t){return t.some(t=>tO(e,t))}function tU(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tq(e.parent.tag,t))}function tV(e){return e?.type==="Identifier"&&"undefined"===e.name}let tW=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tR(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tR(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&tT(a)||"Object"===r&&tA(a)})(e,{...t,object:"Array"}),t_=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tz=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tK=e=>tz(e.parent)&&e.parent.argument===e,tG=(e,t)=>tJ(e.parent,t)&&e.parent.arguments[0]===e,tJ=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=eD(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tX(e,t){return!!(tz(e)||tK(e)||tJ(e,t)||tG(e,t))||!!t_(e.parent)&&tX(e.parent,t)}function tY(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"].includes(e.parent.type)&&e.parent.test===e)||!!t_(e.parent)&&tY(e.parent)}function tH(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
+ Please open an issue at ${i}.`)}function tQ(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tI(e))return!1;for(let r of t[e.type]??[]){let n=e[r];for(let e of Array.isArray(n)?n:[n])if(e?.type&&tQ(e,t))return!0}return!1}let tZ={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function t0(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?tZ[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let t1=["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],t2=["globalThis","Infinity","NaN","undefined"];function t3({includeGlobalProperties:e=!1}={}){return new i([...t1,...e?t2:[]])}let t8=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,t6=`(?!(?:${[...t3({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,t9=new o,t5=new f.Script("returnValue = functionToRun()"),t4=Symbol.for("worker"),t7=Symbol.for("events");class re{constructor(){Object.defineProperty(this,t7,{value:new o})}dispatchEvent(e){if(e.target=e.currentTarget=this,this["on"+e.type])try{this["on"+e.type](e)}catch(e){console.error(e)}let t=this[t7].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[t7].get(e);r||this[t7].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[t7].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function rt(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var rr="function"==typeof Worker?Worker:b.isMainThread?ro():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=b.workerData;if(!e)return ro();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}b.parentPort.on("message",e=>{let t=new rt("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),b.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends re{postMessage(e,t){b.parentPort.postMessage(e,t)}close(){process.exit()}importScripts(){for(let t=0;t<arguments.length;t++){let r,n=arguments[t];r=/^data:/.test(n)?ri(n).data:h.readFileSync(new g.URL(y.posix.normalize(n),g.pathToFileURL(e)),"utf-8"),x.runInThisContext(r,{filename:n})}}}let s=Object.getPrototypeOf(global);delete s.constructor,Object.defineProperties(i.prototype,s),s=Object.setPrototypeOf(global,new i),["postMessage","addEventListener","removeEventListener","dispatchEvent"].forEach(e=>{s[e]=s[e].bind(global)}),global.name=t,global.WorkerGlobalScope=i;let l=/^data:/.test(e);if("module"===r)import(l?e:g.pathToFileURL(e)).catch(r=>{if(l&&"Not supported"===r.message)return console.warn("Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker."),ra(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?ra(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let rn=g.pathToFileURL(process.cwd()+"/");function ro(){class e extends re{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:g.fileURLToPath(new g.URL(e,rn));let a=new b.Worker(g.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:T&&"SCRIPT"===T.tagName.toUpperCase()&&T.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,t4,{value:a}),a.on("message",e=>{let t=new rt("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new rt("close"))})}postMessage(e,t){this[t4].postMessage(e,t)}terminate(){this[t4].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function ra(e,t){let{data:r}=ri(e);return x.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function ri(e){let[t,r,n,o]=e.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/)||[];if(!t)throw Error("Invalid Data URL.");if(o=decodeURIComponent(o),n)if("base64"===n.toLowerCase())o=Buffer.from(o,"base64").toString();else throw Error('Unknown Data URL encoding "'+n+'"');return{type:r,data:o}}class rs extends Error{constructor(e){super(e),this.name="TimeoutError"}}class rl extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let ru=e=>void 0===globalThis.DOMException?new rl(e):new DOMException(e),rp=e=>{let t=void 0===e.reason?ru("This operation was aborted."):e.reason;return t instanceof Error?t:ru(t)};function rc(e,t,r){"function"==typeof r&&(r={filter:r});let n=function(e,t,r){let n,o=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0&&(1/0===r.count||Number.isInteger(r.count))))throw TypeError("The `count` option should be at least 0 or more");r.signal?.throwIfAborted();let i=[t].flat(),s=[],{addListener:l,removeListener:u}=(e=>{let t=e.addEventListener||e.on||e.addListener,r=e.removeEventListener||e.off||e.removeListener;if(!t||!r)throw TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}})(e),p=(...e)=>{let t=r.multiArgs?e:e[0];(!r.filter||r.filter(t))&&(s.push(t),r.count===s.length&&(n(),o(s)))},c=e=>{n(),a(e)};for(let e of(n=()=>{for(let e of i)u(e,p);for(let e of r.rejectionEvents)u(e,c)},i))l(e,p);for(let e of r.rejectionEvents)l(e,c);r.signal&&r.signal.addEventListener("abort",()=>{c(r.signal.reason)},{once:!0}),r.resolveImmediately&&o(s)});if(o.cancel=n,"number"==typeof r.timeout){let e=function(e,t){let r,n,{milliseconds:o,fallback:a,message:i,customTimers:s={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof o||1!==Math.sign(o))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(rp(e)),n=()=>{u(rp(e))},e.addEventListener("abort",n,{once:!0})}if(1/0===o)return void e.then(l,u);let p=new rs;r=s.setTimeout.call(void 0,()=>{if(a){try{l(a())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===i?l():i instanceof Error?u(i):(p.message=i??`Promise timed out after ${o} milliseconds`,u(p))},o),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),n&&t.signal&&t.signal.removeEventListener("abort",n)});return l.clear=()=>{s.clearTimeout.call(void 0,r),r=void 0},l}(o,{milliseconds:r.timeout});return e.cancel=n,e}return o}(e,t,r={...r,count:1,resolveImmediately:!1}),o=n.then(e=>e[0]);return o.cancel=n.cancel,o}let rd=!!globalThis.process?.versions?.node;function rm(e){let t,r;if(rd){let t;r=new rr((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new rr(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function rf(e){let t=`
3
3
  globalThis.onmessage = async ({data: arguments_}) => {
4
4
  try {
5
5
  const output = await (${e.toString()})(...arguments_);
@@ -8,7 +8,7 @@ Please open an issue at ${i}.`)}function tY(e,t){if("AwaitExpression"===e.type||
8
8
  globalThis.postMessage({error});
9
9
  }
10
10
  };
11
- `;async function r({worker:e,arguments_:t}){let n=ru(e,"message",{rejectionEvents:["error","messageerror"]});e.postMessage(t);let{data:{output:o,error:a}}=await n;if(a)throw a;return o}let n=async(...e)=>{let{worker:n,cleanup:o}=rc(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=rc(t),i=ru(e,[],{rejectionEvents:["abort"]});try{return await Promise.race([r({arguments_:n,worker:o}),i])}catch(t){throw e.throwIfAborted(),t}finally{i.cancel(),a()}},n}let rm={};function rf(e,{checkReserved:t=!0}={}){if("string"!=typeof e)throw TypeError(`Expected a string, got \`${typeof e}\`.`);return!(e.length>1e5)&&function(e,t,{timeout:r,throwOnTimeout:n}={}){try{return(function(e,{timeout:t,context:r=f.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),t6.runInNewContext(r,{timeout:t}),r.returnValue);return Object.defineProperty(n,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),n})(()=>structuredClone(e).test(t),{timeout:(e=>{if(void 0===e||Number.isNaN(e))return;let t=Math.max(1,Math.trunc(Math.abs(e)));if(Number.isFinite(t))return t})(r),context:rm})()}catch(e){if(e?.code==="ERR_SCRIPT_EXECUTION_TIMEOUT"&&!n)return!1;throw e}}(function({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=t8.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?t3:""}${t2.source}`;n=RegExp(e?`^${o}$`:o,"u"),t8.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function rg(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}rd((e,t,r)=>new a(e,t).test(r)),rd((e,t,r)=>{let n=new a(e,t).exec(r);if(null!==n)return{match:n[0],index:n.index,groups:n.slice(1),namedGroups:n.groups??{},input:n.input}}),t=function*(e,t,r){let n=new a(e,t);for(let e of r.matchAll(n))yield{match:e[0],index:e.index,groups:e.slice(1),namedGroups:e.groups??{},input:e.input}},r=`
11
+ `;async function r({worker:e,arguments_:t}){let n=rc(e,"message",{rejectionEvents:["error","messageerror"]});e.postMessage(t);let{data:{output:o,error:a}}=await n;if(a)throw a;return o}let n=async(...e)=>{let{worker:n,cleanup:o}=rm(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=rm(t),i=rc(e,[],{rejectionEvents:["abort"]});try{return await Promise.race([r({arguments_:n,worker:o}),i])}catch(t){throw e.throwIfAborted(),t}finally{i.cancel(),a()}},n}let rg={};function ry(e,{checkReserved:t=!0}={}){if("string"!=typeof e)throw TypeError(`Expected a string, got \`${typeof e}\`.`);return!(e.length>1e5)&&function(e,t,{timeout:r,throwOnTimeout:n}={}){try{return(function(e,{timeout:t,context:r=f.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),t5.runInNewContext(r,{timeout:t}),r.returnValue);return Object.defineProperty(n,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),n})(()=>structuredClone(e).test(t),{timeout:(e=>{if(void 0===e||Number.isNaN(e))return;let t=Math.max(1,Math.trunc(Math.abs(e)));if(Number.isFinite(t))return t})(r),context:rg})()}catch(e){if(e?.code==="ERR_SCRIPT_EXECUTION_TIMEOUT"&&!n)return!1;throw e}}(function({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=t9.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?t6:""}${t8.source}`;n=RegExp(e?`^${o}$`:o,"u"),t9.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function rh(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}rf((e,t,r)=>new a(e,t).test(r)),rf((e,t,r)=>{let n=new a(e,t).exec(r);if(null!==n)return{match:n[0],index:n.index,groups:n.slice(1),namedGroups:n.groups??{},input:n.input}}),t=function*(e,t,r){let n=new a(e,t);for(let e of r.matchAll(n))yield{match:e[0],index:e.index,groups:e.slice(1),namedGroups:e.groups??{},input:e.input}},r=`
12
12
  const nothing = Symbol('nothing');
13
13
  let iterator = nothing;
14
14
 
@@ -24,36 +24,34 @@ Please open an issue at ${i}.`)}function tY(e,t){if("AwaitExpression"===e.type||
24
24
  globalThis.postMessage({error});
25
25
  }
26
26
  };
27
- `,e=>(...t)=>({async *[Symbol.asyncIterator](){e.throwIfAborted();let{worker:n,cleanup:o}=rc(r),a=ru(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([ru(n,"message",{rejectionEvents:["error","messageerror"]}),a]);n.postMessage(e?t:void 0),e=!1;let{data:{output:o,error:i}}=await r;if(i)throw i;let{value:s,done:l}=o;if(l)break;yield s}}catch(t){throw e.throwIfAborted(),t}finally{a.cancel(),o()}}});let ry=e=>[e,...e.childScopes.flatMap(e=>ry(e))],rh=e=>[...new i(ry(e).flatMap(({references:e})=>e))],rx=new i(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),rb=e=>"string"==typeof e&&rf(e)&&!rx.has(e),rE=(e,t)=>t.every(t=>!(rg(e,t)||rh(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rv=()=>!0;function rS(e,t,r=rv){if(rb(e)||rb(e+="_")){for(;!rE(e,t)||!r(e,t);)e+="_";return e}}function rC(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ek(n)&&eI(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rD(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ek),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eT(a)?a:void 0}}function rT(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rD(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rA(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rA(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=eV(t);if(!r)return;return String(r.value)}}function rw(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rw(e.expression):e}function rk(e,t){if(e=rw(e),t=rw(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=rA(e);if(void 0!==r)return rk(e.object,t.object)&&r===rA(t);return e.computed===t.computed&&rk(e.object,t.object)&&rk(e.property,t.property)}default:return!1}}let rI=e=>null===e||"object"!=typeof e&&"function"!=typeof e,rj=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=eV(e,r.getScope(e));if(n&&rI(n.value))return{value:n.value}},rF=(e,t,r)=>{let n=rj(e,r),o=rj(t,r);if(n&&o){let e,t;return(e=n.value)===(t=o.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!e&&!!t&&"Literal"!==e.type&&"Literal"!==t.type&&rk(e,t)},rB=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>rF(e,o,t))&&n.push(o),r.push(o));return n};function rR(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}let rP=new i(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rL=e=>rP.has(e?.type);function rN(e){for(;rL(e);)e=e.expression;return e}function r$(e){return rf(e,{checkReserved:!1})}function rM(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let rO=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),rq=([e,t],[r,n])=>e>=r&&t<=n;function rU(e,t,r=[]){let{sourceCode:n}=e,o=rO(e,t),a=r.map(t=>rO(e,t));return rM(e).some(e=>{let t=n.getRange(e);return rq(t,o)&&a.every(e=>!rq(t,e))})}function rW(e,t){let{sourceCode:r}=e,n=r.getLoc(t).end.line;return r.getCommentsAfter(t).findLast(e=>r.getLoc(e).start.line===n)}let rV=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},r_=new i(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rz=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||r_.has(e.type),rK=e=>rz(e)||"BlockStatement"===e.type&&e.body.some(e=>rz(e)),rG=(e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>r.getLoc(e).start.line!==r.getLoc(e).end.line)};function rJ(e,t){if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function rX(e,t){let{sourceCode:r}=t,[,n]=tn(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let rY=new i(["depth","height","width"]);function rH(e){return tF(e,{properties:["length","size"],optional:!1})}function rQ(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rZ=["Program","StyleSheet","Document","root"];function r0(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let r1=({identifiers:e,references:t})=>[...new i([...e,...t.map(({identifier:e})=>e)])];function r2(e,t){if(!e)return!1;if("ThisExpression"===e.type||"Super"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){for(let e of n)if(r2(e,t))return!0}else if(r2(n,t))return!0}return!1}function r3(e){let t;return(e=rN(e),e?.type==="ChainExpression")?r3(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?r3(e.object):r3(e.callee))))}let r8=(e,t)=>{let{references:r=[]}=eS(e,t)||{};return r};function r6(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||r8(t,"arguments").some(({from:e})=>e===t))||!!(n&&r8(t,n).length>0))}let r9=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],r5=new i(["any","error","unknown"]),r4=new i(["null","undefined"]),r7=e=>e.getSymbol()??e.aliasSymbol,ne=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function nt(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let nr="target",nn="non-target",no="nullish",na="unknown",ni=new i(["ClassDeclaration","ClassExpression"]),ns=new i(["FunctionDeclaration","FunctionExpression"]),nl=new i(["ClassName","ImportBinding","TSEnumName","Type"]),nu=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),np=new i(["TSNullKeyword","TSUndefinedKeyword"]),nc=e=>e===no?nn:e,nd=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==no):e.map(nc)).length?nn:(t.treatMixedUnionAsTarget?e.includes(nr):e.every(e=>e===nr))?nr:(t.treatMixedUnionAsNonTarget?e.includes(nn):e.every(e=>e===nn))?nn:na,nm=e=>(e=e.map(nc)).includes(nr)?nr:e.every(e=>e===nn)?nn:na,nf=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nl.has(e.type));if(r)return r;t=t.upper}},ng=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=ng(e.left);return t?`${t}.${e.right.name}`:void 0}},ny=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?nr:t.nonTargetTypeNames?.has(e)?nn:na},nh=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?nr:nn:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||ny(o,r)!==na||ny(a,r)!==na?nn:na};function nx(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nx(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?nx(e.typeAnnotation,t,r,n):na;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=ng(t.typeName);if(!s)return na;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return na;let n=e.typeName.right.name,o=nf(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?na:nh({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==na)return l;if(!n.preferTypeReferenceDefinitions){let e=ny(s,n);if(e!==na)return e}if(o.has(s))return na;o.add(s);let u=nf(s,r);if(!u)return o.delete(s),ny(s,n);let p=na,c=((e,t)=>{if("ImportBinding"!==e.type)return na;if("ImportDefaultSpecifier"===e.node.type)return ny(e.node.local.name,t)===na?na:nn;let r=e.node.imported?.name??e.node.imported?.value;return r?nh({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):na})(u,n);return c!==na?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=nx(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=nx(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?nn:nm(a.extends.map(t=>ng(t.expression)?e({typeName:t.expression},r,n,o):na))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?na:nE(i.superClass,r,n,o):nn),o.delete(s),p}(e,t,r,n);case"TSUnionType":return nd(e.types.map(e=>nx(e,t,r,n)),r);case"TSIntersectionType":return nm(e.types.map(e=>nx(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return nr;if(np.has(e?.type))return no;return nu.has(e?.type)?nn:na}}let nb=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?nE(e.superClass,t,r,n):nn;function nE(e,t,r,n=new i){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return ny(o,r);if(n.has(o))return na;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=na;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=nE(i.node.init,t,r,n):i?.type==="ClassName"&&(s=nb(i.node,t,r,n)),n.delete(o),i?s:ny(o,r)}return ni.has(e.type)?nb(e,t,r,n):na}let nv=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return nx(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function nS(e,t,r,n=new i){if(!e)return na;if("TSSatisfiesExpression"===e.type)return nS(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=nx(e.typeAnnotation,o,r);if(a!==na)return a;let s=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=eS(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return na;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=nx(a.name?.typeAnnotation,i,r),l=na;return s!==na?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=nS(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(ni.has(n.type))return nb(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return nn;if(ns.has(n.type)){let e=nv(n,t,r);if(e!==na)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return nn;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return nn;continue}break}}return na})(e,t,r):na;case"Super":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static||"MethodDefinition"===n.type&&n.static)return nn;if(ni.has(n.type))return n.superClass?nE(n.superClass,t.sourceCode.getScope(n),r):nn}return na})(e,t,r):na;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,nE(a,t.sourceCode.getScope(a),r,void 0)):na;case"TSAsExpression":case"TSTypeAssertion":{let a=nx(e.typeAnnotation,o,r);return a===na?nS(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return nS(e.expression,t,r,n);case"SequenceExpression":return nS(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return nd([nS(e.consequent,t,r,n),nS(e.alternate,t,r,n)],r);default:return na}})(e,t,r,n);if(s!==na)return s;if("Identifier"!==e.type){let t,n=(t=eV(e,o))?r.getStaticType?.(t.value,e)??na:na;if(n!==na)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tE(e,{name:t}))||r.targetCallNames?.some(t=>tb(e,{name:t},ty)))return nr;let l=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return na;try{let{program:t}=n;return function e(t,r,n,o){if(r5.has(t.intrinsicName))return na;if(r4.has(t.intrinsicName))return no;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):na}if(t.isUnion())return nd(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return nm(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return nr;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&nt(t,r).some(t=>e(t,r,n,o)===nr))return nr;if(t.intrinsicName)return nn;let i=r7(t);if(!i)return na;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?nr:nn}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return na}})(e,t,r);return l!==na?l:r.isNonTargetNode?.(e,t)?nn:na}let nC=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>nc(nS(t,r,{...e,...n})),isTarget:(t,r,n)=>nS(t,r,{...e,...n})===nr,isKnownNonTarget:(t,r,n)=>nc(nS(t,r,{...e,...n}))===nn}),nD=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>nC({...n,targetTypeNames:new i([e]),typeReferenceAliases:new o(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),nT=new i(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),nA=new i(["Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),nw=new i(["BigInt64Array","BigUint64Array"]),nk=new i([...r9,...nA]),nI={checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new i(["Array","ReadonlyArray"]),nonTargetTypeNames:nk,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||nT.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?nr:"Identifier"===t.type||"MemberExpression"===t.type?na:nn},{isTarget:nj,isKnownNonTarget:nF}=nC(nI),{isKnownNonTarget:nB}=nC({...nI,targetTypeNames:new i([...nI.targetTypeNames,...r9]),nonTargetTypeNames:nA,targetConstructorNames:["Array",...r9]}),{isTarget:nR}=nC({treatMixedUnionAsTarget:!0,targetTypeNames:nw,targetConstructorNames:[...nw],isTargetNode:e=>tR(e,{objects:[...nw],methods:["from","of"],optionalCall:!1,optionalMember:!1})}),nP=new i(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function nL(e,t){return!nP.has(e.type)&&nB(e,t)}let nN=new i(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),n$=new i(["AnimationEvent","AnimationPlaybackEvent","AudioProcessingEvent","BeforeUnloadEvent","BlobEvent","ClipboardEvent","CloseEvent","CommandEvent","CompositionEvent","ContentVisibilityAutoStateChangeEvent","CookieChangeEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","ExtendableCookieChangeEvent","ExtendableEvent","ExtendableMessageEvent","FetchEvent","FocusEvent","FontFaceSetLoadEvent","FormDataEvent","GPUUncapturedErrorEvent","GamepadEvent","HashChangeEvent","IDBVersionChangeEvent","InputEvent","KeyboardEvent","MIDIConnectionEvent","MIDIMessageEvent","MediaEncryptedEvent","MediaKeyMessageEvent","MediaQueryListEvent","MediaStreamTrackEvent","MessageEvent","MouseEvent","NavigateEvent","NavigationCurrentEntryChangeEvent","NotificationEvent","OfflineAudioCompletionEvent","PageRevealEvent","PageSwapEvent","PageTransitionEvent","PaymentMethodChangeEvent","PaymentRequestUpdateEvent","PictureInPictureEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","PushEvent","PushSubscriptionChangeEvent","RTCDataChannelEvent","RTCDTMFToneChangeEvent","RTCErrorEvent","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCTrackEvent","RTCTransformEvent","SecurityPolicyViolationEvent","SpeechRecognitionErrorEvent","SpeechRecognitionEvent","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","StorageEvent","SubmitEvent","TaskPriorityChangeEvent","TextEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WebGLContextEvent","WheelEvent",...nN]),{isTarget:nM,isKnownNonTarget:nO}=nC({preferTypeReferenceDefinitions:!0,targetTypeImports:new o([["react",nN]]),targetTypeNamespaceImports:new o([["react",nN]]),targetTypeNames:n$}),{isTarget:nq}=nD({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?nr:na}),{isTarget:nU}=nD({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?nr:na}),nW=new i(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),nV=new i(["KeyboardEvent","React.KeyboardEvent"]),n_=new i(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:nz}=nC({targetTypeNames:nW,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?nr:na}}),{isKnownNonTarget:nK}=nC({targetTypeNames:nV,nonTargetTypeNames:n_}),nG=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e,nJ=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,nX=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),nY=new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),nH=new i(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),nQ=new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nZ=new i(["parseFloat","parseInt"]),n0=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&tp(e.literal),n1=new i(["-","*","/","%","**","<<",">>","|","^","&"]);function n2(e,t){let r;if(tp(e)||nX(e,"Math",nY)||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"Math",nH)||nJ(e,"Number")||nX(e,"Number",nQ)||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"Number",nZ)||nJ(e,"parseInt")||nJ(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name)return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&n2(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&n2(e.left,t)&&n2(e.right,t)||">>>"===r||n1.has(r)&&(n2(e.left,t)||n2(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&n2(e.argument,t))return!0;break}case"UpdateExpression":if(n2(e.argument,t))return!0;break;case"ConditionalExpression":{let r=n2(e.consequent,t),n=n2(e.alternate,t);if(r&&n)return!0;let o=eV(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(n2(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=eS(t,e))&&r.defs.some(e=>n0(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(n0(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(n2(e.expression,t))return!0}return"number"==typeof eV(e,t)?.value}nC({targetTypeNames:new i,targetCallNames:["Number"],isTargetTypeAnnotation:n0,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?nr:na});let n3=new i([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),n8=new i(["boolean","true","false"]),n6=new i(["isFinite","isNaN"]),n9=new o([["Array",new i(["isArray"])],["ArrayBuffer",new i(["isView"])],["Atomics",new i(["isLockFree"])],["Error",new i(["isError"])],["Number",new i(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new i(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new i(["deleteProperty","has"])],["URL",new i(["canParse"])]]),n5=new o([["array",new i(["every","includes","some"])],["map",new i(["has"])],["regexp",new i(["test"])],["set",new i(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new i(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new i(["has"])]]),n4=new o([["regexp",new i(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function n7(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(!t)return!1;if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):n8.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function oe(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>or(e.returnType,t,r,n))}function ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=rg(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function or(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return or(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&or(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>or(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function on(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return on(e.typeAnnotation,t,r,n);case"TSFunctionType":return or(e.returnType,t,r,n);case"TSTypeLiteral":return oe(e.members,t,r,n);case"TSTypeReference":return ot({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&on(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&oe(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>on(e,t,r,n));default:return!1}}function oo(e,t,r=new i){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!or(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?os(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&os(e.body,t,r))}function oa(e,t,r=new i){if(e?.type!=="Identifier")return!1;let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let o=!1;if(n.defs.length>1&&n.defs.every(e=>"FunctionName"===e.type)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),a=e.length>0?e:n.defs;o=n.references.every(e=>!e.writeExpr)&&a.every(e=>oo(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(on(e.name?.typeAnnotation,t,a))o=!0;else{let a;"FunctionName"===e.type?n.references.every(e=>!e.writeExpr)&&(a=e.node):"Variable"===e.type&&"const"===e.parent.kind&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(a=e.node.init),o=!!a&&oo(a,t,r)}}return r.delete(n),o}function oi(e,t,r=new i){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=eS(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||"Variable"!==o.type||"const"!==o.parent.kind)return;r.add(n);let a=oi(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return oi(e.expression,t,r)}}function os(e,t,r=new i){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!or(e.typeAnnotation,t,n)||"boolean"==typeof eV(e,t.sourceCode.getScope(e))?.value||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&or(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&os(n.node.init,t,r);if(!a&&"Parameter"===n.type){let e=n.name.parent;a="AssignmentPattern"===e.type&&e.left===n.name&&n.node.params.includes(e)&&os(e.right,t,r)}return r.delete(e),a}(eS(t.sourceCode.getScope(e),e),t,r)||n7(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return os(e.left,t,r)&&os(e.right,t,r);case"BinaryExpression":return n3.has(e.operator);case"ConditionalExpression":return os(e.consequent,t,r)&&os(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),or(e.typeAnnotation,t,n)||os(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=n9.get(e.callee.object.name),n=ez(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=n5.get(oi(e.callee.object,t)),n=ez(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?n7(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||n6.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||oa(e.callee,t,r)||n7(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=n4.get(oi(e.object,t)),n=ez(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return os(e.argument??e.expression,t,r);case"SequenceExpression":return os(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&os(e.right,t,r)}return}}(e,t,r)??n7(e,t))}let ol=new i(["asIntN","asUintN"]),ou=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return ou(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return tm(e.literal);default:return!1}},{isTarget:op}=nC({targetTypeNames:new i,targetCallNames:["BigInt"],isTargetNode:e=>tm(e)||nJ(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"BigInt",ol),isTargetTypeAnnotation:ou,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?nr:na}),oc=new i(["fromCharCode","fromCodePoint"]),od=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return od(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return ts(e.literal);default:return!1}},{isTarget:om,isKnownNonTarget:of}=nC({targetTypeNames:new i,targetCallNames:["String"],isTargetNode:(e,t)=>{if(ts(e)||nJ(e,"String")||"CallExpression"===e.type&&!e.optional&&nX(e.callee,"String",oc))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(og(e.left,t)||og(e.right,t));case"AssignmentExpression":if("="===e.operator)return og(e.right,t);return"+="===e.operator&&(og(e.left,t)||og(e.right,t));default:return!1}},isTargetTypeAnnotation:od,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?nr:na});function og(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&od(e.typeAnnotation)||om(e,t))||"string"==typeof eV(e,t.sourceCode.getScope(e))?.value)}let oy=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),oh=e=>oy.has(e.type)||tq(e),ox=new i(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),ob=new i(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),oE=e=>ox.has(e.type)||ob.has(e.type)||tq(e)||tb(e,void 0,ty)&&!tR(e,{method:"bind",optionalCall:!1,optionalMember:!1}),ov=(e,t)=>{if("ThisExpression"===e.type)return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&ov(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&ov(r.key,t))return!0;return!1}let r=t[e.type];if(!r)return!1;for(let n of r){let r=e[n];if(r){if(Array.isArray(r)){for(let e of r)if(e&&ov(e,t))return!0;continue}if(ov(r,t))return!0}}return!1};function oS(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function oC(e,t){let r;if(r=e=t.getNonNullableType(e),!r5.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>oC(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let oD=e=>"use"===e||/^use[\dA-Z]/.test(e),oT=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function oA(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!eS(t.sourceCode.getScope(e),e))}let ow=e=>rL(e)||e?.type==="TSInstantiationExpression",ok=e=>{for(;ow(e);)e=e.expression;return e},oI=(e,t)=>{let r=ok(e?.callee);return e?.type==="CallExpression"&&r?.type==="MemberExpression"&&!e.optional&&!r.optional&&!r.computed&&"Identifier"===r.object.type&&"process"===r.object.name&&"Identifier"===r.property.type&&"exit"===r.property.name&&oA(r.object,t)},oj=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,oF=e=>"ThrowStatement"===e.type,oB=()=>!1,oR=(e,t)=>"SequenceExpression"===e.type?e.expressions.every(e=>oW(e,t)):null!==eV(e,t.sourceCode.getScope(e)),oP=(e,t)=>{let{sourceCode:r}=t,n=eS(r.getScope(e),e.name),o=r.getRange(e)[0];return n?.defs.some(e=>("Variable"===e.type&&e.parent?.kind!=="var"||"ClassName"===e.type||"ImportBinding"===e.type)&&e.name&&r.getRange(e.name)[0]>o)!==!0},oL=(e,t)=>!!eS(t.sourceCode.getScope(e),e.name)&&oP(e,t),oN=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));return null!==r&&(null===r.value||"function"==typeof r.value)},o$=(e,t)=>{var r;let n;return"MemberExpression"===e.type&&!e.optional&&!oZ(e.object)&&(tC(e.object)||tD(e.object)||null!==(n=eV(r=e.object,t.sourceCode.getScope(r)))&&null!==n.value&&void 0!==n.value)&&(!e.computed||oW(e.property,t))},oM=(e,t)=>{let r,n;return"Identifier"===e.type&&oP(e,t)&&(r=eS(t.sourceCode.getScope(e),e.name),r?.defs.some(e=>"Variable"===e.type&&e.parent?.kind==="const"||"ClassName"===e.type||"ImportBinding"===e.type)!==!0)&&(!(n=t.sourceCode.getScope(e)).isStrict||!!eS(n,e.name))||o$(e,t)},oO=(e,t)=>"Identifier"===e.type&&oL(e,t)||o$(e,t),oq=new i(["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","&=","^=","|="]),oU=(e,t)=>{if("="===e.operator){let r;return r=e.left,"Identifier"===r.type||"ArrayPattern"===r.type||"ObjectPattern"===r.type||o$(r,t)}if(oq.has(e.operator))return oO(e.left,t);if(!["&&=","||=","??="].includes(e.operator)||!oO(e.left,t))return!1;let r=eV(e.left,t.sourceCode.getScope(e.left));return null!==r&&("&&="===e.operator?!!r.value:"||="===e.operator?!r.value:null===r.value||void 0===r.value)},oW=(e,t)=>"AssignmentExpression"===e.type?"="===e.operator&&oM(e.left,t)&&oR(e.right,t):oR(e,t),oV=(e,t)=>(e=ok(e),e?.type==="Identifier")?oL(e,t):oW(e,t),o_=e=>"using"===e.kind||"await using"===e.kind,oz=(e,t)=>"ExpressionStatement"===e.type?oW(e.expression,t):"BlockStatement"===e.type?e.body.every(e=>oz(e,t)):"EmptyStatement"===e.type||"FunctionDeclaration"===e.type||"VariableDeclaration"===e.type&&!o_(e)&&e.declarations.every(e=>"Identifier"===e.id.type&&(!e.init||oW(e.init,t))),oK=(e,t,r)=>oz(e,t)||!!r?.isAdditionalStatementDefinitelyNotThrowing?.(e),oG=e=>"ReturnStatement"===e.type&&!e.argument,oJ=(e,t)=>{if("IfStatement"!==e.type||e.alternate||!oW(e.test,t)||!(oG(e.consequent)||"BlockStatement"===e.consequent.type&&1===e.consequent.body.length&&oG(e.consequent.body[0])))return!1;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&!r.value},oX=(e,t)=>e.declarations.some(e=>e.init&&o2(e.init,t)),oY=(e,t)=>{for(let r of e.declarations)if(r.init){if(o5(r.init,t))return!0;if(o_(e))return!1;if("Identifier"!==r.id.type||!oW(r.init,t))break}return!1},oH=(e,t,r,n={})=>{let{isAdditionalStatementAlwaysExits:o=()=>!1}=n;for(let a of e){if(ad(a,t,r,n)||o(a))return!0;if(!oJ(a,t)&&!oK(a,t,n))break}return!1},oQ=(e,t,r=!0,n)=>!function(e,t){if("StaticBlock"!==e.type)return!1;let r=e,{parent:n}=e;for(;n&&!tw(n);){if("ClassDeclaration"===n.type||"ClassExpression"===n.type)return!!(n.superClass&&n.superClass!==r&&!o5(n.superClass,t)&&!oN(n.superClass,t));r=n,{parent:n}=n}return!1}(e,t)&&oH(e.body,t,r,n);function oZ(e){return e?.type==="MemberExpression"?e.optional||oZ(e.object):e?.type==="CallExpression"&&(e.optional||oZ(e.callee))}function o0(e,t){if(!o9(e,t))return!1;let r=e,{parent:n}=e;for(;n&&!tw(n);){if(("ClassDeclaration"===n.type||"ClassExpression"===n.type)&&n.superClass&&n.superClass!==r&&!o5(n.superClass,t)&&!oN(n.superClass,t)||"CallExpression"===n.type&&n.arguments.includes(r)&&(n.optional||oZ(n.callee))||"MemberExpression"===n.type&&n.computed&&n.property===r&&(n.optional||oZ(n.object)))return!1;r=n,{parent:n}=n}return!0}let o1=(e,t)=>{let r,n=eV(e.left,t.sourceCode.getScope(e.left));if(null===n||!oW(e.left,t))return!1;switch(e.operator){case"&&":r=!!n.value;break;case"||":r=!n.value;break;default:r=null===n.value||void 0===n.value}return r};function o2(e,t){if(oI(e,t))return!0;if(ow(e))return o2(e.expression,t);switch(e?.type){case"ChainExpression":return o2(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return o2(e.argument,t);case"CallExpression":case"NewExpression":return!!o2(e.callee,t)||!("CallExpression"===e.type&&(e.optional||oZ(e.callee)))&&!!oV(e.callee,t)&&e.arguments.some(e=>o2(e,t));case"MemberExpression":return o2(e.object,t)||e.computed&&!e.optional&&!oZ(e.object)&&oV(e.object,t)&&o2(e.property,t);case"ArrayExpression":return e.elements.some(e=>e&&o2(e,t));case"ObjectExpression":return e.properties.some(e=>"SpreadElement"===e.type?o2(e.argument,t):e.computed&&o2(e.key,t)||o2(e.value,t));case"YieldExpression":return!!(e.argument&&o2(e.argument,t));case"AssignmentExpression":return o2(e.left,t)||oU(e,t)&&o2(e.right,t);case"ImportExpression":return o2(e.source,t);case"TemplateLiteral":return e.expressions.some(e=>o2(e,t));case"TaggedTemplateExpression":return o2(e.tag,t)||oV(e.tag,t)&&e.quasi.expressions.some(e=>o2(e,t));case"ClassExpression":return am(e,t,!0);case"SequenceExpression":return e.expressions.some(e=>o2(e,t));case"ConditionalExpression":if(o2(e.test,t))return!0;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&oW(e.test,t)?o2(r.value?e.consequent:e.alternate,t):o2(e.consequent,t)&&o2(e.alternate,t);case"LogicalExpression":return o2(e.left,t)||o1(e,t)&&o2(e.right,t);case"BinaryExpression":return o2(e.left,t)||o2(e.right,t);default:return!1}}function o3(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type)return e.label?.name===r;if("LabeledStatement"===e.type&&e.label.name===r)return!1;if("IfStatement"===e.type){if(o5(e.test,t))return!1;let n=eV(e.test,t.sourceCode.getScope(e.test));if(null!==n&&oW(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&o3(o,t,r))}}if(o2(e.expression,t))return!1;if("BlockStatement"===e.type){for(let n of e.body){if(o3(n,t,r))return!0;if(af(n,t))break}return!1}for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>o3(e,t,r)))return!0}return!1}let o8=(e,t)=>{if("SpreadElement"===e.type)return o5(e.argument,t);if(e.computed){if(o5(e.key,t))return!0;if(!oW(e.key,t))return!1}return o5(e.value,t)},o6=(e,t)=>{for(let r of e)if(r){if(o5(r,t))return!0;if(!oW(r,t))break}return!1},o9=(e,t)=>oI(e,t)&&(e.arguments.every(e=>oW(e,t))||o6(e.arguments,t));function o5(e,t){if(o9(e,t))return!0;if(ow(e))return o5(e.expression,t);switch(e?.type){case"ChainExpression":return o5(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return o5(e.argument,t);case"CallExpression":case"NewExpression":return!!o5(e.callee,t)||!("CallExpression"===e.type&&(e.optional||oZ(e.callee)))&&!!oV(e.callee,t)&&o6(e.arguments,t);case"MemberExpression":return o5(e.object,t)||e.computed&&!e.optional&&!oZ(e.object)&&(tC(e.object)||tD(e.object))&&o5(e.property,t);case"ArrayExpression":return o6(e.elements,t);case"ObjectExpression":for(let r of e.properties){if(o8(r,t))return!0;if("SpreadElement"===r.type){if(!oW(r.argument,t))return!1;continue}if(r.computed&&!oW(r.key,t)||!oW(r.value,t))break}return!1;case"ClassExpression":return ac(e,t,!0);case"AssignmentExpression":return o5(e.left,t)||oU(e,t)&&o5(e.right,t);case"TaggedTemplateExpression":return!!o5(e.tag,t)||!!oV(e.tag,t)&&o6(e.quasi.expressions,t);case"YieldExpression":return!!(e.argument&&o5(e.argument,t));case"ImportExpression":return o5(e.source,t);case"TemplateLiteral":case"SequenceExpression":return o6(e.expressions,t);case"LogicalExpression":return!!o5(e.left,t)||o1(e,t)&&o5(e.right,t);case"BinaryExpression":return o5(e.left,t)||oW(e.left,t)&&o5(e.right,t);case"ConditionalExpression":if(o5(e.test,t))return!0;let r=eV(e.test,t.sourceCode.getScope(e.test));return null!==r&&oW(e.test,t)?o5(r.value?e.consequent:e.alternate,t):oV(e.test,t)&&o5(e.consequent,t)&&o5(e.alternate,t);default:return!1}}function o4(e,t,r,n){if(e.finalizer&&af(e.finalizer,t,!0,n))return!0;let o=e.handler?oQ(e.block,t,r,n):af(e.block,t,r,n);return r?!!o||!!(e.handler&&aA(e.block,t,oF)&&af(e.handler,t,!0,n)):o||e.handler&&aA(e.block,t,oF)&&af(e.handler,t,!1,n)}function o7(e,t,r,n){for(let o of e.body){if(af(o,t,r,n))return!0;if(oj(o)||aA(o,t,oj))break}return!1}let ae=(e,t,r,n)=>{let{checkTryStatements:o,enclosingLoop:a,isAtStart:i,isLastStatement:s,options:l,isProcessExitAtTest:u}=n;if("BlockStatement"!==e.type&&(i?ad(e,r,o,l):af(e,r,o,l))||"BlockStatement"!==e.type&&!i&&aA(e,r,oj)&&!("SwitchStatement"===e.type&&aS(e,t,r)))return!0;if(oK(e,r,l)||ay(e,t))return u;if("LabeledStatement"===e.type&&tI(e.body))return ae(e.body,t,r,n);if("IfStatement"===e.type){let o=eV(e.test,r.sourceCode.getScope(e.test));if(null!==o&&oW(e.test,r)){let a=o.value?e.consequent:e.alternate;return a?ae(a,t,r,n):u}return oV(e.test,r)&&ae(e.consequent,t,r,n)&&(e.alternate?ae(e.alternate,t,r,n):u)}if("BlockStatement"!==e.type)return u&&s&&("SwitchStatement"===e.type&&(!o||ai(e,t,r,l))&&!av(e,t,r)||tI(e)&&(!an(e,r)||aa(e,n))&&(!o||au(e,r))&&(!o||ao(e.body,e,n))&&!av(e,t,r));if(i){if(oQ(e,r,o,l)||at(e.body,t,r,n))return!0;let a=e.body.at(-1);return a&&ay(a,t)&&e.body.slice(0,-1).every(e=>oK(e,r,l))?u:1===e.body.length&&ae(e.body[0],t,r,n)}if(e.body.some(e=>aS(e,t,r))){if(at(e.body,t,r,n)||ar(e.body,t,r,n))return!0;let o=e.body.at(-1);return!!(o&&aS(o,t,r)&&ae(o,t,r,n))}return ar(e.body,t,r,n)},at=(e,t,r,n)=>{let{isProcessExitAtTest:o,options:a}=n,i=e.findIndex(e=>aE(e,t,r)),s=-1===i?void 0:e[i];return!!(s&&e.slice(0,i).every(e=>oK(e,r,a))&&o&&(s.alternate?ae(s.alternate,t,r,n):i===e.length-1||ar(e.slice(i+1),t,r,n)))},ar=(e,t,r,n)=>{let{checkTryStatements:o,isAtStart:a,options:i,isProcessExitAtTest:s}=n,l=!1;for(let[u,p]of e.entries()){if(a){if(ad(p,r,o,i))return!0;if(ay(p,t))return s;if(!oK(p,r,i))return!1;continue}if(!oK(p,r,i)){if(aE(p,t,r)&&l)break;if(ae(p,t,r,{...n,isLastStatement:u===e.length-1}))return!0;if(aS(p,t,r))break;l=!0}}return!1},an=(e,t)=>("WhileStatement"===e.type||"ForStatement"===e.type)&&(!e.test||!!eV(e.test,t.sourceCode.getScope(e.test))?.value),ao=(e,t,r)=>{let{context:n,enclosingLoop:o,options:a}=r;if(ah(e,t)||ay(e,t)||o&&ay(e,o)||"EmptyStatement"===e.type)return!0;if("IfStatement"===e.type&&oV(e.test,n))return ao(e.consequent,t,r)&&(!e.alternate||ao(e.alternate,t,r));if("BlockStatement"!==e.type)return!1;let i=e.body.at(-1);return!!(!i||ao(i,t,r)&&e.body.slice(0,-1).every(e=>oK(e,n,a)))},aa=(e,t)=>{let{context:r,enclosingLoop:n}=t;return ao(e.body,e,t)||aA(e.body,r,t=>ah(t,e)||!!(n&&ay(t,n)))},ai=(e,t,r,n)=>{let o=a=>oK(a,r,n)||aC(a,e)||ay(a,t)||"BlockStatement"===a.type&&a.body.length>0&&o(a.body.at(-1))&&a.body.slice(0,-1).every(e=>oK(e,r,n));return oW(e.discriminant,r)&&e.cases.every(e=>(null===e.test||oW(e.test,r))&&e.consequent.every(e=>o(e)))},as=(e,t,r,n)=>an(e,t)&&ad(e.body,t,r,n),al=(e,t)=>"VariableDeclaration"===e.type?oz(e,t):oW(e,t),au=(e,t)=>{let r;return"WhileStatement"===e.type||"DoWhileStatement"===e.type?oV(e.test,t):"ForStatement"===e.type?(!e.init||al(e.init,t))&&(!e.test||oV(e.test,t))&&(!e.update||oW(e.update,t)):("ForInStatement"===e.type||"ForOfStatement"===e.type)&&(r=e.left,"VariableDeclaration"===r.type?oz(r,t):oM(r,t))&&oW(e.right,t)},ap=(e,t,r,{checkTryStatements:n,switchStatement:o,options:a})=>{let i=[];for(let r=t;r<e.length;r++)i.push(...e[r].consequent);return oH(i,r,n,{...a,isAdditionalStatementAlwaysExits:e=>aD(e,o)})},ac=(e,t,r,n)=>{if(e.superClass){if(o5(e.superClass,t))return!0;if(!oN(e.superClass,t))return!1}for(let o of e.body.body){if(o.computed){if(o5(o.key,t))return!0;if(!oW(o.key,t))break}if("StaticBlock"===o.type){if(oQ(o,t,r,n))return!0;if(o.body.some(e=>!oK(e,t,n)))return!1;continue}if("PropertyDefinition"===o.type&&o.static){if(o.value&&o5(o.value,t))return!0;if(o.value&&!oW(o.value,t))break}}return!1};function ad(e,t,r=!0,n){if("ExpressionStatement"===e.type)return o5(e.expression,t);if("VariableDeclaration"===e.type)return oY(e,t);if("ReturnStatement"===e.type||"ThrowStatement"===e.type)return!!(e.argument&&o5(e.argument,t));if("IfStatement"===e.type||"ConditionalExpression"===e.type){var o;if(o5(e.test,t))return!0;let a=eV(e.test,t.sourceCode.getScope(e.test));if(null!==a&&oW(e.test,t)){let o=a.value?e.consequent:e.alternate;return!!(o&&ad(o,t,r,n))}return oV(e.test,t)&&ad(e.consequent,t,r,n)&&!!(e.alternate&&ad(e.alternate,t,r,n))}if("BlockStatement"===e.type)return oQ(e,t,r,n);if("TryStatement"===e.type)return o=n,!!(e.finalizer&&ad(e.finalizer,t,r,o))||(e.finalizer&&o?.isAdditionalStatementAlwaysExits&&!oK(e.finalizer,t,o)&&(o={...o,isAdditionalStatementAlwaysExits:void 0}),e.handler?o4(e,t,r,o):oQ(e.block,t,r,o));if("LabeledStatement"===e.type)return!o3(e.body,t,e.label.name)&&ad(e.body,t,r,n);if(["DoWhileStatement","WhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return"DoWhileStatement"===e.type?ae(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!0,isLastStatement:!0,options:n,isProcessExitAtTest:o5(e.test,t)}):((e,t,r,n)=>{if("WhileStatement"===e.type)return o5(e.test,t)||as(e,t,r,n);if("ForStatement"===e.type){if(e.init){let r;if(r=e.init,"VariableDeclaration"===r.type?oY(r,t):o5(r,t))return!0;if(!al(e.init,t))return!1}return!!(e.test&&o5(e.test,t)||an(e,t)&&e.update&&o5(e.update,t)&&oz(e.body,t)||as(e,t,r,n))}return("ForInStatement"===e.type||"ForOfStatement"===e.type)&&o5(e.right,t)})(e,t,r,n);if("SwitchStatement"===e.type){if(o5(e.discriminant,t))return!0;if(!oV(e.discriminant,t))return!1;let o=e.cases.findIndex(e=>e.test&&o5(e.test,t)),a=e.cases.findIndex(e=>null===e.test);for(let[a,i]of e.cases.entries()){if(-1!==o&&a>=o)break;if(null!==i.test&&!oW(i.test,t)||!ap(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n}))return!1}return -1!==o||-1!==a&&ap(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n})}return"ClassDeclaration"===e.type||"ClassExpression"===e.type?ac(e,t,r,n):af(e,t,r,n)}let am=(e,t,r,n)=>{if(e.superClass){if(o2(e.superClass,t))return!0;if(!oN(e.superClass,t))return!1}return e.body.body.some(e=>!!(e.computed&&o2(e.key,t))||("StaticBlock"===e.type?o7(e,t,r,n):"PropertyDefinition"===e.type&&e.static&&o2(e.value,t)))};function af(e,t,r=!0,n){if("ExpressionStatement"===e.type&&o2(e.expression,t)||o2(e,t)||("ReturnStatement"===e.type||"ThrowStatement"===e.type)&&e.argument&&o2(e.argument,t)||"SwitchStatement"===e.type&&o2(e.discriminant,t))return!0;if("BlockStatement"===e.type)return o7(e,t,r,n);if("CatchClause"===e.type)return af(e.body,t,r,n);if("VariableDeclaration"===e.type)return oX(e,t);if("DoWhileStatement"===e.type)return ae(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!1,isLastStatement:!0,options:n,isProcessExitAtTest:o2(e.test,t)});return"WhileStatement"===e.type?o2(e.test,t)||as(e,t,r,n):"ForStatement"===e.type?!!(e.init&&("VariableDeclaration"===e.init.type?oX(e.init,t):o2(e.init,t))||e.test&&o2(e.test,t)||an(e,t)&&e.update&&o2(e.update,t)&&oz(e.body,t)||as(e,t,r,n)):"ForInStatement"===e.type||"ForOfStatement"===e.type?o2(e.right,t):"ClassDeclaration"===e.type||"ClassExpression"===e.type?am(e,t,r,n):"LabeledStatement"===e.type?!o3(e.body,t,e.label.name)&&af(e.body,t,r,n):"TryStatement"===e.type?o4(e,t,r,n):"SwitchStatement"===e.type?aT(e,t,oB,r):!!("IfStatement"===e.type&&o2(e.test,t))||("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&af(e.consequent,t,r,n)&&af(e.alternate,t,r,n)}function ag(e){let t=e.parent;if(e.label){for(;t&&!tw(t);){if("LabeledStatement"===t.type&&t.label.name===e.label.name)return t;t=t.parent}return}let r="BreakStatement"===e.type;for(;t&&!tw(t);){if(r&&(tI(t)||"SwitchStatement"===t.type)||!r&&tI(t))return t;t=t.parent}}function ay(e,t){return"ContinueStatement"===e.type?ax(ag(e),t):"BlockStatement"===e.type&&1===e.body.length&&ay(e.body[0],t)}function ah(e,t){return"BreakStatement"===e.type&&ax(ag(e),t)}function ax(e,t){return e===t||e?.type==="LabeledStatement"&&e.body===t}function ab(e,t){for(let r=t.parent;r;r=r.parent){if(r===e)return!0;if(tw(r))break}return!1}function aE(e,t,r){return"IfStatement"===e.type&&oV(e.test,r)&&ay(e.consequent,t)}function av(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ag(e),n=ax(r,t);if("BreakStatement"===e.type&&n||!n&&ab(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>av(e,t,r)))return!0}return!1}function aS(e,t,r){if(!e||tw(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=ag(e);if(ax(r,t)||ab(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>aS(e,t,r)))return!0}return!1}function aC(e,t){return"BreakStatement"===e.type&&ax(ag(e),t)}function aD(e,t){if("BreakStatement"!==e.type&&"ContinueStatement"!==e.type)return!1;let r=ag(e);return!(!r||ax(r,t))&&ab(r,t)}function aT(e,t,r,n){let o=[],a=r===oB?r:t=>oj(t)||r(t)||aD(t,e),i=!1;for(let s=e.cases.length-1;s>=0;s--){let l=e.cases[s];i=!function e(t,r,n,o){for(let a of t){if(function t(r,n,o,a){if(!r||tw(r))return!1;if("BreakStatement"===r.type&&aC(r,o)||a&&aD(r,o))return!0;if("BlockStatement"===r.type)return e(r.body,n,o,a);if(tI(r)||"SwitchStatement"===r.type)return!1;if("IfStatement"===r.type){if(o5(r.test,n))return!1;let e=eV(r.test,n.sourceCode.getScope(r.test));if(null!==e&&oW(r.test,n)){let i=e.value?r.consequent:r.alternate;return!!(i&&t(i,n,o,a))}}for(let e of n.sourceCode.visitorKeys[r.type]??[]){let i=r[e];if((Array.isArray(i)?i:[i]).some(e=>t(e,n,o,a)))return!0}return!1}(a,r,n,o))return!0;if(oj(a)||aA(a,r,oj)||af(a,r))break}return!1}(l.consequent,t,e,r===oB)&&(l.consequent.some(e=>aA(e,t,a)||af(e,t,n))||i),o[s]=i}let s=e.cases.findIndex(e=>e.test&&o5(e.test,t));return -1!==s?e.cases.every((e,t)=>t>=s||o[t]):e.cases.some(e=>null===e.test)&&o.every(Boolean)}function aA(e,t,r){if(r(e)||af(e,t,!1))return!0;if("BlockStatement"===e.type){let n=e.body.at(-1);return!!(n&&aA(n,t,r))}if("CatchClause"===e.type)return aA(e.body,t,r);if("TryStatement"===e.type)return!!(e.finalizer&&aA(e.finalizer,t,r)||e.handler&&aA(e.block,t,r)&&aA(e.handler,t,r));if("SwitchStatement"===e.type)return aT(e,t,r,!1);if("IfStatement"===e.type||"ConditionalExpression"===e.type){let n=eV(e.test,t.sourceCode.getScope(e.test));if(null!==n&&oW(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&aA(o,t,r))}}return("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&aA(e.consequent,t,r)&&aA(e.alternate,t,r)}let aw=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],ak=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&aw(n,o,t)&&n===e},aI=new i(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function aj(e){return aI.has(e.type)}let aF=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,aB=e=>tT(e.parent),aR=new i(["String","Null","Boolean","Numeric","RegularExpression"]),aP=new i(["[","(","/","`","+","-","*",",","."]);function aL(e,t,r){if(""===r||r&&!aP.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e,i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);if("Punctuator"===o){if(";"===a)return!1;if("]"===a)return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!aR.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let aN=e=>"type"===e.importKind||"type"===e.parent.importKind,a$=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],aM=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},aO=new i(["Map","ReadonlyMap"]),aq=new i(["Set","ReadonlySet"]),aU=aO.union(aq),aW=e=>new i([e]),aV=e=>aU.has(e)?e:void 0,a_=new i(["ClassName","ImportBinding","TSEnumName","Type"]),az=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>a_.has(e.type)))return!0;n=n.upper}return!1},aK=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},aG=(e,t)=>{if(r5.has(e.intrinsicName))return;if(e.isUnion())return aK(e.types.map(e=>aG(e,t)));let r=r7(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&aV(n);return o&&aW(o)},aJ=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return aJ(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?aJ(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||az(e.typeName.name,e,t))return;let r=aV(e.typeName.name);return r&&aW(r)}case"TSUnionType":return aK(e.types.map(e=>aJ(e,t)))}},aX=(e,t,r=new i)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=aG(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(az(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tE(e,{names:["Map","Set"]})&&oA(e.callee,t))return aW(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=eS(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=aJ(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=aX(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return aJ(e.typeAnnotation,t)??aX(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return aX(e.expression,t,r);case"ConditionalExpression":return aK([aX(e.consequent,t,r),aX(e.alternate,t,r)])}})(e,t,r),aY=(e,t)=>{let r=aX(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(aO.has(e)){n=!0;continue}if(aq.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function aH(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)aH(r,t)}class aQ extends Error{name="FixAbortError"}let aZ={abort(){throw new aQ("Fix aborted.")}};function a0(e){return t=>{let r=e(t,aZ),n=[];try{return aH(r,e=>{n.push(e)}),n}catch(e){if(e instanceof aQ)return;throw e}}}class a1{#e;#t=new o;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=a0(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:a0(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&aH(t,r)}}}(this.#e,r);return e}}let a2=new i;function a3(e){return a2.has(e)?e:t=>{let r=new a1(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return E.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function a8(e,t){var r;let{visitScriptBlock:n=!0}={},o=a3(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},a2.add(r),r}let a6={"??":4,"||":4,"&&":5},a9={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function a5(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return a6[e.operator];case"BinaryExpression":return a9[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function a4(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let a7=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function ie(e){if(tp(e=rN(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=ie(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function it(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"ArrayExpression":case"FunctionExpression":return!1;case"NewExpression":return!rC(e,t);case"Literal":let r;return!!(tp(e)&&(r=e.raw,a7.test(r)));default:return!0}}let ir=new i(["!","typeof","void","delete","~","+","-"]),io=new i(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function ia(e,t){if(!ir.has(t))throw Error("Unexpected operator");return 16>a5(e)||io.has(e.type)}function ii(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}function is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var il={exports:{}},iu=il.exports,ip=is(function(){return u?il.exports:(u=1,il.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),il.exports)}());function ic(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function id(e,t){let r=[],n=[],o=()=>n.at(-1),a=new s,u=new s,p=new l;e.on("onCodePathStart",()=>{r.push(new i),n.push(new l)}),e.on("onCodePathEnd",()=>{r.pop(),n.pop()});let c=e=>{r.at(-1).add(e),e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||o().has(e))&&o().add(e)};return e.on("onCodePathSegmentStart",c),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",c),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.onExit("CallExpression",t=>{if(!(e=>{let t=e,{parent:r}=e;for(;r&&!tw(r);){if("TryStatement"===r.type&&r.finalizer&&r.block===t){let t=r.block.body.at(-1);return 1===r.block.body.length&&t?.type==="ExpressionStatement"&&t.expression===e}t=r,{parent:r}=r}return!1})(t)&&o0(t,e))for(let e of r.at(-1))e.reachable&&o().add(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable&&!o().has(e))&&p.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{a.set(e,new i(r.at(-1)))}),e.onExit("IfStatement",e=>{let n=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let o=a.get(r),i=o&&[...n].every(e=>e.prevSegments.every(e=>!o.has(e)))||t?.(r);u.set(r,p.has(e)&&!!i)}}),e=>!!(e&&u.get(e))}function im(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let ig=(e,t)=>im(e,t,1),iy=e=>e.charAt(0).toUpperCase()+e.slice(1),ih=e=>e.charAt(0).toLowerCase()+e.slice(1),ix="too-deep",ib="should-parenthesized",iE="prefer-event-target",iv=new i(["@angular/core","eventemitter3"]),iS=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function iC(e){let t;return!!e&&(tN(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(ts(t)&&iv.has(t.value)))}let iD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},iT="prefer-keyboard-event-key",iA="prefer-keyboard-event-key/suggestion",iw=new i(["keyCode","charCode","which"]),ik=new i(["onKeyDown","onKeyPress","onKeyUp"]),iI=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},ij=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tR(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&ik.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))iI(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nK(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},iF=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,iB=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tw(n)&&r.push(...ij(e,n));return r},iR=(e,{shouldAutofix:t})=>{let r=(e=>{var t;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let r=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!r||"IfStatement"!==r.type)return;let{type:n,operator:o,right:a}=r.test;if(!("BinaryExpression"===n&&r.test.left===e.parent&&("=="===o||"==="===o)&&tp(a)))return;let i=Object.hasOwn(iD,t=a.value)?iD[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:iT,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tQ(r.key))];return t?n.fix=o:n.suggest=[{messageId:iA,data:{key:r.key},fix:o}],n},iP=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),iL=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},iN="error",i$="suggestion";function*iM(e,t,r){for(let n of tr(e,r))yield t.remove(n)}function iO(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=eT(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function iq(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=tr(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);eT(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}(t,r),o=t.parent;if(0===o.arguments.indexOf(t)&&o.arguments.length>1&&rV(r,n)){let{sourceCode:o}=r,a=tr(t,r).at(-1)||t,[,i]=o.getRange(a),s=o.getTokenAfter(a),[l,u]=o.getRange(s),p=o.text.slice(...n),c=p.slice(i-n[0],l-n[0])+p.slice(u-n[0]);return e.replaceTextRange(n,c)}return e.removeRange(n)}function iU(e,t,r,n){return e.replaceTextRange(tn(t,n),r)}function iW(e,t,r,n){let o=to(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!it(r,n):aj(r))||ta(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),aL(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*iV(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);eA(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function i_(e,t,r){let n="object"==typeof e?t.sourceCode.getRange(e)[1]:e,[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*iz(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield i_(n,t,r),rC(e,t)||(yield r.insertTextAfter(e,"()")),oS(n,e.callee,t)||ta(e,t)||(yield iV(r,e.parent,t))}let iK=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*iG(e,t,r){let{sourceCode:n}=r,o=tn(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&iK(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&iK(i)&&(yield e.insertTextBefore(i," "))}function*iJ(e,t,r){var n;yield iG(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!ta(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function iX(e,t,r,n){let[,o]=tn(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let iY=(e,t,r)=>iX(e,t,r,"");function*iH(e,t,r){let n=t.callee;yield iY(e,n,r);let[,o]=tn(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function iQ(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);eA(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p))if(d+=p.length,0===c){let{text:e}=o;"\r"===e[d]&&"\n"===e[d+1]?d+=2:("\n"===e[d]||"\r"===e[d])&&d++}else c=Math.max(0,c-u.length-1);return r.removeRange([c,d])}function iZ(e,t,r,n){if(aF(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&aF(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(ak(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&aw(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let i0=(e,t,r,n)=>r1(e).map(e=>iZ(e,t,r,n)),i1=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*i2(e,t,r,n,o){for(let t of tr(e,o?{sourceCode:o}:n))yield i2(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let i3="require-array-join-separator",i8="no-thenable-object",i6="no-thenable-export",i9="no-thenable-class",i5=(e,t)=>eV(e,t.sourceCode.getScope(e))?.value==="then",i4=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===ez(e,t.sourceCode.getScope(e)):"then"===r.name},i7=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&i4(r,t)&&(yield r.key)},messageId:i8},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){i4(e,t)&&(yield e.key)},messageId:i9},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&i4(e,t)&&(yield e.property)},messageId:i8},{selector:"CallExpression",*getNodes(e,t){if(!tR(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})||"SpreadElement"===e.arguments[0].type)return;let[,r]=e.arguments;i5(r,t)&&(yield r)},messageId:i8},{selector:"CallExpression",*getNodes(e,t){if(tR(e,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===e.arguments[0].type)for(let r of e.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0])||"SpreadElement"===r.elements[0].type)continue;let[e]=r.elements;i5(e,t)&&(yield e)}},messageId:i8},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:i6},{selector:"Identifier",*getNodes(e){"then"===e.name&&("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent&&(yield e)},messageId:i6},{selector:"VariableDeclaration",*getNodes(e,t){if("ExportNamedDeclaration"===e.parent.type&&e.parent.declaration===e)for(let r of t.sourceCode.getDeclaredVariables(e))"then"===r.name&&(yield*r.identifiers)},messageId:i6}],se="no-invalid-remove-event-listener",st="consistent-function-scoping",sr=(e,t)=>e&&t&&(e===t||e.block===t.block),sn=(e,t)=>e.some(e=>sr(e,t)),so=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),sa=new i(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),si=e=>e?.type==="BlockStatement"&&sa.has(e.parent.type)&&e.parent.body===e,ss=new i(["FunctionExpression","ArrowFunctionExpression"]),sl={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tA,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&ov(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tA.includes(t.type)&&tM(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),si(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&tM(l.block.parent.callee,so)||l&&(a=s,ss.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||rh(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(sn(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&sn(u,t.scope)})||e.defs.some(e=>sn(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type||t.acquire(e))return!1;let r=t.acquire(e.parent);return!(!r||sr(i,r))&&sn(u,r.upper)}))}(e,n,r))return{node:e,loc:eR(e,r),messageId:st,data:{functionNameWithKind:eK(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[st]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},su="error",sp="error-unknown",sc="suggestion";function sd(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield iz(e,t,n)}}let sm="no-console-spaces",sf=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),sg=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),sy="no-empty-file",sh={create:e=>{let{allowComments:t}=e.options[0];e.filename===e.physicalFilename&&(e.on("Program",r=>{if(r.templateBody)return;if(1===r.body.length&&"Document"===r.body[0].type){let{children:e}=r.body[0];if(e.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&e.some(e=>"Comment"===e.type))return;return{node:r,messageId:sy}}if(r.body.some(e=>!tS(e,tv)))return;let{sourceCode:n}=e,o=rM(e);if(0!==n.ast.tokens.length||0!==o.length||""===n.text.trim()){if(!o.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&o.length>0&&o.every(e=>"Line"===e.type||"Block"===e.type))||0!==n.ast.tokens.length))return{node:r,messageId:sy}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=rM(e);if(!t||!(n.length>0))return{node:r,messageId:sy}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=rM(e);if(!t||!(n.length>0))return{node:r,messageId:sy}}),e.on("root",e=>{if(!e.children.some(e=>!("html"===e.type&&/^<!--(?:(?!-->)[\s\S])*-->$/.test(e.value.trim())))&&(!t||!(e.children.length>0)))return{node:e,messageId:sy}}))},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[sy]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},sx="no-useless-fallback-in-spread";function sb(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function sE(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let sv="zero-fraction",sS="dangling-dot",sC="error",sD="suggestion",sT=Symbol.for("default"),sA=Symbol("NAMESPACE_SPECIFIER_NAME"),sw=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},sk=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*sI(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?eT:ej),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);eT(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function sj(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let sF={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new i,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{ts(e.source)&&o.push(e)}),e.on("Program:exit",function*(a){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:aN(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:sT,text:"default",...n};case"ImportSpecifier":return{name:sw(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:sA,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:sT,text:"default",isTypeExport:sk(r)};case"ExportSpecifier":return{node:r,name:sw(r.exported),text:t.getText(r.exported),isTypeExport:sk(r)};case"VariableDeclarator":{let n=r.parent.parent;if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===n.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==sA||o.name!==sT)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:t,exports:r}of n)for(let n of function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(r)){let r={node:n.node,messageId:sC,data:{exported:n.text}},i=function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===sA)yield n.insertTextAfter(o,`
28
- export ${l?"type ":""}* as ${r.text} ${sj(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,ej);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
- export {${s}} ${sj(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield sI(t.node,n,e)),yield sI(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:sD,fix:i}]:r.fix=i,yield r}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[sC]:"Use `export…from` to re-export `{{exported}}`.",[sD]:"Switch to `export…from`."},languages:["js/js"]}},sB="prefer-native-coercion-functions",sR=new i(["String","Number","BigInt","Boolean","Symbol"]),sP=new i(["every","filter","find","findLast","findIndex","findLastIndex","some"]),sL=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&sR.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,sN=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},s$=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},s$(e[r],n)):e[r]=n}};class sM{static READ=e5.READ;static CALL=e5.CALL;static CONSTRUCT=e5.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=e5.READ,context:n,filter:o,handle:a}){for(let e of t)s$(this.#n,sN(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new e5(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}let sO="no-document-cookie",sq=new sM({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:sO})}),sU=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],sW=new i(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...sU("AnimationStart"),...sU("AnimationEnd"),...sU("AnimationIteration"),...sU("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),sV="prefer-add-event-listener",s_={create:e=>{let t,r,n=new i(e.options[0].excludedPackages),o=new s;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{o.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tN(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{let n;if(t)return;let{left:a,right:i,operator:s}=r;if("MemberExpression"!==a.type||a.computed)return;let l=a.property.name;if(!l||!l.startsWith("on"))return;let u=l.slice(2);if(!sW.has(u))return;let p="addEventListener",c="";if(tq(i)||td(i))p="removeEventListener";else"beforeunload"===u&&("ArrowFunctionExpression"!==i.type&&"FunctionExpression"!==i.type||"BlockStatement"!==i.body.type||o.get(i))?c="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.":"message"===u?c="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.":"error"===u?c="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.":"="!==s||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||oE(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);ta(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);ta(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,a));return{node:a.property,messageId:sV,data:{replacement:p,method:l,extra:c?` ${c}`:""},fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[sV]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},sz=new i(["false","true"]),sK=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(oT(e.left,t)||oT(e.right,t)),sG=({type:e,name:t},r)=>"Identifier"===e&&t===r;function sJ({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p;if(!tR(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&sK(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&sK(p.body.body[0].argument,p.params[0]))||nL(r.callee.object,n))return;let[c]=r.arguments,d="BinaryExpression"===c.body.type?c.body:c.body.body[0].argument,[m]=c.params,{left:f,right:g}=d,{name:y}=m;if(sG(f,y))l=g,u=f;else{if(!sG(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||eS(h,m).references.some(({identifier:e})=>e!==u)||r6(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);ta(l,n)&&!ta(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eH(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tR(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:l}=i,u=function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(oT(r,t))return r;if("CallExpression"===r.type&&!r.optional&&sG(r.callee,"Boolean")&&1===r.arguments.length&&oT(r.arguments[0],t))return r.arguments[0]}}(n,a);if(!u||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>sz.has(e))}(l.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(l.getTypeAtLocation(r.callee.object),l))return;let p=s.acquire(n);if(!p||eS(p,a).references.some(({identifier:e})=>e!==u)||r6(n,p))return;let c=r.callee.property;return{node:c,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(c,t),yield e.replaceText(n,"true")}}})}}}let sX=sJ({method:"findIndex",replacement:"indexOf"}),sY=sJ({method:"findLastIndex",replacement:"lastIndexOf"}),sH={create(e){sX.listen(e),sY.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...sX.messages,...sY.messages},languages:["js/js"]}},sQ="error",sZ="prefer-date",s0="prefer-date-now-over-methods",s1="prefer-date-now-over-number-data-object",s2=e=>tE(e,{name:"Date",argumentsLength:0}),s3=(e,t,r)=>({node:e,messageId:sZ,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield iG(t,e,r))},...t}),s8="prefer-dataset",s6="prefer-attributes",s9=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,s5=e=>tF(e,{property:"dataset"}),s4=e=>e.computed||"Identifier"!==e.property.type?e.computed&&ts(e.property)?e.property.value:void 0:e.property.name,s7=new i(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),le=/[\s\u0000-\u001F"'/<=>]/,lt=e=>s7.has(e)||e.includes("-")||le.test(e);function lr(e,t){let r=to(e,t);return!ta(e,t.sourceCode)&&it(e,t)?`(${r})`:r}let ln={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(lt(n.value)||nz(o.object,e))return;let a=lr(o.object,e),i=o.optional?"?.":".",s=tQ(s9(n.value),n.raw.charAt(0)),l=rU(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return aL(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:s6,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&ts(e.left)&&s5(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tR(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&s5(e.arguments[0])&&ts(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tR(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&s5(e.callee.object)&&ts(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&s5(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||nz(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:s6,data:{method:"getAttribute"},fix:function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e);if(!a)return;let i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if("MemberExpression"!==n.type||n.object!==e||n.optional)return;let o=s4(n);if(void 0===o||lt(o))return;let{parent:a}=n;if(nG(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>eS(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!rU(t,o)&&i.every(e=>!rU(t,e))))return;let s=lr(n.object,t);return function*(e){for(let r of(yield iQ(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tQ(s9(s4(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e)};let{properties:o}=t.id;if(o.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!ts(e.key)||lt(e.key.value):lt(e.key.name))))return;let a=t.parent,i=lr(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!rU(e,a,[n.object])&&o.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===o.length||"Identifier"===n.object.type)){let t=rR(a,e),n=o.map(e=>{let t=tQ(s9(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
30
- ${t}`)};`)}return{node:n,messageId:s6,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!s5(o)||nz(o.object,e))return;let a=s4(r);if(void 0===a||lt(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(nG(r)&&!s&&!l)return;let u=lr(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tQ(s9(a),c);return s&&aB(i)&&!rU(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${to(i.right,e)})`):l&&tT(i.parent)&&!rU(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return aL(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||rU(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:s6,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tR(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tR(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&ts(t.arguments[0]))||nz(t.callee.object,e))return;let r=t.callee.property.name,n="ChainExpression"===t.parent.type?t.parent:t;if(("AwaitExpression"!==n.parent.type||n.parent.argument!==n||"getAttribute"!==r)&&t.arguments[0].value.toLowerCase().startsWith("data-"))return{node:t,messageId:s8,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&r3(e.callee)||"setAttribute"===r&&!aB(e)||"removeAttribute"===r&&!tT(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!rU(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${lr(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=r$(a)?`.${a}`:`[${tQ(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${to(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tQ(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[s8]:"Prefer `.dataset` over `{{method}}(…)`.",[s6]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},lo="prefer-modern-math-apis",la=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,li=(e,t)=>"CallExpression"===e.type&&!e.optional&&la(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function ls({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(li(n.left,"log")&&la(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):li(n.right,"log")&&la(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:lo,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${to(s,o)})`)}}}function ll({constantName:e,replacementMethod:t}){let r={messageId:lo,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&li(n.left,"log")&&la(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${to(a,o)})`)}}}let lu=[ls({constantName:"LOG10E",replacementMethod:"log10"}),ls({constantName:"LOG2E",replacementMethod:"log2"}),ll({constantName:"LN10",replacementMethod:"log10"}),ll({constantName:"LN2",replacementMethod:"log2"})],lp=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>lp(e)):[e],lc="number-literal-case",ld=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},lm={create:a8(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(tp(t)?o=ld(r,n):tm(t)&&(o=ld(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:lc,fix:e=>e.replaceText(t,o)}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[lc]:"Invalid number literal casing."},languages:["js/js"]}},lf="error",lg="suggestion",ly={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},lh=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function lx(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=lh(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:lf,data:{description:o,property:i}};if("NEGATIVE_INFINITY"===i)return s.node=a,s.data.description="-Infinity",s.fix=function*(e){yield e.replaceText(a,"Number.NEGATIVE_INFINITY"),yield iG(e,a,t)},s;let l=e=>iZ(r,`Number.${i}`,t,e);return ly[o]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&n2(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:lg,fix:l}],s}let lb={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new sM({objects:Object.keys(ly).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:lx,filter(t){let{node:r,path:n}=t,[o]=n;return!nG(r)&&!("Infinity"===o&&(e=>{if(!lh(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];return!n||"SpreadElement"!==n.type&&eV(n,t.sourceCode.getScope(n))?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[lf]:"Prefer `Number.{{property}}` over `{{description}}`.",[lg]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},lE="prefer-reflect-apply",lv=(e,t)=>(td(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),lS=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,lC="prefer-set-size";var lD={exports:{}},lT=is(function(){var e,t,r,n;return p?lD.exports:(p=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[H-r,H],raw:e.substring(H-r,H)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,H-(r.length+n),H)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return Y&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++H-2,H):i("symbol",n,H-1,H)}function u(t,r,n,o,a){return null==o&&(n=H-1,o=H),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&V("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){H+=e=e||1}function f(e){g(e)||V("character",e)}function g(t){var r=t.length;if(e.substring(H,H+r)===t)return m(r),t}function y(t){if(e[H]===t)return H++,t}function h(){return e[H]}function x(t){return e[H]===t}function b(t){return e[H+1]===t}function E(t){var r=e.substring(H).match(t);return r&&(H+=r[0].length),r}function v(){var t,r=[],n=H;for(r.push(S());y("|");)r.push(S());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function S(){for(var t,r,s=[],u=H;r=function(){if(H>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return C("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=T()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,V("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[H-1,H],raw:"."};case"\\":if(m(),!(t=w())){if(!Y&&"c"==h())return i("symbol",92,H-1,H);V("atomEscape")}return t;case"[":return N();case"(":if(n.lookbehind&&(t=C("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=D("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return C("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||V("Invalid flags for modifiers group"):a||V("Invalid flags for modifiers group"),((s=(a=a?a[0]:"")+(r=r?r[0]:"")).length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(s))&&V("flags cannot be duplicated for modifiers group"),y(":")||V("Invalid flags for modifiers group"),(u=D("ignore",o)).modifierFlags={enabling:a,disabling:r},u;case"]":case"}":if(!Y)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=H,(t=T()||!1)&&(H=s,V("Expected atom")),!Y&&y("{")?u=l("{"):V("Expected atom")),t=T()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&V("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=H],raw:e.substring(u,t)}}function C(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return D(o,a)}function D(t,r){var n,o=v();o||V("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=H],raw:e.substring(r,n)};return"normal"==t&&K&&z++,a}function T(){var e,t,r,n,o=H;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=E(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,H):(n=E(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,H):(n=E(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&V("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&V("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function A(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=H;H++;var i=w(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=H,t.raw=e.substring(t.range[0],H)):H=a}}return t}n||(n={});function w(t){var r,a,i,u,p=H;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=H;if(r=E(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=z&&!t)return u=H-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,H],raw:e.substring(u,H)};if(_.push(p),K?G=!0:k(a,H),m(-n.length),r=E(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=H;return o(r=l(E(/^[89]/)),c-1)}return!!(r=E(/^[0-7]{1,3}/))&&(("0"!==(n=r[0])&&k(a,H),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return L();V("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return L();case"c":if(t){if(!Y&&(i=E(/^c(\d)/)))return s("controlLetter",i[1]+16,i[1],2);else if(!Y&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[H-2,H],raw:e.substring(H-2,H)};case"k":return function(){if(n.namedGroups&&E(/^k<(?=.*?>)/)){var t,r=B();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,H],raw:e.substring(t,H)}}}()||L();case"p":case"P":return a=H,!!(n.unicodePropertyEscape&&Y&&(r=E(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,H],raw:e.substring(a-1,H)}||L();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){Y&&V("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?A(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=E(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=H;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=E(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"x":if(e=E(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(Y))return(!e||e.codePoint>1114111)&&V("Invalid escape sequence",null,t,H),e}return L()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||V("Invalid escape sequence",null,o,H),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[H+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function B(){var t,r=H,n=F(R);for(n||V("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}function R(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/.test(r(e))}function P(e){return R(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function L(){var t,r=h();return Y&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!Y&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(H,H+=1)).charCodeAt(0),t,1):null}function N(){var e,t=H;return g("[^")?(e=$(),f("]"),p(e,!0,t,H)):y("[")?(e=$(),f("]"),p(e,!1,t,H)):null}function $(){var e,t;return x("]")?{kind:"union",body:[]}:X?function(){var e,t=[],r=O(!0);for(t.push(r),e="classRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&V("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((t=M())||V("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||V("classAtom"),n=H;var r,n,o,a,i,s,u=$();return(u||V("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?V("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||V("classAtom"),(o=x("]")?s:e(s))||V("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||V("nonEmptyClassRanges"),{kind:"union",body:e})}function M(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=w(!0))){if(!Y&&"c"==h())return l("\\");V("classEscape")}return A(e,Y);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=H;if(y("\\"))if(g("q{"))return function(){var t,r=H-3,n=[];do n.push(function(){for(var t,r,n=[],o=H;r=q();)n.push(r);return{type:"classString",characters:n,range:[o,t=H],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=H],raw:e.substring(r,t)}}();else if(n=w(!0))r=n;else{if(n=W())return n;V("Invalid escape","\\"+h(),o)}else if(n=U())r=n;else{if(n=N())return n;V("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=q())return c(r,n,o,H);V("Invalid range end",h())}return r}function q(){if(y("\\")){var e,t=H;if(e=W())return e;V("Invalid escape","\\"+h(),t)}return U()}function U(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&V("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function W(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))V("\\B not possible inside of ClassContents","",H-2);else if(e=E(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function V(t,r,n,o){n=null==n?H:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var _=[],z=0,K=!0,G=!1,J=-1!==(t||"").indexOf("u"),X=-1!==(t||"").indexOf("v"),Y=J||X,H=0;if(X&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(J&&X)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Q=v();return(Q.range[1]!==e.length&&V("Could not parse entire input - got stuck","",Q.range[1]),G=G||_.some(function(e){return e<=z}))?(H=0,K=!1,v()):Q}},lD.exports?lD.exports=n:window.regjsparser=n,lD.exports)}());let lA=String.raw`\$&`,lw=new i(String.raw`\^$.*+?()[]{}|/-`),{parse:lk}=lT,lI="method",lj="pattern",lF="split-join",lB=new i(["i","y"]),lR=new i(["anchor","reference"]),lP=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function lL(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:lP(r);if("null"===t||"octal"===t)return lP(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function lN(e){return"value"===e.type?lL(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?l$(e.body):void 0:lL(e.body[0])}function l$(e){let t=[];for(let r of e){let e=lN(r);if(void 0===e)return;t.push(e)}return t.join("")}let lM=e=>{let{pattern:t,flags:r}=e.regex;try{return lk(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},lO=e=>{let t=0;for(let r of e)t+=lq(r);return t};function lq(e){return lR.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?lO(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>lq(e))):"quantifier"===e.type?e.min*lO(e.body):"group"===e.type&&"ignore"===e.behavior?lO(e.body):0}let lU=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>lU(e)),lW=e=>tp(e)&&Number.isSafeInteger(e.value)&&e.value>=0,lV=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rk(e.left,t)&&ti(e.right,1)||ti(e.left,1)&&rk(e.right,t)))return t},l_=e=>tp(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-l_(e.argument):void 0,lz=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,lK="prefer-string-trim-start-end",lG="no-unreadable-iife",lJ="suggestion",lX="throw-new-error",lY=/^(?:[A-Z][\da-z]*)*Error$/,lH="escape-uppercase",lQ="escape-lowercase",lZ=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,l0=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,l1=({node:e,original:t,regex:r=lZ,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?lQ:lH,fix:t=>o?o(t,a):t.replaceText(e,a)}},l2="prefer-unicode-code-point-escapes",l3="prefer-unicode-code-point-escapes/add-unicode-flag",l8=String.raw`\u{`,l6=/^[\da-f]$/iv,l9=/^[0-7]$/v,l5=/^[A-Za-z]$/v;function l4(e){return l9.test(e)}function l7(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function ue(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function ut(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!l6.test(e))))return Number.parseInt(n,16)}function ur(e){return e>=55296&&e<=56319}function un(e){return e>=56320&&e<=57343}function uo(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function ua(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1}={}){let n="",o=0,a=!1;for(let i=0;i<e.length;i++){let s=e[i],l=o>0;if(t&&"["===s&&(!l||r)&&!ue(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!ue(e,i)){o--,n+=s;continue}if("\\"!==s||!l7(e,i)){n+=s;continue}let u=function(e,t,{isRegex:r,isInCharacterClass:n}){return function(e,t){if("x"!==e[t+1])return;let r=ut(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:uo(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=ut(e,t+2,4);if(void 0===o||!n&&(ur(o)||un(o)))return;let a=t+6;if(r&&ur(o)&&"\\"===e[a]&&l7(e,a)&&"u"===e[a+1]){let t=ut(e,a+2,4);if(un(t))return{end:a+6,replacement:uo((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:uo(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&l5.test(r))return{end:t+3,replacement:uo(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!l4(e[t+2])||!l4(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&l4(e[o]);)o++;return{end:o,replacement:uo(Number.parseInt(e.slice(t+1,o),8))}}(e,t))}(e,i,{isRegex:t,isInCharacterClass:l});if(!u){n+=s;continue}n+=u.replacement,i=u.end-1,a=!0}return{fixed:n,hasReplacement:a}}function ui(e,t,r){let{fixed:n,hasReplacement:o}=ua(t);if(o)return{node:e,messageId:l2,fix:t=>r?r(t,n):t.replaceText(e,n)}}function us(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let ul=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],uu=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],up="missing-message",uc="message-is-empty-string",ud="message-is-not-a-string",um=new o([["AggregateError",1],["SuppressedError",2]]),uf=e=>"instanceof"===e.value&&"Keyword"===e.type,ug="no-instanceof-builtins",uy="switch-to-type-of",uh=new i(["String","Number","Boolean","BigInt","Symbol"]),ux=new i(["global","globalThis","self","window"]),ub=[...uu,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...r9,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],uE=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=r0(t,e),s=i.getTokenAfter(o,uf),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield iG(n,e,t);let c=tn(o,{sourceCode:i});!ta(o,t)&&ia(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=tn(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},uv=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,uS={create:a8(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new i("strict"===r?[...ub,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:i}=r;if("instanceof"!==i)return;let s="Identifier"===n.type?{name:n.name,referenceText:n.name}:"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.property.type&&"Identifier"===n.object.type&&ux.has(n.object.name)&&oA(n.object,e)?{name:n.property.name,referenceText:e.sourceCode.getText(n)}:void 0;if(!s||o.includes(s.name))return;let{name:l,referenceText:u}=s,p={node:r,messageId:ug};if("Array"===l||"Error"===l&&t){let t="Array"===l?"isArray":"isError",n=`${u}.${t}`;return p.fix=function*(t){let{left:o,right:a}=r,i=r0(e,r),s=i.getTokenAfter(o,uf);yield iG(t,r,e);let l=tn(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield i2(s,"",t,e,i),yield i2(a,"",t,e,i)},p}return"Function"===l?(uv(n,e)||(p.fix=uE(r,e,l)),p):uh.has(l)?(uv(n,e)||(p.suggest=[{messageId:uy,data:{type:l.toLowerCase()},fix:uE(r,e,l)}]),p):a.has(l)?p:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[ug]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[uy]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},uC="prefer-type-error",uD=new i(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),uT=new i(["isNaN","isFinite"]),uA=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&uD.has(e.name)||!1===r&&uT.has(e.name)),uw=(e,t)=>!!uA(e.property,t,!0)||"MemberExpression"===e.object.type&&uw(e.object,t),uk=/^(?:[A-Z][\da-z]*)*Error$/,uI=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,uj=(e,t)=>{switch(e.type){case"Identifier":return uA(e,t,!1);case"MemberExpression":return uw(e,t);case"CallExpression":return uj(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&uj(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?uk.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&uk.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(uI(r)&&ti(n,"undefined")||uI(n)&&ti(r,"undefined"))})(e))return!1;return uj(n,t)||uj(o,t)}case"LogicalExpression":return uj(e.left,t)&&uj(e.right,t);default:return!1}},uF="consistentDestructuring",uB="consistentDestructuringSuggest",uR=new i(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),uP=e=>{for(;e.parent;)if(e=e.parent,uR.has(e.type))return e},uL=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,uN=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=eS(n.getScope(o.value),o.value);if(e&&eS(r,o.value)===e)return o}},u$=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{if(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=rN(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?eS(r,l):void 0,c="ThisExpression"===l.type?uP(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))return!1;for(var l=r,u=e.scope;l;){if(l===u)return!0;l=l.upper}return!1},uM=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&ts(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(uM(e.left,t,r)||uM(e.right,t,r)),uO=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&uM(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&uM(e.left,r,n);default:return!1}},uq=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),uU=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...uu,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...r9],uW=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],uV="error-date",u_="suggestion-date";function uz(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let uK=new sM({objects:["BigInt","Boolean","Number","String","Symbol"],type:sM.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>iz(r,t,e)),o}}),uG=new sM({objects:uU,type:sM.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||r3(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield iG(e,r,t)}let e={node:r,messageId:uV};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:u_,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>iJ(r,t,e)}}}),uJ=new sM({objects:uW,type:sM.CALL,handle:uz}),uX=new sM({objects:uW,type:sM.CONSTRUCT,handle:uz}),uY="error/array-push",uH="suggestion",uQ=e=>tF(e,{property:"classList",computed:!1}),uZ=e=>e.arguments.some(e=>"SpreadElement"===e.type),u0=[{description:"Array#push()",test:e=>tR(e,{method:"push",optionalCall:!1}),checkArrayReceiver:!0,ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>tR(e,{method:"unshift",optionalCall:!1}),checkArrayReceiver:!0,keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>tR(e,{method:"add",optionalCall:!1,optionalMember:!1})&&uQ(e.callee.object)},{description:"Element#classList.remove()",test:e=>tR(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&uQ(e.callee.object)},{description:"importScripts()",test:e=>tb(e,{name:"importScripts"},ty)}],u1={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1,checkArrayReceiver:l=!1}of u0){if(!a(n))continue;let u=function(e,{test:t,ignoredCallee:r,checkArrayReceiver:n},o){let a;if(tM(e.callee,r))return;let i=("ChainExpression"===(a=e.parent).type&&e===a.expression&&(a=a.parent),"ExpressionStatement"===a.type?a:void 0);if(!i)return;let s=im(i,o,-1);if(s?.type!=="ExpressionStatement")return;let l=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(s);if(!(!t(l)||!rk(l.callee,e.callee)||n&&nL(e.callee.object,o)))return{firstCall:l,firstExpressionStatement:s,secondExpressionStatement:i}}(n,{test:a,ignoredCallee:[...i,...t],checkArrayReceiver:l},e);if(!u)continue;let{firstCall:p,firstExpressionStatement:c,secondExpressionStatement:d}=u,{shouldKeepSecondCall:m,shouldPrependSourceArguments:f,targetCall:g,sourceCall:y}=function(e,t,r){let n=r&&(!r3(t.callee)||r3(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(p,n,s),h=y.arguments,x=r.getRange(c),b=r.getRange(d),E=m?[x[0],b[0]]:[x[1],b[1]],v=!m&&!eA(r.getLastToken(c))&&eA(r.getLastToken(d)),S=m&&aL(r.getTokenBefore(c),e,r.text.slice(b[0],b[0]+1)),C={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:uY,data:{description:o}},D=function*(t){if(h.length>0){let r=rT(e,y,!f),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rD(g,e);f?yield t.insertTextAfter(n,g.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,g.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(E,v||S?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,E)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(uZ(e)||uZ(t))||r&&o.some(e=>null===eV(e,n.getScope(e)))||o.some(e=>eH(e,n))}(p,n,s,r)?C.suggest=[{messageId:uH,fix:D}]:C.fix=D),yield C}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[uY]:"Do not call `{{description}}` multiple times.",[uH]:"Merge with previous one."},languages:["js/js"]}},u2="no-process-exit",u3=e=>ti(e,"node:worker_threads")||ti(e,"worker_threads"),u8="no-single-promise-in-promise-methods/error",u6="no-single-promise-in-promise-methods/unwrap",u9="no-single-promise-in-promise-methods/use-promise-resolve",u5=["all","any","race"],u4=(e,t)=>{let[r]=e.arguments[0].elements,n=to(r,t);return!ta(r,t)&&16>a5(r)&&(n=`(${n})`),n},u7=(e,t)=>e.getCommentsInside(t).length>0,pe=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",pt="no-static-only-class",pr=({type:e,value:t})=>"Punctuator"===e&&"="===t,pn=e=>"PropertyDefinition"===e.type,po="ignored-elements",pa="property-assignment",pi={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:po},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s;"AssignmentPattern"!==r.type&&(i.fix=function*(i){let s=o.indexOf(r),l="RestElement"===r.type,u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!ta(c,e)&&it(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield iG(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rL(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t)return e(r);if("Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type)return r.parent;if("ObjectPattern"===r.type||"ArrayPattern"===r.type)return r}}(e)?.type==="ArrayPattern")return{node:e,messageId:pa}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[po]:"Array destructuring may not contain consecutive ignored values.",[pa]:"Do not assign destructured values to object properties."},languages:["js/js"]}},ps="spread-in-list",pl="iterable-to-array",pu="iterable-to-array-in-for-of",pp="iterable-to-array-in-yield-star",pc="spread-in-collection-constructor",pd="spread-in-object-assign",pm="clone-array",pf="suggestion/remove-object-assign-spread",pg=["Map","WeakMap","Set","WeakSet"],py=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ph=[...py,"filter","flatMap","map"],px=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",pb={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*pE(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o),yield e.remove(a);let[s,l]=n.getLastTokens(t,2);yield e.remove(l),eT(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||oS(o,i,r)||ta(t,r)?yield iG(e,t,r):yield iV(e,u,r)}let pv=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&nF(e.callee.object,t),pS="no-useless-switch-case/error",pC="no-useless-switch-case/suggestion",pD=e=>e.consequent.every(e=>tS(e)),pT=e=>tq(e.test)||td(e.test),pA=new i(["CallExpression","MemberExpression"]),pw=new i(["Identifier","MemberExpression","Super","ThisExpression"]),pk=e=>"MemberExpression"===(e=rN(e)).type?{...e,object:pk(e.object),property:e.computed?pk(e.property):e.property}:e,pI=(e,t)=>rk(pk(e),pk(t)),pj=e=>pw.has(rN(e).type),pF=(e,t)=>tF(e=rN(e),{property:"length",optional:!1,computed:!1})&&pI(e.object,t),pB=e=>!!("ChainExpression"===e.type||pA.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&pB(e)):t.type&&pB(t))),pR="no-useless-undefined",pP="no-useless-undefined/suggestion",pL=new i(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),pN=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},p$={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},pM={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},pO={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},pq={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},pU=new i(["<","<=",">",">="]);function pW(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function pV(e,t){var r;return pF(e,t)?"length":"BinaryExpression"===(r=rN(r=e)).type&&"-"===r.operator&&1===ie(r.right)&&pF(r.left,t)?"lengthMinusOne":void 0}function p_(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let pz={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=pN(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:pR,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tq(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=pN(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>i2(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>i2(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>i2(o," {}",t,e),!0);if("VariableDeclarator"===a.type&&a.init===o&&"VariableDeclaration"===a.parent.type&&"const"!==a.parent.kind&&a.parent.declarations.includes(a)){let[,e]=t.getRange(a.id),[,n]=t.getRange(o);return r(o,t=>t.removeRange([e,n]))}if("AssignmentPattern"===a.type&&a.right===o)return r(o,function*(r){let{left:n}=a,[,i]=t.getRange(n),[,s]=t.getRange(o);yield r.removeRange([i,s]),(n.typeAnnotation||rQ(e.physicalFilename))&&!n.optional&&tw(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tq(r.consequent);if(n===tq(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tF(e=rN(e),{computed:!0,optional:!1})||pB(e)||eH(e.object,t,{considerGetters:!0})||eH(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rN(e)).type&&"-"===e.operator){let t=ie(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=rN(e)).type||!pU.has(e.operator)||pB(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=ie(n),i=ie(o);return Number.isSafeInteger(i)&&pI(n,t.node)?pW(p$,r,i,t.offset):Number.isSafeInteger(a)&&pI(o,t.node)?pW(pM,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=pV(o,t.node.object);if(a&&pI(n,t.index.node))return p_(pO,r,a);let i=pV(n,t.node.object);if(i&&pI(o,t.index.node))return p_(pq,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:pR};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:pP,fix(n){let a=t.getText(o),i=aL(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rQ(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tq(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),pL.has(n)||"push"===n||"unshift"===n||"includes"===n||"add"===n||"has"===n||"delete"===n||"set"===n||"createContext"===n||/^set[A-Z]/v.test(n)||"useRef"===n||"ref"===n))&&(!(!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name)||1===o.length))return{node:a,messageId:pR,fix:t=>iq(t,a,e)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[pR]:"Do not use useless `undefined`.",[pP]:"Use the indexed access directly."},languages:["js/js"]}},pK="numeric-separators-style";function pG(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let pJ={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},pX={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}};e.on("Literal",e=>{let t,r;if(!(tp(e)||tm(e))||tp(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";tm(e)&&(o=n.slice(0,-1),a="n");let s=o.replaceAll("_",""),{prefix:l,data:u}=(t="",r=s,/^0[box]/i.test(s)&&(t=s.slice(0,2),r=s.slice(2)),{prefix:t,data:r}),{onlyIfContainsSeparator:p}=i[l.toLowerCase()];if(p&&!n.includes("_"))return;let c=function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+pG(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return pG(r,t)+n+pG(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+pG(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:pK,fix:t=>t.replaceText(e,c)}})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(pJ).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:pJ.binary,octal:pJ.octal,hexadecimal:pJ.hexadecimal,number:pJ.number}],messages:{[pK]:"Invalid group length in numeric value."},languages:["js/js"]}},pY="error-zero-index",pH="error-shift",pQ="error-pop",pZ="error-at-zero",p0="error-at-minus-one",p1="error-slice-minus-one",p2="error-destructuring-declaration",p3="error-destructuring-assignment",p8="error-variable",p6="suggest-nullish-coalescing-operator",p9="suggest-logical-or-operator",p5=(e,t,r)=>tR(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!nB(e.callee.object,t),p4=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,p7=(e,t)=>tR(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&p4(e.arguments[0])&&p5(e.callee.object,t),ce=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*ct(e,t,r){let{left:n}=ce(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eQ(e,t))return!1;let{left:r}=ce(e),[n]=r.elements,{type:o}="AssignmentPattern"===n.type?n.left:n;return"ObjectExpression"===o||"ObjectPattern"===o})(e,t)&&(yield r.insertTextBefore(e,"("),yield r.insertTextAfter(e,")"))}let cr=e=>"AssignmentPattern"===ce(e).left.elements[0].type,cn=(e,t)=>{let r,n,{property:o}=ce(t).right.callee;return cr(t)?r=[{operator:"??",messageId:p6},{operator:"||",messageId:p9}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=ce(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eQ(s,t)||"LogicalExpression"===s.type&&(s.operator===n||"||"===n&&"??"===s.operator||"??"===n&&("||"===s.operator||"&&"===s.operator))||"ConditionalExpression"===s.type||"AssignmentExpression"===s.type||"YieldExpression"===s.type||"SequenceExpression"===s.type)&&(l=`(${l})`),r.insertTextAfter(a,` ${n} ${l}`)})(t,e,r,n),yield ct(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield ct(t,e,r)},{fix:n,suggest:r}},co=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,ca=e=>{let{left:t,right:r}=ce(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},ci={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(!(!(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&p5(t.object,e))||nG(t)))return{node:t.object.callee.property,messageId:pY,fix:r=>[r.replaceText(t.object.callee.property,"find"),iY(r,t,e)]}}),e.on("CallExpression",t=>{if(tR(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pH,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...iH(r,t,e)]}}),e.on("VariableDeclarator",r=>{if("ArrayPattern"===r.id.type&&1===r.id.elements.length&&r.id.elements[0]&&"RestElement"!==r.id.elements[0].type&&p5(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:p2,...cn(t,r)}}),e.on("AssignmentExpression",r=>{if("ArrayPattern"===r.left.type&&1===r.left.elements.length&&r.left.elements[0]&&"RestElement"!==r.left.elements[0].type&&p5(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:p3,...cn(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&p5(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=eS(n,r.id),a=r1(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(co(e))i.push(e.parent);else{if(!ca(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:p8};return s.every(e=>!cr(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=ip.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=rS(l,ry(n));yield i0(o,r,e,a),yield function*(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}(a,t.getRange(t.ast))}for(let t of i)yield iY(a,t,e);for(let e of s)yield ct(e,t,a)}),l}),e.on("CallExpression",t=>{if(tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pZ,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...iH(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tR(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:pQ,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...iH(r,t,e)]}}),e.on("CallExpression",t=>{if(tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&p4(t.arguments[0])&&p5(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:p0,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...iH(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nG(r)&&p7(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:p1,*fix(o,{abort:a}){if(rV(e,[tn(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield iH(o,r.object,e),yield iY(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tR(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&p7(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:p1,*fix(o,{abort:a}){if(rV(e,[tn(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield iH(o,r.callee.object,e),yield iH(o,r,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[p8]:"Prefer `.find(…)` over `.filter(…)`.",[pY]:"Prefer `.find(…)` over `.filter(…)[0]`.",[pZ]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[pH]:"Prefer `.find(…)` over `.filter(…).shift()`.",[pQ]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[p0]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[p1]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[p2]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[p3]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[p6]:"Replace `.filter(…)` with `.find(…) ?? …`.",[p9]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},cs="prefer-array-flat-map",cl="prefer-array-flat-map/filter-flat-map",cu="prefer-array-flat-map/filter-flat-map-suggestion",cp=["React.Children","Children"],cc=new i(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),cd=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,cm="prefer-array-flat",cf={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tR(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&oT(r.params[0],r.body)&&!cE(e.callee.object,t)}},cg={testFunction(e,t){if(!tR(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[r,n]=e.arguments;if(!("ArrowFunctionExpression"===r.type&&!r.async&&2===r.params.length&&tC(n)))return!1;let o=r.body,[a,i]=r.params;return!!(tR(o,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&oT(a,o.callee.object)&&oT(i,o.arguments[0])||"ArrayExpression"===o.type&&2===o.elements.length&&o.elements.every((e,t)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&oT(r.params[t],e.argument)))&&!nF(e.callee.object,t)},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},cy={testFunction:e=>tR(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tC(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},ch={testFunction(e){if(!(tR(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tU(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return tC(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},cx=["_.flatten","lodash.flatten","underscore.flatten"],cb=/^\p{Uppercase_Letter}/u,cE=(e,t)=>{let r,n;return"Identifier"===e.type&&cb.test(e.name)&&(!(r=rJ(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=rJ(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},cv={create:function(e){let{functions:t}=e.options[0],r=[...t,...cx],n=[cf,cg,cy,ch,{testFunction:e=>tb(e,{argumentsLength:1,optional:!1},ty)&&tM(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>t$(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,shouldSwitchToArray:i,isOptionalArray:s}of n){if(!r(t,e))continue;let n=a(t),l=s?.(t),u={description:"string"==typeof o?o:o(t)},p={node:t,messageId:cm,data:u},{sourceCode:c}=e;c.getCommentsInside(t).length===c.getCommentsInside(n).length&&(p.fix=function(e,t,r,n,o){return"function"==typeof n&&(n=n(e)),function*(a){let{sourceCode:i}=r,s=to(t,r);n?s=`[${s}]`:!ta(t,i)&&it(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,aL(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield iG(a,e,r)}}(t,n,e,i,l)),yield p}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[cm]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},cS="some",cC="some-suggestion",cD="filter",cT={create:a8(e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||nB(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tq(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&td(t.parent.right));if(!r&&!(tG(t,e)||tJ(t)||function(e,t){if(!nj(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type&&r.parent.parent.declaration===r.parent)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(!n||1!==n.identifiers.length||n.identifiers[0]!==r.id)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tG(r,t)||tJ(r))})}(t,e)))return;let n=t.callee.property,o=r&&rV(e,[tn(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:cS,data:{method:n.name},suggest:o?void 0:[{messageId:cC,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=tn(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(tR(r,{methods:["findIndex","findLastIndex"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&ti(n,0)))||nB(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:cS,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[u]=s.getRange(l),[,p]=s.getRange(t);if(rV(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tF(t.left,{property:"length",optional:!1})&&tR(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if("Identifier"===n.type&&n.name.startsWith("$")||nB(n,e))return;let[o]=r.arguments;if(!o||oE(o))return;let a=r.callee.property;return{node:a,messageId:cD,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(rV(e,[tn(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield iY(n,s,e),yield n.removeRange([tn(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[cS]:"Prefer `.some(…)` over `.{{method}}(…)`.",[cC]:"Replace `.{{method}}(…)` with `.some(…)`.",[cD]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},cA="preferDefaultParameters",cw="preferDefaultParametersSuggest",ck=new i(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),cI=(e,t)=>{if(!t)return!1;if(ck.has(t.type))return!0;for(let r of e.visitorKeys[t.type]){let n=t[r];if(Array.isArray(n)){for(let t of n)if(cI(e,t))return!0}else if(cI(e,n))return!0}return!1},cj="prefer-logical-operator-over-ternary/error",cF="prefer-logical-operator-over-ternary/optional-chain-error",cB="prefer-logical-operator-over-ternary/suggestion",cR="prefer-logical-operator-over-ternary/optional-chain-suggestion",cP=new i(["==","==="]),cL=new i(["!=","!=="]);function cN(e,t,r){if(rk(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return cN(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&cN(e.left,t.left,r)&&cN(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&cN(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function c$({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:cj}:{node:t,messageId:cj,suggest:o.map(o=>({messageId:cB,data:{operator:o},fix:a=>(function({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a}){let{sourceCode:i}=t,s=[n,o].map((e,r)=>{let n=ta(e,t),o=n?to(e,t):i.getText(e);return!n&&ii(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return aL(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function cM(e){return td(e)?"null":tq(e)?"undefined":void 0}function cO(e){if("BinaryExpression"!==e.type||!cP.has(e.operator)&&!cL.has(e.operator))return;let t=cM(e.left),r=cM(e.right);if(!!t==!!r)return;let n=cP.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let cq=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,cU="with-name",cW="without-name",cV="regexp-exec",c_="string-match",cz="string-search",cK="suggestion",cG="string",cJ="regexp",cX="other",cY="string-or-other",cH="regexp-or-other",cQ="unknown";function*cZ(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);eQ(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eQ(t,a)&&it(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let c0=[{type:cV,test:e=>tR(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:c_,test:e=>tR(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:cZ},{type:cz,test:e=>tR(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:cZ}],c1=e=>tc(e)||tE(e,{name:"RegExp"}),c2=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},c3=e=>{if(e.includes(cQ))return cQ;let t=new i(e),r=t.has(cG)||t.has(cY),n=t.has(cJ)||t.has(cH);if(r&&n)return cY;let o=t.has(cX)||t.has(cY)||t.has(cH);return r?o?cY:cG:n?o?cH:cJ:cX},c8=e=>{let t=new i(e);return t.has(cQ)?cQ:t.has(cJ)?cJ:t.has(cG)?cG:cX},c6=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),c9=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return c9(e.typeAnnotation);case"TSStringKeyword":return cG;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?cG:cX;case"TSTypeReference":if("Identifier"!==e.typeName.type)return cQ;if("String"===e.typeName.name)return cG;if("RegExp"===e.typeName.name)return cJ;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return cX;return cQ;case"TSUnionType":return c3(e.types.map(e=>c9(e)));case"TSIntersectionType":return c8(e.types.map(e=>c9(e)));default:return c6.has(e?.type)?cX:cQ}},c5=(e,t)=>{let r,n;if(r=e,r5.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),r5.has(n.intrinsicName)))return cQ;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?c5(r,t):cQ}return e.isUnion()?c3(e.types.map(e=>c5(e,t))):e.isIntersection()?c8(e.types.map(e=>c5(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?cG:"RegExp"===r7(e)?.getName()||nt(e,t).some(e=>c5(e,t)===cJ)?cJ:cX},c4=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function c7(e,t,r=new i){let n;if(c1(e))return cJ;if(og(e,t))return cG;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=eS(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return cQ;r.add(o);let[a]=o.defs,i=c9(a.name?.typeAnnotation),s=cQ;return i!==cQ?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=c7(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==cQ)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=c9(e.typeAnnotation);return n===cQ?c7(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return c7(e.expression,t,r);case"SequenceExpression":return c7(e.expressions.at(-1),t,r);case"ConditionalExpression":return c3([c7(e.consequent,t,r),c7(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=eV(e,o))?"string"==typeof n.value?cG:c2(n.value)?cJ:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?cX:cQ:cQ;return a!==cQ?a:c4.has(e.type)?cX:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return cQ;try{let{program:t}=r;return c5(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return cQ}})(e,t)}let de=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tW(e.parent)||tK(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},dt=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),dr=(e,t,r)=>[tn(t,r)[1],r.sourceCode.getRange(e.node)[1]],dn=e=>[{messageId:cK,fix:e}],da=e=>[cJ,cH,cX].includes(e),di=e=>[cG,cY,cX].includes(e),ds=({type:e,stringType:t,regexpType:r})=>e===cV?di(r)||da(t):da(t)||di(r),dl=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[tn(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([tn(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!dt(r.sourceCode,e))&&(e.suggest=dn(t));return}if(!o||!dt(r.sourceCode,dr(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=dn(t)}},du={create:a8(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tF(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(de(o,t))return;if(tG(o,t)||tJ(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&ti(a.right,0)&&!de(a,t)&&(tG(a,t)||tJ(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tP(n)||">="===r&&ti(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tP(n)||"<"===r&&ti(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tG(t,e)||tJ(t))for(let{type:o,test:a,getNodes:i,fix:s}of c0){if(o===cz!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=eV(p,c),m=d?c2(d.value):void 0,f=c1(p);if(ds({type:o,stringType:c7(l.stringNode,e),regexpType:c7(p,e)}))continue;let g={node:o===cV?u:t,messageId:o};dl(g,function*(o){for(let a of(r?(yield iY(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([tn(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(dr(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:f,staticRegExp:m}),yield g}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cV]:"Prefer `.test(…)` over `.exec(…)`.",[c_]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[cz]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[cK]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},dp="error",dc="suggestion",dd=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],dm=["slice","concat"],df=e=>tR(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.parent.callee.object===e,dg=new i(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),dy=(e,t,r=new i)=>"ArrayExpression"===e.type||tb(e,{name:"Array",optional:!1},tx)||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tR(e,{methods:dd,optionalCall:!1,optionalMember:!1})||tR(e,{methods:dm,optionalCall:!1,optionalMember:!1})&&void 0===tu(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new i)=>{if("Identifier"!==e.type)return!1;let n=eS(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs;return"Variable"===o.type&&"const"===o.kind&&!!o.node.init&&dy(o.node.init,t,r)})(e.callee.object,t,r)),dh=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,dx=e=>e.some(e=>e?.type==="SpreadElement"),db=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),dE=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,dv=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t,r=e;for(;dE(r.parent,r);)r=r.parent;return nG(r)||("ForInStatement"===(t=r).parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},dS=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||tR(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},dC={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&dy(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let e=(i=a.init,s=r.getScope(a.init),"ArrayExpression"===i.type?dx(i.elements)?void 0:i.elements.length:tb(i,{name:"Array",optional:!1},tx)?((e,t)=>{if(dx(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=eV(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:dh(n)?n:void 0})(i,s):tR(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?dx(i.arguments)?void 0:i.arguments.length:tR(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(r&&"SpreadElement"!==r.type){if("ArrayExpression"===r.type)return dx(r.elements)?void 0:r.elements.length;if(void 0!==tu(r)){let e=eV(r,t);return"string"==typeof e?.value?[...e.value].length:void 0}return((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=eV(r.value,t);return dh(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=eS(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(df(o)){t.push(o);continue}if(dv(o)){r.push(o),n.push(o);continue}if(dS(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(r1(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!dx(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=eV(t,e.sourceCode.getScope(t)))&&rI(r.value)&&!Object.is(r.value,-0)}))||0!==rB(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(dg.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:dp,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(db(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(db(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!db(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:dc,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[dp]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[dc]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},dD=e=>tR(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tb(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},ty),dT="prefer-string-raw",dA="unnecessary-string-raw";function dw(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let dk="prefer-switch",dI=(e,t)=>e===t||rk(e,t),dj=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tq(e))),dF=new i(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),dB=e=>{for(;e.parent;e=e.parent)if(dF.has(e.type))return e},dR=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},dP={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new i,o=[],a=new i;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||o.push(e)}),e.on("Program:exit",function*(){for(let i of n){if(a.has(i))continue;let{discriminant:n,ifStatements:s}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=dj(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>dI(e,r)||dI(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(i);if(!n||s.length<t.minimumCases)continue;for(let{statement:e}of s)a.add(e);let l={loc:{start:r.getLoc(i).start,end:r.getLoc(i.consequent).start},messageId:dk};!eH(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!dR(n,t,r))continue;let e=dB(n);if(!e||dR(t,e,r))return!0}return!1}(o,t,e))&&(l.fix=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:o}=r,a=o.getText(e);return function*(i){let s=t[0].statement,l=rR(s,r);yield i.insertTextBefore(s,`switch (${a}) {`);let u=t.at(-1).statement;if(u.alternate){let{alternate:e}=u;yield i.insertTextBefore(e,`
27
+ `,e=>(...t)=>({async *[Symbol.asyncIterator](){e.throwIfAborted();let{worker:n,cleanup:o}=rm(r),a=rc(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([rc(n,"message",{rejectionEvents:["error","messageerror"]}),a]);n.postMessage(e?t:void 0),e=!1;let{data:{output:o,error:i}}=await r;if(i)throw i;let{value:s,done:l}=o;if(l)break;yield s}}catch(t){throw e.throwIfAborted(),t}finally{a.cancel(),o()}}});let rx=e=>[e,...e.childScopes.flatMap(e=>rx(e))],rb=e=>[...new i(rx(e).flatMap(({references:e})=>e))],rE=new i(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),rv=e=>"string"==typeof e&&ry(e)&&!rE.has(e),rS=(e,t)=>t.every(t=>!(rh(e,t)||rb(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rC=()=>!0;function rD(e,t,r=rC){if(rv(e)||rv(e+="_")){for(;!rS(e,t)||!r(e,t);)e+="_";return e}}function rT(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ej(n)&&eF(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rA(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ej),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:ew(a)?a:void 0}}function rw(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rA(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rk(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rk(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=ez(t);if(!r)return;return String(r.value)}}function rI(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rI(e.expression):e}function rj(e,t){if(e=rI(e),t=rI(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=rk(e);if(void 0!==r)return rj(e.object,t.object)&&r===rk(t);return e.computed===t.computed&&rj(e.object,t.object)&&rj(e.property,t.property)}default:return!1}}function rF(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!eD(t.sourceCode.getScope(e),e))}let rB=new i(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rR=e=>rB.has(e?.type);function rP(e){for(;rR(e);)e=e.expression;return e}let rL=new i(["FunctionExpression","ArrowFunctionExpression","ClassExpression"]),rN=new i(["freeze","preventExtensions","seal"]),r$=new o([["Math",new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"])],["Number",new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"])],["String",new i(["raw"])],["Symbol",new i(["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"])]]),rM=(e,t,r=new i)=>{if("CallExpression"!==(e=rP(e)).type)return!1;let n=rP(e.callee),o=rP(n.object);return!e.optional&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&"MemberExpression"===n.type&&!n.computed&&!n.optional&&"Identifier"===o.type&&"Object"===o.name&&rF(o,t)&&"Identifier"===n.property.type&&rN.has(n.property.name)&&void 0!==rH(e.arguments[0],t,r)},rO=e=>{for(e=rP(e);"UnaryExpression"===e.type;)e=rP(e.argument);return"ConditionalExpression"===e.type||"LogicalExpression"===e.type},rq=(e,t)=>{if("Identifier"!==e.type||!t)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;if(n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init)return{variable:r,initializer:n.node.init}},rU=e=>"[object RegExp]"===Object.prototype.toString.call(e),rV=e=>e?.type==="NewExpression"&&"Identifier"===e.callee.type&&"RegExp"===e.callee.name,rW=(e,t)=>{let r=rH(e,t);if(r&&rU(r.value))return r.value;let n=((e,t)=>{if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;if(!(n?.type!=="Variable"||!n.node.init||n.node.id!==n.name||r.references.some(e=>e.isWrite()&&e.identifier!==n.name)))return{initializer:n.node.init}})(e,t),o=n?.initializer,a=rV(e)?e:rV(o)?o:void 0;if((o?.type!=="Literal"||!o.regex)&&(!a||a.arguments.some(e=>!((e,t)=>{if("SpreadElement"===e.type)return!1;let r=rH(e,t);return!!r&&(rU(r.value)||null===r.value||["bigint","boolean","number","string","undefined"].includes(typeof r.value))})(e,t))))return;let i=ez(e,t.sourceCode.getScope(e));return i&&rU(i.value)?i.value:void 0},r_=e=>Object.entries(e).filter(([t])=>!["parent","loc","range"].includes(t)&&!("Property"===e.type&&"key"===t&&!e.computed)&&!("MemberExpression"===e.type&&"property"===t&&!e.computed)).flatMap(([,e])=>Array.isArray(e)?e:[e]).filter(e=>e?.type),rz=(e,t,r)=>"Identifier"===e.type?rK(e,t,r):!rL.has(e.type)&&r_(e).some(e=>rz(e,t,r)),rK=(e,t,r=new i)=>{let n=rq(e,t);if(!n)return"Identifier"!==e.type&&rz(e,t,r);if(r.has(n.variable))return!0;r.add(n.variable);let o=!rM(n.initializer,t,r)&&eZ(n.initializer,t.sourceCode,{considerGetters:!0})||rz(n.initializer,t,r);return r.delete(n.variable),o},rG=e=>"string"==typeof e||"number"==typeof e,rJ=(e,t,r)=>{if("Identifier"===t.type&&!e.computed)return t.name;if("Literal"===t.type&&rG(t.value))return String(t.value);if(!e.computed||!r||"Identifier"===t.type&&!rq(t,r))return;let n=ez(t,r.sourceCode.getScope(t));if(n&&rG(n.value))return String(n.value)},rX=(e,t,r=new i)=>{if("ChainExpression"===(e=rP(e)).type&&(e=e.expression),rM(e,t,r))return!1;let n=rq(e,t);if(n){if(r.has(n.variable))return!0;r.add(n.variable);let e=rX(n.initializer,t,r);return r.delete(n.variable),e}if("MemberExpression"===e.type){var o;let n,a;return!("MemberExpression"===(n=e).type&&!n.optional&&"Identifier"===n.object.type&&rF(n.object,t)&&r$.get(n.object.name)?.has(n.computed?"Literal"===n.property.type&&"string"==typeof n.property.value&&n.property.value:"Identifier"===n.property.type&&n.property.name))&&(a=rJ(o=e,o.property,t),!(!(o.computed&&rX(o.property,t,r))&&((e,t,r,n)=>{let o,a=rq(e,r);if("Literal"===e.type?o=e.value:a?.initializer.type==="Literal"&&(o=a.initializer.value),"string"==typeof o){if("length"===t)return!0;let e=Number(t);return String(e)===t&&Number.isSafeInteger(e)&&e>=0&&e<o.length}if("ArrayExpression"===e.type){if(e.elements.some(e=>e?.type==="SpreadElement"||e&&rX(e,r,n)))return!1;if("length"===t)return!0;let o=Number(t);return String(o)===t&&!!Number.isSafeInteger(o)&&!(o<0)&&!(o>=e.elements.length)&&!!e.elements.at(o)}if("ObjectExpression"===e.type){let o;if(void 0===t||e.properties.some(e=>"Property"!==e.type||e.computed||"__proto__"===e.key.name||"__proto__"===e.key.value||rX(e.value,r,n)))return!1;for(let r of e.properties)rJ(r,r.key)===t&&(o=r);return!!(o&&"init"===o.kind&&!o.method)}return!1})(o.object,a,t,r)))}return r_(e).some(e=>rX(e,t,r))},rY=(e,t,r=new i)=>{if("Identifier"===(e=rP(e)).type){let n=eD(t.sourceCode.getScope(e),e),o=n?.defs.length===1?n.defs[0]:void 0;if(o?.type!=="Variable")return!1;if(o.parent?.kind!=="const")return!0;if(!o.node.init||r.has(n))return!1;r.add(n);let a=rY(o.node.init,t,r);return r.delete(n),a}if("ConditionalExpression"===e.type){if(rY(e.test,t,r))return!0;let n=rH(e.test,t,r);return void 0!==n?rY(n.value?e.consequent:e.alternate,t,r):rY(e.consequent,t,r)||rY(e.alternate,t,r)}if("LogicalExpression"===e.type){if(rY(e.left,t,r))return!0;let n=rH(e.left,t,r);if(void 0!==n)return("&&"===e.operator?!!n.value:"||"===e.operator?!n.value:null===n.value||void 0===n.value)&&rY(e.right,t,r);return rY(e.right,t,r)}return"SequenceExpression"===e.type?e.expressions.some(e=>rY(e,t,r)):!rL.has(e.type)&&r_(e).some(e=>rY(e,t,r))},rH=(e,t,r=new i)=>{e=rP(e);let{sourceCode:n}=t,o=eZ(e,n);if(!(!rM(e,t,r)&&o||rK(e,t,r)||rX(e,t,r)))return ez(e,n.getScope(e))??void 0},rQ=(e,t)=>{let r=rH(e,t);return void 0===r||rY(e,t)?void 0:r},rZ=e=>null===e||"object"!=typeof e&&"function"!=typeof e,r0={value:void 0},r1=(e,t)=>{if(!e)return r0;let r=rH(e,t);if(r&&rZ(r.value))return{value:r.value}},r2=(e,t)=>{let{element:r,staticValueResult:n}=e,{element:o,staticValueResult:a}=t;if(n&&a){let e,t;return(e=n.value)===(t=a.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!r&&!!o&&"Literal"!==r.type&&"Literal"!==o.type&&rj(r,o)},r3=(e,t)=>{let r=[],n=[];for(let o of e){if(o?.type==="SpreadElement")continue;let e={element:o,staticValueResult:r1(o,t)};r.some(t=>r2(t,e))&&n.push(o),r.push(e)}return n};function r8(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}function r6(e){return ry(e,{checkReserved:!1})}function r9(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let r5=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),r4=([e,t],[r,n])=>e>=r&&t<=n;function r7(e,t,r=[]){let{sourceCode:n}=e,o=r5(e,t),a=r.map(t=>r5(e,t));return r9(e).some(e=>{let t=n.getRange(e);return r4(t,o)&&a.every(e=>!r4(t,e))})}function ne(e,t){let{sourceCode:r}=e,n=r.getLoc(t).end.line;return r.getCommentsAfter(t).findLast(e=>r.getLoc(e).start.line===n)}let nt=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},nr=new i(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),nn=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||nr.has(e.type),no=e=>nn(e)||"BlockStatement"===e.type&&e.body.some(e=>nn(e)),na=(e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>r.getLoc(e).start.line!==r.getLoc(e).end.line)};function ni(e,t){if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function ns(e,t){let{sourceCode:r}=t,[,n]=ta(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let nl=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e;function nu(e){let t;return(e=rP(e),e?.type==="ChainExpression")?nu(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?nu(e.object):nu(e.callee))))}let np=new i(["depth","height","width"]),nc=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","StaticBlock","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition"]);function nd(e){return tR(e,{properties:["length","size"],optional:!1})}let nm=(e,t)=>e?.type==="ObjectExpression"&&e.properties.every(e=>"SpreadElement"!==e.type)&&e.properties.some(e=>"Property"===e.type&&["get","set"].includes(eG(e,t.sourceCode.getScope(e)))),nf=(e,t)=>{let r=e.identifier.parent;if(r?.type==="CallExpression"&&!r.optional&&"MemberExpression"===r.callee.type&&!r.callee.optional&&"Identifier"===r.callee.object.type&&rF(r.callee.object,t)&&r.arguments[0]===e.identifier)return r},ng=(e,t,r)=>{for(let n of e.properties.toReversed()){if("SpreadElement"===n.type)return;let e=eG(n,r.sourceCode.getScope(n));if(void 0===e&&n.computed)return;if(e===t)return n}},ny=(e,t)=>e?.type!=="ObjectExpression"||e.properties.some(e=>"SpreadElement"===e.type||"Property"===e.type&&e.computed&&void 0===eG(e,t.sourceCode.getScope(e))),nh=e=>e.parent?.type==="SwitchCase"&&null===e.parent.test&&1===e.parent.parent.cases.length,nx=(e,t,r)=>{let n=nf(e,r);if(!n)return;let o=eG(n.callee,r.sourceCode.getScope(n.callee));if("defineProperty"===o){let e=n.arguments[1];return e&&rQ(e,r)?.value===t?n.arguments[2]:void 0}if("defineProperties"===o&&n.arguments[1]?.type==="ObjectExpression")return ng(n.arguments[1],t,r)?.value},nb=(e,t,r)=>{let n=nf(e,r);if(!(!n||"assign"!==eG(n.callee,r.sourceCode.getScope(n.callee))||2!==n.arguments.length||"ObjectExpression"!==n.arguments[1].type||n.arguments[1].properties.some(e=>"SpreadElement"===e.type)))return ng(n.arguments[1],t,r)?.value},nE=(e,t,r)=>{let n=nx(e,t,r);return!!(n&&nm(n,r))},nv=(e,t)=>{if(!e)return!1;let r=rQ(e,t);return!!(r&&Number.isSafeInteger(r.value)&&r.value>=0)},nS=(e,t,r)=>{let n=nx(e,t,r);if(n?.type==="ObjectExpression")return nv(ng(n,"value",r)?.value,r);let o=nT(e);if(!o)return nv(nb(e,t,r),r);let{parent:a}=o;if(a?.type==="ForInStatement")return!1;if(a?.type==="ForOfStatement"){let e=rQ(a.right,r)?.value;return Array.isArray(e)&&e.length>0&&e.every(e=>Number.isSafeInteger(e)&&e>=0)}return nv(((e,t)=>{let r=[],n=e;for(;;){let{parent:e}=n;if(!e)return;if("AssignmentExpression"===e.type){if(e.left!==n||"="!==e.operator)return;let o=e.right;for(let e of r.toReversed()){if(!o)return;o="array"===e.type?"ArrayExpression"===o.type?o.elements[e.index]:void 0:"ObjectExpression"===o.type?ng(o,e.propertyName,t)?.value:void 0}return o}if("ArrayPattern"===e.type){let t=e.elements.indexOf(n);if(-1===t)return;r.push({type:"array",index:t})}else if("Property"===e.type&&"ObjectPattern"===e.parent.type)r.push({type:"object",propertyName:eG(e,t.sourceCode.getScope(e))});else if("RestElement"===e.type||"AssignmentPattern"===e.type)return;n=e}})(o,r),r)},nC=e=>{for(let t=e.parent;t;t=t.parent)if(tI(t)||nc.has(t.type))return t},nD=(e,t)=>{for(let r=e;r.parent;r=r.parent){let{parent:e}=r;if(("IfStatement"===e.type||"ConditionalExpression"===e.type)&&(e.consequent===r||e.alternate===r)){let n=rQ(e.test,t);if(n&&!!n.value==(e.consequent===r))continue;return!0}if("LogicalExpression"===e.type&&e.right===r||"ForStatement"===e.type&&(e.body===r||e.update===r)||["WhileStatement","ForInStatement","ForOfStatement"].includes(e.type)&&e.body===r||"SwitchCase"===e.type&&e.consequent.includes(r)&&!nh(r)||"CatchClause"===e.type&&e.body===r||"TryStatement"===e.type&&e.block===r||"AssignmentPattern"===e.type&&e.right===r||"MemberExpression"===e.type&&e.computed&&e.property===r&&nu(e)||"CallExpression"===e.type&&(e.optional||nu(e.callee))&&e.arguments.includes(r))return!0}return!1},nT=e=>{let t=e.identifier;for(;t.parent?.type==="MemberExpression"&&t.parent.object===t;)t=t.parent;return"MemberExpression"===t.type?t:void 0},nA=(e,t,r)=>{let n=nx(e,t,r);if(n)return!nm(n,r);let o=nf(e,r);if(o){let n=eG(o.callee,r.sourceCode.getScope(o.callee));if("assign"===n){if(o.arguments.length<2)return!1;if(nb(e,t,r))return!0;let n=o.arguments[1];return 2!==o.arguments.length||ny(n,r)}if("defineProperty"===n){let e=o.arguments[1],n=e&&rQ(e,r);return!n||n.value===t}if("defineProperties"===n)return ny(o.arguments[1],r)}let a=nT(e);if(!a||eG(a,r.sourceCode.getScope(a))!==t)return!1;let{parent:i}=a;return nl(a)||(i?.type==="ForOfStatement"||i?.type==="ForInStatement")&&i.left===a},nw=(e,t,r)=>{let n=nT(e);return!!(n&&eG(n,r.sourceCode.getScope(n))===t&&n.parent?.type==="ForInStatement"&&n.parent.left===n)},nk=(e,t,r)=>{let n=nT(e);if(!n||eG(n,r.sourceCode.getScope(n))!==t){let t=nf(e,r),n=t&&eG(t.callee,r.sourceCode.getScope(t.callee));return!!(t&&["assign","defineProperty","defineProperties"].includes(n))}let{parent:o}=n;return(o?.type!=="CallExpression"||o.callee!==n)&&(o?.type!=="NewExpression"||o.callee!==n)&&(o?.type!=="TaggedTemplateExpression"||o.tag!==n)};function nI(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let nj=["Program","StyleSheet","Document","root"];function nF(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let nB=({identifiers:e,references:t})=>[...new i([...e,...t.map(({identifier:e})=>e)])],nR=(e,t)=>{let{references:r=[]}=eD(e,t)||{};return r};function nP(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||nR(t,"arguments").some(({from:e})=>e===t))||!!(n&&nR(t,n).length>0))}let nL=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],nN=new i(["any","error","unknown"]),n$=new i(["null","undefined"]),nM=e=>e.getSymbol()??e.aliasSymbol,nO=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function nq(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let nU="target",nV="non-target",nW="nullish",n_="unknown",nz=new i(["ClassDeclaration","ClassExpression"]),nK=new i(["FunctionDeclaration","FunctionExpression"]),nG=new i(["ClassName","ImportBinding","TSEnumName","Type"]),nJ=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),nX=new i(["TSNullKeyword","TSUndefinedKeyword"]),nY=e=>e===nW?nV:e,nH=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==nW):e.map(nY)).length?nV:(t.treatMixedUnionAsTarget?e.includes(nU):e.every(e=>e===nU))?nU:(t.treatMixedUnionAsNonTarget?e.includes(nV):e.every(e=>e===nV))?nV:n_,nQ=e=>(e=e.map(nY)).includes(nU)?nU:e.every(e=>e===nV)?nV:n_,nZ=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nG.has(e.type));if(r)return r;t=t.upper}},n0=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=n0(e.left);return t?`${t}.${e.right.name}`:void 0}},n1=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?nU:t.nonTargetTypeNames?.has(e)?nV:n_},n2=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?nU:nV:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||n1(o,r)!==n_||n1(a,r)!==n_?nV:n_};function n3(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n3(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?n3(e.typeAnnotation,t,r,n):n_;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=n0(t.typeName);if(!s)return n_;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return n_;let n=e.typeName.right.name,o=nZ(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?n_:n2({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==n_)return l;if(!n.preferTypeReferenceDefinitions){let e=n1(s,n);if(e!==n_)return e}if(o.has(s))return n_;o.add(s);let u=nZ(s,r);if(!u)return o.delete(s),n1(s,n);let p=n_,c=((e,t)=>{if("ImportBinding"!==e.type)return n_;if("ImportDefaultSpecifier"===e.node.type)return n1(e.node.local.name,t)===n_?n_:nV;let r=e.node.imported?.name??e.node.imported?.value;return r?n2({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):n_})(u,n);return c!==n_?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=n3(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=n3(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?nV:nQ(a.extends.map(t=>n0(t.expression)?e({typeName:t.expression},r,n,o):n_))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?n_:n6(i.superClass,r,n,o):nV),o.delete(s),p}(e,t,r,n);case"TSUnionType":return nH(e.types.map(e=>n3(e,t,r,n)),r);case"TSIntersectionType":return nQ(e.types.map(e=>n3(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return nU;if(nX.has(e?.type))return nW;return nJ.has(e?.type)?nV:n_}}let n8=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?n6(e.superClass,t,r,n):nV;function n6(e,t,r,n=new i){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return n1(o,r);if(n.has(o))return n_;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=n_;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=n6(i.node.init,t,r,n):i?.type==="ClassName"&&(s=n8(i.node,t,r,n)),n.delete(o),i?s:n1(o,r)}return nz.has(e.type)?n8(e,t,r,n):n_}let n9=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return n3(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function n5(e,t,r,n=new i){if(!e)return n_;if("TSSatisfiesExpression"===e.type)return n5(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=n3(e.typeAnnotation,o,r);if(a!==n_)return a;let s=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=eD(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return n_;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=n3(a.name?.typeAnnotation,i,r),l=n_;return s!==n_?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=n5(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(nz.has(n.type))return n8(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return nV;if(nK.has(n.type)){let e=n9(n,t,r);if(e!==n_)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return nV;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return nV;continue}break}}return n_})(e,t,r):n_;case"Super":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static||"MethodDefinition"===n.type&&n.static)return nV;if(nz.has(n.type))return n.superClass?n6(n.superClass,t.sourceCode.getScope(n),r):nV}return n_})(e,t,r):n_;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,n6(a,t.sourceCode.getScope(a),r,void 0)):n_;case"TSAsExpression":case"TSTypeAssertion":{let a=n3(e.typeAnnotation,o,r);return a===n_?n5(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return n5(e.expression,t,r,n);case"SequenceExpression":return n5(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return nH([n5(e.consequent,t,r,n),n5(e.alternate,t,r,n)],r);default:return n_}})(e,t,r,n);if(s!==n_)return s;if("Identifier"!==e.type){let n,o=(n=rQ(e,t))?r.getStaticType?.(n.value,e)??n_:n_;if(o!==n_)return o}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tS(e,{name:t}))||r.targetCallNames?.some(t=>tv(e,{name:t},tx)))return nU;let l=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return n_;try{let{program:t}=n;return function e(t,r,n,o){if(nN.has(t.intrinsicName))return n_;if(n$.has(t.intrinsicName))return nW;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):n_}if(t.isUnion())return nH(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return nQ(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return nU;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&nq(t,r).some(t=>e(t,r,n,o)===nU))return nU;if(t.intrinsicName)return nV;let i=nM(t);if(!i)return n_;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?nU:nV}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return n_}})(e,t,r);return l!==n_?l:r.isNonTargetNode?.(e,t)?nV:n_}let n4=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>nY(n5(t,r,{...e,...n})),isTarget:(t,r,n)=>n5(t,r,{...e,...n})===nU,isKnownNonTarget:(t,r,n)=>nY(n5(t,r,{...e,...n}))===nV}),n7=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>n4({...n,targetTypeNames:new i([e]),typeReferenceAliases:new o(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),oe=new i(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),ot=new i(["Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet","CanvasRenderingContext2D","OffscreenCanvasRenderingContext2D"]),or=new i(["BigInt64Array","BigUint64Array"]),on=new i([...nL,...ot]),oo={checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new i(["Array","ReadonlyArray"]),nonTargetTypeNames:on,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tL(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||oe.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?nU:"Identifier"===t.type||"MemberExpression"===t.type?n_:nV},{isTarget:oa,isKnownNonTarget:oi}=n4(oo),{isKnownNonTarget:os}=n4({...oo,targetTypeNames:new i([...oo.targetTypeNames,...nL]),nonTargetTypeNames:ot,targetConstructorNames:["Array",...nL]}),{isTarget:ol}=n4({treatMixedUnionAsTarget:!0,targetTypeNames:or,targetConstructorNames:[...or],isTargetNode:e=>tL(e,{objects:[...or],methods:["from","of"],optionalCall:!1,optionalMember:!1})}),ou=new i(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function op(e,t){return!ou.has(e.type)&&os(e,t)}let oc=new i(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),od=new i(["AnimationEvent","AnimationPlaybackEvent","AudioProcessingEvent","BeforeUnloadEvent","BlobEvent","ClipboardEvent","CloseEvent","CommandEvent","CompositionEvent","ContentVisibilityAutoStateChangeEvent","CookieChangeEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","ExtendableCookieChangeEvent","ExtendableEvent","ExtendableMessageEvent","FetchEvent","FocusEvent","FontFaceSetLoadEvent","FormDataEvent","GPUUncapturedErrorEvent","GamepadEvent","HashChangeEvent","IDBVersionChangeEvent","InputEvent","KeyboardEvent","MIDIConnectionEvent","MIDIMessageEvent","MediaEncryptedEvent","MediaKeyMessageEvent","MediaQueryListEvent","MediaStreamTrackEvent","MessageEvent","MouseEvent","NavigateEvent","NavigationCurrentEntryChangeEvent","NotificationEvent","OfflineAudioCompletionEvent","PageRevealEvent","PageSwapEvent","PageTransitionEvent","PaymentMethodChangeEvent","PaymentRequestUpdateEvent","PictureInPictureEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","PushEvent","PushSubscriptionChangeEvent","RTCDataChannelEvent","RTCDTMFToneChangeEvent","RTCErrorEvent","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCTrackEvent","RTCTransformEvent","SecurityPolicyViolationEvent","SpeechRecognitionErrorEvent","SpeechRecognitionEvent","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","StorageEvent","SubmitEvent","TaskPriorityChangeEvent","TextEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WebGLContextEvent","WheelEvent",...oc]),{isTarget:om,isKnownNonTarget:of}=n4({preferTypeReferenceDefinitions:!0,targetTypeImports:new o([["react",oc]]),targetTypeNamespaceImports:new o([["react",oc]]),targetTypeNames:od}),{isTarget:og}=n7({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?nU:n_}),{isTarget:oy}=n7({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?nU:n_}),oh=new i(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),ox=new i(["KeyboardEvent","React.KeyboardEvent"]),ob=new i(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:oE}=n4({targetTypeNames:oh,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?nU:n_}}),{isKnownNonTarget:ov}=n4({targetTypeNames:ox,nonTargetTypeNames:ob}),oS=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,oC=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),oD=new i(["fromCharCode","fromCodePoint"]),oT=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oT(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return tu(e.literal);default:return!1}},{isTarget:oA,isKnownNonTarget:ow}=n4({targetTypeNames:new i,targetCallNames:["String"],isTargetNode:(e,t)=>{if(tu(e)||oS(e,"String")||"CallExpression"===e.type&&!e.optional&&oC(e.callee,"String",oD))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(ok(e.left,t)||ok(e.right,t));case"AssignmentExpression":if("="===e.operator)return ok(e.right,t);return"+="===e.operator&&(ok(e.left,t)||ok(e.right,t));default:return!1}},isTargetTypeAnnotation:oT,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?nU:n_});function ok(e,t){if(!e)return!1;if("TSSatisfiesExpression"===e.type&&oT(e.typeAnnotation)||oA(e,t))return!0;let r=((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;return!!(n?.type==="Variable"&&(n.parent?.kind==="let"||n.parent?.kind==="var")&&n.node.id===n.name&&n.node.init&&r.references.every(e=>!e.isWrite()||e.init))})(e,t)?rH(e,t):rQ(e,t);return"string"==typeof r?.value}let oI=new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),oj=new i(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),oF=new i(["charCodeAt","codePointAt","indexOf","lastIndexOf","localeCompare","search"]),oB=new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),oR=new i(["parseFloat","parseInt"]),oP=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&td(e.literal),oL=new i(["-","*","/","%","**","<<",">>","|","^","&"]);function oN(e,t){let r;if(td(e)||oC(e,"Math",oI)||"CallExpression"===e.type&&!e.optional&&oC(e.callee,"Math",oj)||oS(e,"Number")||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.computed&&!e.callee.optional&&"Identifier"===e.callee.property.type&&oF.has(e.callee.property.name)&&ok(e.callee.object,t)||oC(e,"Number",oB)||"CallExpression"===e.type&&!e.optional&&oC(e.callee,"Number",oR)||oS(e,"parseInt")||oS(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name)return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&oN(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&oN(e.left,t)&&oN(e.right,t)||">>>"===r||oL.has(r)&&(oN(e.left,t)||oN(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&oN(e.argument,t))return!0;break}case"UpdateExpression":if(oN(e.argument,t))return!0;break;case"ConditionalExpression":{let r=oN(e.consequent,t),n=oN(e.alternate,t);if(r&&n)return!0;let o=rQ(e.test,t);if(void 0!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(oN(e.expressions.at(-1),t))return!0;break;case"Identifier":var n;if(n=t.sourceCode.getScope(e),(r=eD(n,e))&&r.defs.some(e=>oP(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(oP(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(oN(e.expression,t))return!0}return"number"==typeof rQ(e,t)?.value}n4({targetTypeNames:new i,targetCallNames:["Number"],isTargetTypeAnnotation:oP,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?nU:n_});let o$=new i([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),oM=new i(["boolean","true","false"]),oO=new i(["isFinite","isNaN"]),oq=new o([["Array",new i(["isArray"])],["ArrayBuffer",new i(["isView"])],["Atomics",new i(["isLockFree"])],["Error",new i(["isError"])],["Number",new i(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new i(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new i(["deleteProperty","has"])],["URL",new i(["canParse"])]]),oU=new o([["array",new i(["every","includes","some"])],["map",new i(["has"])],["regexp",new i(["test"])],["set",new i(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new i(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new i(["has"])]]),oV=new o([["regexp",new i(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function oW(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(!t)return!1;if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):oM.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function o_(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>oK(e.returnType,t,r,n))}function oz({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=rh(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function oK(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oK(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return oz({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&oK(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>oK(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function oG(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oG(e.typeAnnotation,t,r,n);case"TSFunctionType":return oK(e.returnType,t,r,n);case"TSTypeLiteral":return o_(e.members,t,r,n);case"TSTypeReference":return oz({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&oG(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&o_(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>oG(e,t,r,n));default:return!1}}function oJ(e,t,r=new i){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!oK(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?oH(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&oH(e.body,t,r))}function oX(e,t,r=new i){if(e?.type!=="Identifier")return!1;let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let o=!1;if(n.defs.length>1&&n.defs.every(e=>"FunctionName"===e.type)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),a=e.length>0?e:n.defs;o=n.references.every(e=>!e.writeExpr)&&a.every(e=>oJ(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(oG(e.name?.typeAnnotation,t,a))o=!0;else{let a;"FunctionName"===e.type?n.references.every(e=>!e.writeExpr)&&(a=e.node):"Variable"===e.type&&"const"===e.parent.kind&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(a=e.node.init),o=!!a&&oJ(a,t,r)}}return r.delete(n),o}function oY(e,t,r=new i){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=eD(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||"Variable"!==o.type||"const"!==o.parent.kind)return;r.add(n);let a=oY(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return oY(e.expression,t,r)}}function oH(e,t,r=new i){let n,o;if(!e)return!1;let a=t.sourceCode.getScope(e);return!!(oK(e.typeAnnotation,t,a)||(n=e,o=t,"boolean"==typeof rH(n,o)?.value))||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&oK(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&oH(n.node.init,t,r);if(!a&&"Parameter"===n.type){let e=n.name.parent;a="AssignmentPattern"===e.type&&e.left===n.name&&n.node.params.includes(e)&&oH(e.right,t,r)}return r.delete(e),a}(eD(t.sourceCode.getScope(e),e),t,r)||oW(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return oH(e.left,t,r)&&oH(e.right,t,r);case"BinaryExpression":return o$.has(e.operator);case"ConditionalExpression":return oH(e.consequent,t,r)&&oH(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),oK(e.typeAnnotation,t,n)||oH(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=oq.get(e.callee.object.name),n=eG(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=oU.get(oY(e.callee.object,t)),n=eG(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?oW(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||oO.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||oX(e.callee,t,r)||oW(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=oV.get(oY(e.object,t)),n=eG(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return oH(e.argument??e.expression,t,r);case"SequenceExpression":return oH(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&oH(e.right,t,r)}return}}(e,t,r)??oW(e,t))}let oQ=new i(["asIntN","asUintN"]),oZ=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oZ(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return tg(e.literal);default:return!1}},{isTarget:o0}=n4({targetTypeNames:new i,targetCallNames:["BigInt"],isTargetNode:e=>tg(e)||oS(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&oC(e.callee,"BigInt",oQ),isTargetTypeAnnotation:oZ,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?nU:n_}),o1=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),o2=e=>o1.has(e.type)||tV(e),o3=new i(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),o8=new i(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),o6=e=>o3.has(e.type)||o8.has(e.type)||tV(e)||tv(e,void 0,tx)&&!tL(e,{method:"bind",optionalCall:!1,optionalMember:!1}),o9=(e,t)=>{if("ThisExpression"===e.type)return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&o9(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&o9(r.key,t))return!0;return!1}let r=t[e.type];if(!r)return!1;for(let n of r){let r=e[n];if(r){if(Array.isArray(r)){for(let e of r)if(e&&o9(e,t))return!0;continue}if(o9(r,t))return!0}}return!1};function o5(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function o4(e,t){let r;if(r=e=t.getNonNullableType(e),!nN.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>o4(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let o7=e=>"use"===e||/^use[\dA-Z]/.test(e),ae=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name,at=e=>rR(e)||e?.type==="TSInstantiationExpression",ar=e=>{for(;at(e);)e=e.expression;return e},an=(e,t)=>{let r=ar(e?.callee);return e?.type==="CallExpression"&&r?.type==="MemberExpression"&&!e.optional&&!r.optional&&!r.computed&&"Identifier"===r.object.type&&"process"===r.object.name&&"Identifier"===r.property.type&&"exit"===r.property.name&&rF(r.object,t)},ao=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,aa=e=>"ThrowStatement"===e.type,ai=()=>!1,as=(e,t)=>{let r;return"SequenceExpression"===e.type?e.expressions.every(e=>ay(e,t)):"ChainExpression"===e.type&&"MemberExpression"===e.expression.type&&!!e.expression.optional&&void 0!==(r=rQ(e.expression.object,t))&&(null===r.value||void 0===r.value)||void 0!==rQ(e,t)},al=(e,t)=>{let{sourceCode:r}=t,n=eD(r.getScope(e),e.name),o=r.getRange(e)[0];return n?.defs.some(e=>("Variable"===e.type&&e.parent?.kind!=="var"||"ClassName"===e.type||"ImportBinding"===e.type)&&e.name&&r.getRange(e.name)[0]>o)!==!0},au=(e,t)=>!!eD(t.sourceCode.getScope(e),e.name)&&al(e,t),ap=(e,t)=>{let r=rQ(e,t);return void 0!==r&&(null===r.value||"function"==typeof r.value)},ac=(e,t)=>{let r;return"MemberExpression"===e.type&&!e.optional&&!aw(e.object)&&(tT(e.object)||tA(e.object)||void 0!==(r=rQ(e.object,t))&&null!==r.value&&void 0!==r.value)&&(!e.computed||ay(e.property,t))},ad=(e,t)=>{let r,n;return"Identifier"===e.type&&al(e,t)&&(r=eD(t.sourceCode.getScope(e),e.name),r?.defs.some(e=>"Variable"===e.type&&e.parent?.kind==="const"||"ClassName"===e.type||"ImportBinding"===e.type)!==!0)&&(!(n=t.sourceCode.getScope(e)).isStrict||!!eD(n,e.name))||ac(e,t)},am=(e,t)=>"Identifier"===e.type&&au(e,t)||ac(e,t),af=new i(["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","&=","^=","|="]),ag=(e,t)=>{if("="===e.operator){let r;return r=e.left,"Identifier"===r.type||"ArrayPattern"===r.type||"ObjectPattern"===r.type||ac(r,t)}if(af.has(e.operator))return am(e.left,t);if(!["&&=","||=","??="].includes(e.operator)||!am(e.left,t))return!1;let r=rQ(e.left,t);return void 0!==r&&("&&="===e.operator?!!r.value:"||="===e.operator?!r.value:null===r.value||void 0===r.value)},ay=(e,t)=>"AssignmentExpression"===e.type?"="===e.operator&&ad(e.left,t)&&as(e.right,t):as(e,t),ah=(e,t)=>(e=ar(e),e?.type==="Identifier")?au(e,t):ay(e,t),ax=e=>"using"===e.kind||"await using"===e.kind,ab=(e,t)=>"ExpressionStatement"===e.type?ay(e.expression,t):"BlockStatement"===e.type?e.body.every(e=>ab(e,t)):"EmptyStatement"===e.type||"FunctionDeclaration"===e.type||"VariableDeclaration"===e.type&&!ax(e)&&e.declarations.every(e=>"Identifier"===e.id.type&&(!e.init||ay(e.init,t))),aE=(e,t,r)=>ab(e,t)||!!r?.isAdditionalStatementDefinitelyNotThrowing?.(e),av=e=>"ReturnStatement"===e.type&&!e.argument,aS=(e,t)=>{if("IfStatement"!==e.type||e.alternate||!ay(e.test,t)||!(av(e.consequent)||"BlockStatement"===e.consequent.type&&1===e.consequent.body.length&&av(e.consequent.body[0])))return!1;let r=rQ(e.test,t);return void 0!==r&&!r.value},aC=(e,t)=>e.declarations.some(e=>e.init&&aj(e.init,t)),aD=(e,t)=>{for(let r of e.declarations)if(r.init){if(aL(r.init,t))return!0;if(ax(e))return!1;if("Identifier"!==r.id.type||!ay(r.init,t))break}return!1},aT=(e,t,r,n={})=>{let{isAdditionalStatementAlwaysExits:o=()=>!1}=n;for(let a of e){if(aY(a,t,r,n)||o(a))return!0;if(!aS(a,t)&&!aE(a,t,n))break}return!1},aA=(e,t,r=!0,n)=>!function(e,t){if("StaticBlock"!==e.type)return!1;let r=e,{parent:n}=e;for(;n&&!tI(n);){if("ClassDeclaration"===n.type||"ClassExpression"===n.type)return!!(n.superClass&&n.superClass!==r&&!aL(n.superClass,t)&&!ap(n.superClass,t));r=n,{parent:n}=n}return!1}(e,t)&&aT(e.body,t,r,n);function aw(e){return e?.type==="MemberExpression"?e.optional||aw(e.object):e?.type==="CallExpression"&&(e.optional||aw(e.callee))}function ak(e,t){if(!aP(e,t))return!1;let r=e,{parent:n}=e;for(;n&&!tI(n);){if(("ClassDeclaration"===n.type||"ClassExpression"===n.type)&&n.superClass&&n.superClass!==r&&!aL(n.superClass,t)&&!ap(n.superClass,t)||"CallExpression"===n.type&&n.arguments.includes(r)&&(n.optional||aw(n.callee))||"MemberExpression"===n.type&&n.computed&&n.property===r&&(n.optional||aw(n.object)))return!1;r=n,{parent:n}=n}return!0}let aI=(e,t)=>{let r,n=rQ(e.left,t);if(void 0===n||!ay(e.left,t))return!1;switch(e.operator){case"&&":r=!!n.value;break;case"||":r=!n.value;break;default:r=null===n.value||void 0===n.value}return r};function aj(e,t){if(an(e,t))return!0;if(at(e))return aj(e.expression,t);switch(e?.type){case"ChainExpression":return aj(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return aj(e.argument,t);case"CallExpression":case"NewExpression":return!!aj(e.callee,t)||!("CallExpression"===e.type&&(e.optional||aw(e.callee)))&&!!ah(e.callee,t)&&e.arguments.some(e=>aj(e,t));case"MemberExpression":return aj(e.object,t)||e.computed&&!e.optional&&!aw(e.object)&&ah(e.object,t)&&aj(e.property,t);case"ArrayExpression":return e.elements.some(e=>e&&aj(e,t));case"ObjectExpression":return e.properties.some(e=>"SpreadElement"===e.type?aj(e.argument,t):e.computed&&aj(e.key,t)||aj(e.value,t));case"YieldExpression":return!!(e.argument&&aj(e.argument,t));case"AssignmentExpression":return aj(e.left,t)||ag(e,t)&&aj(e.right,t);case"ImportExpression":return aj(e.source,t);case"TemplateLiteral":return e.expressions.some(e=>aj(e,t));case"TaggedTemplateExpression":return aj(e.tag,t)||ah(e.tag,t)&&e.quasi.expressions.some(e=>aj(e,t));case"ClassExpression":return aH(e,t,!0);case"SequenceExpression":return e.expressions.some(e=>aj(e,t));case"ConditionalExpression":if(aj(e.test,t))return!0;let r=rQ(e.test,t);return void 0!==r&&ay(e.test,t)?aj(r.value?e.consequent:e.alternate,t):aj(e.consequent,t)&&aj(e.alternate,t);case"LogicalExpression":return aj(e.left,t)||aI(e,t)&&aj(e.right,t);case"BinaryExpression":return aj(e.left,t)||aj(e.right,t);default:return!1}}function aF(e,t,r){if(!e||tI(e))return!1;if("BreakStatement"===e.type)return e.label?.name===r;if("LabeledStatement"===e.type&&e.label.name===r)return!1;if("IfStatement"===e.type){if(aL(e.test,t))return!1;let n=rQ(e.test,t);if(void 0!==n&&ay(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&aF(o,t,r))}}if(aj(e.expression,t))return!1;if("BlockStatement"===e.type){for(let n of e.body){if(aF(n,t,r))return!0;if(aQ(n,t))break}return!1}for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>aF(e,t,r)))return!0}return!1}let aB=(e,t)=>{if("SpreadElement"===e.type)return aL(e.argument,t);if(e.computed){if(aL(e.key,t))return!0;if(!ay(e.key,t))return!1}return aL(e.value,t)},aR=(e,t)=>{for(let r of e)if(r){if(aL(r,t))return!0;if(!ay(r,t))break}return!1},aP=(e,t)=>an(e,t)&&(e.arguments.every(e=>ay(e,t))||aR(e.arguments,t));function aL(e,t){if(aP(e,t))return!0;if(at(e))return aL(e.expression,t);switch(e?.type){case"ChainExpression":return aL(e.expression,t);case"SpreadElement":case"UnaryExpression":case"AwaitExpression":return aL(e.argument,t);case"CallExpression":case"NewExpression":return!!aL(e.callee,t)||!("CallExpression"===e.type&&(e.optional||aw(e.callee)))&&!!ah(e.callee,t)&&aR(e.arguments,t);case"MemberExpression":return aL(e.object,t)||e.computed&&!e.optional&&!aw(e.object)&&(tT(e.object)||tA(e.object))&&aL(e.property,t);case"ArrayExpression":return aR(e.elements,t);case"ObjectExpression":for(let r of e.properties){if(aB(r,t))return!0;if("SpreadElement"===r.type){if(!ay(r.argument,t))return!1;continue}if(r.computed&&!ay(r.key,t)||!ay(r.value,t))break}return!1;case"ClassExpression":return aX(e,t,!0);case"AssignmentExpression":return aL(e.left,t)||ag(e,t)&&aL(e.right,t);case"TaggedTemplateExpression":return!!aL(e.tag,t)||!!ah(e.tag,t)&&aR(e.quasi.expressions,t);case"YieldExpression":return!!(e.argument&&aL(e.argument,t));case"ImportExpression":return aL(e.source,t);case"TemplateLiteral":case"SequenceExpression":return aR(e.expressions,t);case"LogicalExpression":return!!aL(e.left,t)||aI(e,t)&&aL(e.right,t);case"BinaryExpression":return aL(e.left,t)||ay(e.left,t)&&aL(e.right,t);case"ConditionalExpression":if(aL(e.test,t))return!0;let r=rQ(e.test,t);return void 0!==r&&ay(e.test,t)?aL(r.value?e.consequent:e.alternate,t):ah(e.test,t)&&aL(e.consequent,t)&&aL(e.alternate,t);default:return!1}}function aN(e,t,r,n){if(e.finalizer&&aQ(e.finalizer,t,!0,n))return!0;let o=e.handler?aA(e.block,t,r,n):aQ(e.block,t,r,n);return r?!!o||!!(e.handler&&ie(e.block,t,aa)&&aQ(e.handler,t,!0,n)):o||e.handler&&ie(e.block,t,aa)&&aQ(e.handler,t,!1,n)}function a$(e,t,r,n){for(let o of e.body){if(aQ(o,t,r,n))return!0;if(ao(o)||ie(o,t,ao))break}return!1}let aM=(e,t,r,n)=>{let{checkTryStatements:o,enclosingLoop:a,isAtStart:i,isLastStatement:s,options:l,isProcessExitAtTest:u}=n;if("BlockStatement"!==e.type&&(i?aY(e,r,o,l):aQ(e,r,o,l))||"BlockStatement"!==e.type&&!i&&ie(e,r,ao)&&!("SwitchStatement"===e.type&&a9(e,t,r)))return!0;if(aE(e,r,l)||a0(e,t))return u;if("LabeledStatement"===e.type&&tF(e.body))return aM(e.body,t,r,n);if("IfStatement"===e.type){let o=rQ(e.test,r);if(void 0!==o&&ay(e.test,r)){let a=o.value?e.consequent:e.alternate;return a?aM(a,t,r,n):u}return ah(e.test,r)&&aM(e.consequent,t,r,n)&&(e.alternate?aM(e.alternate,t,r,n):u)}if("BlockStatement"!==e.type)return u&&s&&("SwitchStatement"===e.type&&(!o||a_(e,t,r,l))&&!a6(e,t,r)||tF(e)&&(!aU(e,r)||aW(e,n))&&(!o||aG(e,r))&&(!o||aV(e.body,e,n))&&!a6(e,t,r));if(i){if(aA(e,r,o,l)||aO(e.body,t,r,n))return!0;let a=e.body.at(-1);return a&&a0(a,t)&&e.body.slice(0,-1).every(e=>aE(e,r,l))?u:1===e.body.length&&aM(e.body[0],t,r,n)}if(e.body.some(e=>a9(e,t,r))){if(aO(e.body,t,r,n)||aq(e.body,t,r,n))return!0;let o=e.body.at(-1);return!!(o&&a9(o,t,r)&&aM(o,t,r,n))}return aq(e.body,t,r,n)},aO=(e,t,r,n)=>{let{isProcessExitAtTest:o,options:a}=n,i=e.findIndex(e=>a8(e,t,r)),s=-1===i?void 0:e[i];return!!(s&&e.slice(0,i).every(e=>aE(e,r,a))&&o&&(s.alternate?aM(s.alternate,t,r,n):i===e.length-1||aq(e.slice(i+1),t,r,n)))},aq=(e,t,r,n)=>{let{checkTryStatements:o,isAtStart:a,options:i,isProcessExitAtTest:s}=n,l=!1;for(let[u,p]of e.entries()){if(a){if(aY(p,r,o,i))return!0;if(a0(p,t))return s;if(!aE(p,r,i))return!1;continue}if(!aE(p,r,i)){if(a8(p,t,r)&&l)break;if(aM(p,t,r,{...n,isLastStatement:u===e.length-1}))return!0;if(a9(p,t,r))break;l=!0}}return!1},aU=(e,t)=>("WhileStatement"===e.type||"ForStatement"===e.type)&&(!e.test||!!rQ(e.test,t)?.value),aV=(e,t,r)=>{let{context:n,enclosingLoop:o,options:a}=r;if(a1(e,t)||a0(e,t)||o&&a0(e,o)||"EmptyStatement"===e.type)return!0;if("IfStatement"===e.type&&ah(e.test,n))return aV(e.consequent,t,r)&&(!e.alternate||aV(e.alternate,t,r));if("BlockStatement"!==e.type)return!1;let i=e.body.at(-1);return!!(!i||aV(i,t,r)&&e.body.slice(0,-1).every(e=>aE(e,n,a)))},aW=(e,t)=>{let{context:r,enclosingLoop:n}=t;return aV(e.body,e,t)||ie(e.body,r,t=>a1(t,e)||!!(n&&a0(t,n)))},a_=(e,t,r,n)=>{let o=a=>aE(a,r,n)||a5(a,e)||a0(a,t)||"BlockStatement"===a.type&&a.body.length>0&&o(a.body.at(-1))&&a.body.slice(0,-1).every(e=>aE(e,r,n));return ay(e.discriminant,r)&&e.cases.every(e=>(null===e.test||ay(e.test,r))&&e.consequent.every(e=>o(e)))},az=(e,t,r,n)=>aU(e,t)&&aY(e.body,t,r,n),aK=(e,t)=>"VariableDeclaration"===e.type?ab(e,t):ay(e,t),aG=(e,t)=>{let r;return"WhileStatement"===e.type||"DoWhileStatement"===e.type?ah(e.test,t):"ForStatement"===e.type?(!e.init||aK(e.init,t))&&(!e.test||ah(e.test,t))&&(!e.update||ay(e.update,t)):("ForInStatement"===e.type||"ForOfStatement"===e.type)&&(r=e.left,"VariableDeclaration"===r.type?ab(r,t):ad(r,t))&&ay(e.right,t)},aJ=(e,t,r,{checkTryStatements:n,switchStatement:o,options:a})=>{let i=[];for(let r=t;r<e.length;r++)i.push(...e[r].consequent);return aT(i,r,n,{...a,isAdditionalStatementAlwaysExits:e=>a4(e,o)})},aX=(e,t,r,n)=>{if(e.superClass){if(aL(e.superClass,t))return!0;if(!ap(e.superClass,t))return!1}for(let o of e.body.body){if(o.computed){if(aL(o.key,t))return!0;if(!ay(o.key,t))break}if("StaticBlock"===o.type){if(aA(o,t,r,n))return!0;if(o.body.some(e=>!aE(e,t,n)))return!1;continue}if("PropertyDefinition"===o.type&&o.static){if(o.value&&aL(o.value,t))return!0;if(o.value&&!ay(o.value,t))break}}return!1};function aY(e,t,r=!0,n){if("ExpressionStatement"===e.type)return aL(e.expression,t);if("VariableDeclaration"===e.type)return aD(e,t);if("ReturnStatement"===e.type||"ThrowStatement"===e.type)return!!(e.argument&&aL(e.argument,t));if("IfStatement"===e.type||"ConditionalExpression"===e.type){var o;if(aL(e.test,t))return!0;let a=rQ(e.test,t);if(void 0!==a&&ay(e.test,t)){let o=a.value?e.consequent:e.alternate;return!!(o&&aY(o,t,r,n))}return ah(e.test,t)&&aY(e.consequent,t,r,n)&&!!(e.alternate&&aY(e.alternate,t,r,n))}if("BlockStatement"===e.type)return aA(e,t,r,n);if("TryStatement"===e.type)return o=n,!!(e.finalizer&&aY(e.finalizer,t,r,o))||(e.finalizer&&o?.isAdditionalStatementAlwaysExits&&!aE(e.finalizer,t,o)&&(o={...o,isAdditionalStatementAlwaysExits:void 0}),e.handler?aN(e,t,r,o):aA(e.block,t,r,o));if("LabeledStatement"===e.type)return!aF(e.body,t,e.label.name)&&aY(e.body,t,r,n);if(["DoWhileStatement","WhileStatement","ForStatement","ForInStatement","ForOfStatement"].includes(e.type))return"DoWhileStatement"===e.type?aM(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!0,isLastStatement:!0,options:n,isProcessExitAtTest:aL(e.test,t)}):((e,t,r,n)=>{if("WhileStatement"===e.type)return aL(e.test,t)||az(e,t,r,n);if("ForStatement"===e.type){if(e.init){let r;if(r=e.init,"VariableDeclaration"===r.type?aD(r,t):aL(r,t))return!0;if(!aK(e.init,t))return!1}return!!(e.test&&aL(e.test,t)||aU(e,t)&&e.update&&aL(e.update,t)&&ab(e.body,t)||az(e,t,r,n))}return("ForInStatement"===e.type||"ForOfStatement"===e.type)&&aL(e.right,t)})(e,t,r,n);if("SwitchStatement"===e.type){if(aL(e.discriminant,t))return!0;if(!ah(e.discriminant,t))return!1;let o=e.cases.findIndex(e=>e.test&&aL(e.test,t)),a=e.cases.findIndex(e=>null===e.test);for(let[a,i]of e.cases.entries()){if(-1!==o&&a>=o)break;if(null!==i.test&&!ay(i.test,t)||!aJ(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n}))return!1}return -1!==o||-1!==a&&aJ(e.cases,a,t,{checkTryStatements:r,switchStatement:e,options:n})}return"ClassDeclaration"===e.type||"ClassExpression"===e.type?aX(e,t,r,n):aQ(e,t,r,n)}let aH=(e,t,r,n)=>{if(e.superClass){if(aj(e.superClass,t))return!0;if(!ap(e.superClass,t))return!1}return e.body.body.some(e=>!!(e.computed&&aj(e.key,t))||("StaticBlock"===e.type?a$(e,t,r,n):"PropertyDefinition"===e.type&&e.static&&aj(e.value,t)))};function aQ(e,t,r=!0,n){if("ExpressionStatement"===e.type&&aj(e.expression,t)||aj(e,t)||("ReturnStatement"===e.type||"ThrowStatement"===e.type)&&e.argument&&aj(e.argument,t)||"SwitchStatement"===e.type&&aj(e.discriminant,t))return!0;if("BlockStatement"===e.type)return a$(e,t,r,n);if("CatchClause"===e.type)return aQ(e.body,t,r,n);if("VariableDeclaration"===e.type)return aC(e,t);if("DoWhileStatement"===e.type)return aM(e.body,e,t,{checkTryStatements:r,context:t,enclosingLoop:e,isAtStart:!1,isLastStatement:!0,options:n,isProcessExitAtTest:aj(e.test,t)});return"WhileStatement"===e.type?aj(e.test,t)||az(e,t,r,n):"ForStatement"===e.type?!!(e.init&&("VariableDeclaration"===e.init.type?aC(e.init,t):aj(e.init,t))||e.test&&aj(e.test,t)||aU(e,t)&&e.update&&aj(e.update,t)&&ab(e.body,t)||az(e,t,r,n)):"ForInStatement"===e.type||"ForOfStatement"===e.type?aj(e.right,t):"ClassDeclaration"===e.type||"ClassExpression"===e.type?aH(e,t,r,n):"LabeledStatement"===e.type?!aF(e.body,t,e.label.name)&&aQ(e.body,t,r,n):"TryStatement"===e.type?aN(e,t,r,n):"SwitchStatement"===e.type?a7(e,t,ai,r):!!("IfStatement"===e.type&&aj(e.test,t))||("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&aQ(e.consequent,t,r,n)&&aQ(e.alternate,t,r,n)}function aZ(e){let t=e.parent;if(e.label){for(;t&&!tI(t);){if("LabeledStatement"===t.type&&t.label.name===e.label.name)return t;t=t.parent}return}let r="BreakStatement"===e.type;for(;t&&!tI(t);){if(r&&(tF(t)||"SwitchStatement"===t.type)||!r&&tF(t))return t;t=t.parent}}function a0(e,t){return"ContinueStatement"===e.type?a2(aZ(e),t):"BlockStatement"===e.type&&1===e.body.length&&a0(e.body[0],t)}function a1(e,t){return"BreakStatement"===e.type&&a2(aZ(e),t)}function a2(e,t){return e===t||e?.type==="LabeledStatement"&&e.body===t}function a3(e,t){for(let r=t.parent;r;r=r.parent){if(r===e)return!0;if(tI(r))break}return!1}function a8(e,t,r){return"IfStatement"===e.type&&ah(e.test,r)&&a0(e.consequent,t)}function a6(e,t,r){if(!e||tI(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=aZ(e),n=a2(r,t);if("BreakStatement"===e.type&&n||!n&&a3(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>a6(e,t,r)))return!0}return!1}function a9(e,t,r){if(!e||tI(e))return!1;if("BreakStatement"===e.type||"ContinueStatement"===e.type){let r=aZ(e);if(a2(r,t)||a3(r,t))return!0}for(let n of r.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if((Array.isArray(o)?o:[o]).some(e=>a9(e,t,r)))return!0}return!1}function a5(e,t){return"BreakStatement"===e.type&&a2(aZ(e),t)}function a4(e,t){if("BreakStatement"!==e.type&&"ContinueStatement"!==e.type)return!1;let r=aZ(e);return!(!r||a2(r,t))&&a3(r,t)}function a7(e,t,r,n){let o=[],a=r===ai?r:t=>ao(t)||r(t)||a4(t,e),i=!1;for(let s=e.cases.length-1;s>=0;s--){let l=e.cases[s];i=!function e(t,r,n,o){for(let a of t){if(function t(r,n,o,a){if(!r||tI(r))return!1;if("BreakStatement"===r.type&&a5(r,o)||a&&a4(r,o))return!0;if("BlockStatement"===r.type)return e(r.body,n,o,a);if(tF(r)||"SwitchStatement"===r.type)return!1;if("IfStatement"===r.type){if(aL(r.test,n))return!1;let e=rQ(r.test,n);if(void 0!==e&&ay(r.test,n)){let i=e.value?r.consequent:r.alternate;return!!(i&&t(i,n,o,a))}}for(let e of n.sourceCode.visitorKeys[r.type]??[]){let i=r[e];if((Array.isArray(i)?i:[i]).some(e=>t(e,n,o,a)))return!0}return!1}(a,r,n,o))return!0;if(ao(a)||ie(a,r,ao)||aQ(a,r))break}return!1}(l.consequent,t,e,r===ai)&&(l.consequent.some(e=>ie(e,t,a)||aQ(e,t,n))||i),o[s]=i}let s=e.cases.findIndex(e=>e.test&&aL(e.test,t));return -1!==s?e.cases.every((e,t)=>t>=s||o[t]):e.cases.some(e=>null===e.test)&&o.every(Boolean)}function ie(e,t,r){if(r(e)||aQ(e,t,!1))return!0;if("BlockStatement"===e.type){let n=e.body.at(-1);return!!(n&&ie(n,t,r))}if("CatchClause"===e.type)return ie(e.body,t,r);if("TryStatement"===e.type)return!!(e.finalizer&&ie(e.finalizer,t,r)||e.handler&&ie(e.block,t,r)&&ie(e.handler,t,r));if("SwitchStatement"===e.type)return a7(e,t,r,!1);if("IfStatement"===e.type||"ConditionalExpression"===e.type){let n=eZ(e.test,t.sourceCode,{considerGetters:!0})&&!rM(e.test,t)?void 0:rQ(e.test,t);if(void 0!==n&&ay(e.test,t)){let o=n.value?e.consequent:e.alternate;return!!(o&&ie(o,t,r))}}return("IfStatement"===e.type||"ConditionalExpression"===e.type)&&e.alternate&&ie(e.consequent,t,r)&&ie(e.alternate,t,r)}let it=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],ir=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&it(n,o,t)&&n===e},io=new i(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function ia(e){return io.has(e.type)}let ii=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,is=e=>tw(e.parent),il=new i(["String","Null","Boolean","Numeric","RegularExpression"]),iu=new i(["[","(","/","`","+","-","*",",","."]);function ip(e,t,r){if(""===r||r&&!iu.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e,i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);if("Punctuator"===o){if(";"===a)return!1;if("]"===a)return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!il.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let ic=e=>"type"===e.importKind||"type"===e.parent.importKind,id=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],im=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},ig=new i(["Map","ReadonlyMap"]),iy=new i(["Set","ReadonlySet"]),ih=ig.union(iy),ix=e=>new i([e]),ib=e=>ih.has(e)?e:void 0,iE=new i(["ClassName","ImportBinding","TSEnumName","Type"]),iv=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>iE.has(e.type)))return!0;n=n.upper}return!1},iS=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},iC=(e,t)=>{if(nN.has(e.intrinsicName))return;if(e.isUnion())return iS(e.types.map(e=>iC(e,t)));let r=nM(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&ib(n);return o&&ix(o)},iD=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return iD(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?iD(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||iv(e.typeName.name,e,t))return;let r=ib(e.typeName.name);return r&&ix(r)}case"TSUnionType":return iS(e.types.map(e=>iD(e,t)))}},iT=(e,t,r=new i)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=iC(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(iv(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tS(e,{names:["Map","Set"]})&&rF(e.callee,t))return ix(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=eD(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=iD(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=iT(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return iD(e.typeAnnotation,t)??iT(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return iT(e.expression,t,r);case"ConditionalExpression":return iS([iT(e.consequent,t,r),iT(e.alternate,t,r)])}})(e,t,r),iA=(e,t)=>{let r=iT(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(ig.has(e)){n=!0;continue}if(iy.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function iw(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)iw(r,t)}class ik extends Error{name="FixAbortError"}let iI={abort(){throw new ik("Fix aborted.")}};function ij(e){return t=>{let r=e(t,iI),n=[];try{return iw(r,e=>{n.push(e)}),n}catch(e){if(e instanceof ik)return;throw e}}}class iF{#e;#t=new o;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=ij(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:ij(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&iw(t,r)}}}(this.#e,r);return e}}let iB=new i;function iR(e){return iB.has(e)?e:t=>{let r=new iF(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return E.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function iP(e,t){var r;let{visitScriptBlock:n=!0}={},o=iR(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},iB.add(r),r}let iL={"??":4,"||":4,"&&":5},iN={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function i$(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return iL[e.operator];case"BinaryExpression":return iN[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function iM(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let iO=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function iq(e){if(td(e=rP(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=iq(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function iU(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"ArrayExpression":case"FunctionExpression":return!1;case"NewExpression":return!rT(e,t);case"Literal":let r;return!!(td(e)&&(r=e.raw,iO.test(r)));default:return!0}}let iV=new i(["!","typeof","void","delete","~","+","-"]),iW=new i(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function i_(e,t){if(!iV.has(t))throw Error("Unexpected operator");return 16>i$(e)||iW.has(e.type)}function iz(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}function iK(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iG={exports:{}},iJ=iG.exports,iX=iK(function(){return u?iG.exports:(u=1,iG.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),iG.exports)}());function iY(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function iH(e,t){let r=[],n=[],o=()=>n.at(-1),a=new s,u=new s,p=new l;e.on("onCodePathStart",()=>{r.push(new i),n.push(new l)}),e.on("onCodePathEnd",()=>{r.pop(),n.pop()});let c=e=>{r.at(-1).add(e),e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||o().has(e))&&o().add(e)};return e.on("onCodePathSegmentStart",c),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",c),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.onExit("CallExpression",t=>{if(!(e=>{let t=e,{parent:r}=e;for(;r&&!tI(r);){if("TryStatement"===r.type&&r.finalizer&&r.block===t){let t=r.block.body.at(-1);return 1===r.block.body.length&&t?.type==="ExpressionStatement"&&t.expression===e}t=r,{parent:r}=r}return!1})(t)&&ak(t,e))for(let e of r.at(-1))e.reachable&&o().add(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable&&!o().has(e))&&p.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{a.set(e,new i(r.at(-1)))}),e.onExit("IfStatement",e=>{let n=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let o=a.get(r),i=o&&[...n].every(e=>e.prevSegments.every(e=>!o.has(e)))||t?.(r);u.set(r,p.has(e)&&!!i)}}),e=>!!(e&&u.get(e))}function iQ(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let iZ=(e,t)=>iQ(e,t,1),i0=e=>e.charAt(0).toUpperCase()+e.slice(1),i1=e=>e.charAt(0).toLowerCase()+e.slice(1),i2="too-deep",i3="should-parenthesized",i8="prefer-event-target",i6=new i(["@angular/core","eventemitter3"]),i9=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function i5(e){let t;return!!e&&(tM(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(tu(t)&&i6.has(t.value)))}let i4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},i7="prefer-keyboard-event-key",se="prefer-keyboard-event-key/suggestion",st=new i(["keyCode","charCode","which"]),sr=new i(["onKeyDown","onKeyPress","onKeyUp"]),sn=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},so=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tL(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&sr.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))sn(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!ov(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},sa=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,si=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tI(n)&&r.push(...so(e,n));return r},ss=(e,{shouldAutofix:t})=>{let r=(e=>{var t;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let r=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!r||"IfStatement"!==r.type)return;let{type:n,operator:o,right:a}=r.test;if(!("BinaryExpression"===n&&r.test.left===e.parent&&("=="===o||"==="===o)&&td(a)))return;let i=Object.hasOwn(i4,t=a.value)?i4[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:i7,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,t0(r.key))];return t?n.fix=o:n.suggest=[{messageId:se,data:{key:r.key},fix:o}],n},sl=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),su=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},sp="error",sc="suggestion";function*sd(e,t,r){for(let n of to(e,r))yield t.remove(n)}function sm(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=ew(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function sf(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=to(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);ew(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}(t,r),o=t.parent;if(0===o.arguments.indexOf(t)&&o.arguments.length>1&&nt(r,n)){let{sourceCode:o}=r,a=to(t,r).at(-1)||t,[,i]=o.getRange(a),s=o.getTokenAfter(a),[l,u]=o.getRange(s),p=o.text.slice(...n),c=p.slice(i-n[0],l-n[0])+p.slice(u-n[0]);return e.replaceTextRange(n,c)}return e.removeRange(n)}function sg(e,t,r,n){return e.replaceTextRange(ta(t,n),r)}function sy(e,t,r,n){let o=ti(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!iU(r,n):ia(r))||ts(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),ip(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*sh(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);ek(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function sx(e,t,r){let n="object"==typeof e?t.sourceCode.getRange(e)[1]:e,[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*sb(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield sx(n,t,r),rT(e,t)||(yield r.insertTextAfter(e,"()")),o5(n,e.callee,t)||ts(e,t)||(yield sh(r,e.parent,t))}let sE=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*sv(e,t,r){let{sourceCode:n}=r,o=ta(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&sE(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&sE(i)&&(yield e.insertTextBefore(i," "))}function*sS(e,t,r){var n;yield sv(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!ts(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function sC(e,t,r,n){let[,o]=ta(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let sD=(e,t,r)=>sC(e,t,r,"");function*sT(e,t,r){let n=t.callee;yield sD(e,n,r);let[,o]=ta(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function sA(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);ek(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p))if(d+=p.length,0===c){let{text:e}=o;"\r"===e[d]&&"\n"===e[d+1]?d+=2:("\n"===e[d]||"\r"===e[d])&&d++}else c=Math.max(0,c-u.length-1);return r.removeRange([c,d])}function sw(e,t,r,n){if(ii(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&ii(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(ir(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&it(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let sk=(e,t,r,n)=>nB(e).map(e=>sw(e,t,r,n)),sI=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*sj(e,t,r,n,o){for(let t of to(e,o?{sourceCode:o}:n))yield sj(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let sF="require-array-join-separator",sB="no-thenable-object",sR="no-thenable-export",sP="no-thenable-class",sL=(e,t)=>rQ(e,t)?.value,sN=(e,t)=>"then"===sL(e,t),s$=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===sL(r,t):"then"===r.name},sM="no-invalid-remove-event-listener",sO="consistent-function-scoping",sq=(e,t)=>e&&t&&(e===t||e.block===t.block),sU=(e,t)=>e.some(e=>sq(e,t)),sV=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),sW=new i(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),s_=e=>e?.type==="BlockStatement"&&sW.has(e.parent.type)&&e.parent.body===e,sz=new i(["FunctionExpression","ArrowFunctionExpression"]),sK={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tk,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&o9(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tk.includes(t.type)&&tq(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),s_(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&tq(l.block.parent.callee,sV)||l&&(a=s,sz.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||rb(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(sU(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&sU(u,t.scope)})||e.defs.some(e=>sU(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type||t.acquire(e))return!1;let r=t.acquire(e.parent);return!(!r||sq(i,r))&&sU(u,r.upper)}))}(e,n,r))return{node:e,loc:eL(e,r),messageId:sO,data:{functionNameWithKind:eJ(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[sO]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},sG="error",sJ="error-unknown",sX="suggestion";function sY(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield sb(e,t,n)}}let sH="no-console-spaces",sQ=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),sZ=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),s0="no-empty-file",s1={create:e=>{let{allowComments:t}=e.options[0];if(e.filename!==e.physicalFilename)return;let r=e.sourceCode.parserServices?.isYAML;e.on("Program",n=>{if(r){if(n.body.some(e=>(e=>{let{content:t}=e;return null!==t&&("YAMLWithMeta"!==t.type||null!==t.value)})(e)))return;let r=r9(e);return t&&r.length>0&&0===n.tokens.length?void 0:{node:n,messageId:s0}}if(n.templateBody)return;if(1===n.body.length&&"Document"===n.body[0].type){let{children:e}=n.body[0];if(e.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&e.some(e=>"Comment"===e.type))return;return{node:n,messageId:s0}}if(n.body.some(e=>!tD(e,tC)))return;let{sourceCode:o}=e,a=r9(e);if(0!==o.ast.tokens.length||0!==a.length||""===o.text.trim()){if(!a.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&a.length>0&&a.every(e=>"Line"===e.type||"Block"===e.type))||0!==o.ast.tokens.length))return{node:n,messageId:s0}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=r9(e);if(!t||!(n.length>0))return{node:r,messageId:s0}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=r9(e);if(!t||!(n.length>0))return{node:r,messageId:s0}}),e.on("root",e=>{if(!e.children.some(e=>!("html"===e.type&&/^<!--(?:(?!-->)[\s\S])*-->$/.test(e.value.trim())))&&(!t||!(e.children.length>0)))return{node:e,messageId:s0}})},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[s0]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm","yml/yaml"]}},s2="no-useless-fallback-in-spread";function s3(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function s8(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let s6="zero-fraction",s9="dangling-dot",s5="error",s4="suggestion",s7=Symbol.for("default"),le=Symbol("NAMESPACE_SPECIFIER_NAME"),lt=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},lr=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*ln(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?ew:eB),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);ew(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function lo(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let la={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new i,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{tu(e.source)&&o.push(e)}),e.on("Program:exit",function*(a){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:ic(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:s7,text:"default",...n};case"ImportSpecifier":return{name:lt(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:le,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:s7,text:"default",isTypeExport:lr(r)};case"ExportSpecifier":return{node:r,name:lt(r.exported),text:t.getText(r.exported),isTypeExport:lr(r)};case"VariableDeclarator":{let n=r.parent.parent;if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===n.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==le||o.name!==s7)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:t,exports:r}of n)for(let n of function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(r)){let r={node:n.node,messageId:s5,data:{exported:n.text}},i=function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===le)yield n.insertTextAfter(o,`
28
+ export ${l?"type ":""}* as ${r.text} ${lo(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,eB);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
+ export {${s}} ${lo(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield ln(t.node,n,e)),yield ln(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:s4,fix:i}]:r.fix=i,yield r}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[s5]:"Use `export…from` to re-export `{{exported}}`.",[s4]:"Switch to `export…from`."},languages:["js/js"]}},li="prefer-native-coercion-functions",ls=new i(["String","Number","BigInt","Boolean","Symbol"]),ll=new i(["every","filter","find","findLast","findIndex","findLastIndex","some"]),lu=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&ls.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,lp=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},lc=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},lc(e[r],n)):e[r]=n}};class ld{static READ=e7.READ;static CALL=e7.CALL;static CONSTRUCT=e7.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=e7.READ,context:n,filter:o,handle:a}){for(let e of t)lc(this.#n,lp(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new e7(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}let lm="no-document-cookie",lf=new ld({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:lm})}),lg=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],ly=new i(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...lg("AnimationStart"),...lg("AnimationEnd"),...lg("AnimationIteration"),...lg("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),lh="prefer-add-event-listener",lx={create:e=>{let t,r,n=new i(e.options[0].excludedPackages),o=new s;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{o.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tM(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{let n;if(t)return;let{left:a,right:i,operator:s}=r;if("MemberExpression"!==a.type||a.computed)return;let l=a.property.name;if(!l||!l.startsWith("on"))return;let u=l.slice(2);if(!ly.has(u))return;let p="addEventListener",c="";if(tV(i)||tf(i))p="removeEventListener";else"beforeunload"===u&&("ArrowFunctionExpression"!==i.type&&"FunctionExpression"!==i.type||"BlockStatement"!==i.body.type||o.get(i))?c="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.":"message"===u?c="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.":"error"===u?c="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.":"="!==s||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||o6(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);ts(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);ts(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,a));return{node:a.property,messageId:lh,data:{replacement:p,method:l,extra:c?` ${c}`:""},fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[lh]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},lb=new i(["false","true"]),lE=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(ae(e.left,t)||ae(e.right,t)),lv=({type:e,name:t},r)=>"Identifier"===e&&t===r;function lS({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p;if(!tL(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&lE(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&lE(p.body.body[0].argument,p.params[0]))||op(r.callee.object,n))return;let[c]=r.arguments,d="BinaryExpression"===c.body.type?c.body:c.body.body[0].argument,[m]=c.params,{left:f,right:g}=d,{name:y}=m;if(lv(f,y))l=g,u=f;else{if(!lv(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||eD(h,m).references.some(({identifier:e})=>e!==u)||nP(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);ts(l,n)&&!ts(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eZ(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tL(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:l}=i,u=function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(ae(r,t))return r;if("CallExpression"===r.type&&!r.optional&&lv(r.callee,"Boolean")&&1===r.arguments.length&&ae(r.arguments[0],t))return r.arguments[0]}}(n,a);if(!u||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>lb.has(e))}(l.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(l.getTypeAtLocation(r.callee.object),l))return;let p=s.acquire(n);if(!p||eD(p,a).references.some(({identifier:e})=>e!==u)||nP(n,p))return;let c=r.callee.property;return{node:c,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(c,t),yield e.replaceText(n,"true")}}})}}}let lC=lS({method:"findIndex",replacement:"indexOf"}),lD=lS({method:"findLastIndex",replacement:"lastIndexOf"}),lT={create(e){lC.listen(e),lD.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...lC.messages,...lD.messages},languages:["js/js"]}},lA="error",lw="prefer-date",lk="prefer-date-now-over-methods",lI="prefer-date-now-over-number-data-object",lj=e=>tS(e,{name:"Date",argumentsLength:0}),lF=(e,t,r)=>({node:e,messageId:lw,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield sv(t,e,r))},...t}),lB="prefer-dataset",lR="prefer-attributes",lP=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,lL=e=>tR(e,{property:"dataset"}),lN=e=>e.computed||"Identifier"!==e.property.type?e.computed&&tu(e.property)?e.property.value:void 0:e.property.name,l$=new i(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),lM=/[\s\u0000-\u001F"'/<=>]/,lO=e=>l$.has(e)||e.includes("-")||lM.test(e);function lq(e,t){let r=ti(e,t);return!ts(e,t.sourceCode)&&iU(e,t)?`(${r})`:r}let lU={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(lO(n.value)||oE(o.object,e))return;let a=lq(o.object,e),i=o.optional?"?.":".",s=t0(lP(n.value),n.raw.charAt(0)),l=r7(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return ip(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:lR,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&tu(e.left)&&lL(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tL(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&lL(e.arguments[0])&&tu(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tL(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&lL(e.callee.object)&&tu(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&lL(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||oE(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:lR,data:{method:"getAttribute"},fix:function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e);if(!a)return;let i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if("MemberExpression"!==n.type||n.object!==e||n.optional)return;let o=lN(n);if(void 0===o||lO(o))return;let{parent:a}=n;if(nl(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>eD(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!r7(t,o)&&i.every(e=>!r7(t,e))))return;let s=lq(n.object,t);return function*(e){for(let r of(yield sA(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=t0(lP(lN(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e)};let{properties:o}=t.id;if(o.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!tu(e.key)||lO(e.key.value):lO(e.key.name))))return;let a=t.parent,i=lq(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!r7(e,a,[n.object])&&o.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===o.length||"Identifier"===n.object.type)){let t=r8(a,e),n=o.map(e=>{let t=t0(lP(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
30
+ ${t}`)};`)}return{node:n,messageId:lR,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!lL(o)||oE(o.object,e))return;let a=lN(r);if(void 0===a||lO(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(nl(r)&&!s&&!l)return;let u=lq(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=t0(lP(a),c);return s&&is(i)&&!r7(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${ti(i.right,e)})`):l&&tw(i.parent)&&!r7(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return ip(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||r7(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:lR,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tL(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tL(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tL(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&tu(t.arguments[0]))||oE(t.callee.object,e))return;let r=t.callee.property.name,n="ChainExpression"===t.parent.type?t.parent:t;if(("AwaitExpression"!==n.parent.type||n.parent.argument!==n||"getAttribute"!==r)&&t.arguments[0].value.toLowerCase().startsWith("data-"))return{node:t,messageId:lB,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&nu(e.callee)||"setAttribute"===r&&!is(e)||"removeAttribute"===r&&!tw(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!r7(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${lq(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=r6(a)?`.${a}`:`[${t0(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${ti(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${t0(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[lB]:"Prefer `.dataset` over `{{method}}(…)`.",[lR]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},lV="prefer-modern-math-apis",lW=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,l_=(e,t)=>"CallExpression"===e.type&&!e.optional&&lW(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function lz({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(l_(n.left,"log")&&lW(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):l_(n.right,"log")&&lW(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:lV,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${ti(s,o)})`)}}}function lK({constantName:e,replacementMethod:t}){let r={messageId:lV,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&l_(n.left,"log")&&lW(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${ti(a,o)})`)}}}let lG=[lz({constantName:"LOG10E",replacementMethod:"log10"}),lz({constantName:"LOG2E",replacementMethod:"log2"}),lK({constantName:"LN10",replacementMethod:"log10"}),lK({constantName:"LN2",replacementMethod:"log2"})],lJ=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>lJ(e)):[e],lX="number-literal-case",lY=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},lH={create:iP(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(td(t)?o=lY(r,n):tg(t)&&(o=lY(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:lX,fix:e=>e.replaceText(t,o)}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[lX]:"Invalid number literal casing."},languages:["js/js"]}},lQ="error",lZ="suggestion",l0={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},l1=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function l2(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=l1(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:lQ,data:{description:o,property:i}};if("NEGATIVE_INFINITY"===i)return s.node=a,s.data.description="-Infinity",s.fix=function*(e){yield e.replaceText(a,"Number.NEGATIVE_INFINITY"),yield sv(e,a,t)},s;let l=e=>sw(r,`Number.${i}`,t,e);return l0[o]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&oN(n,t)})(r,t)?s.fix=l:s.suggest=[{messageId:lZ,fix:l}],s}let l3={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new ld({objects:Object.keys(l0).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:l2,filter(t){let{node:r,path:n}=t,[o]=n;return!nl(r)&&!("Infinity"===o&&(e=>{if(!l1(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];if(!n)return!0;if("SpreadElement"===n.type)return!1;let o=rH(n,t);return o?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[lQ]:"Prefer `Number.{{property}}` over `{{description}}`.",[lZ]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},l8="prefer-reflect-apply",l6=(e,t)=>(tf(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),l9=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,l5="prefer-set-size";var l4={exports:{}},l7=iK(function(){var e,t,r,n;return p?l4.exports:(p=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[H-r,H],raw:e.substring(H-r,H)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,H-(r.length+n),H)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return Y&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++H-2,H):i("symbol",n,H-1,H)}function u(t,r,n,o,a){return null==o&&(n=H-1,o=H),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&W("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){H+=e=e||1}function f(e){g(e)||W("character",e)}function g(t){var r=t.length;if(e.substring(H,H+r)===t)return m(r),t}function y(t){if(e[H]===t)return H++,t}function h(){return e[H]}function x(t){return e[H]===t}function b(t){return e[H+1]===t}function E(t){var r=e.substring(H).match(t);return r&&(H+=r[0].length),r}function v(){var t,r=[],n=H;for(r.push(S());y("|");)r.push(S());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function S(){for(var t,r,s=[],u=H;r=function(){if(H>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return C("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=T()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,W("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[H-1,H],raw:"."};case"\\":if(m(),!(t=w())){if(!Y&&"c"==h())return i("symbol",92,H-1,H);W("atomEscape")}return t;case"[":return N();case"(":if(n.lookbehind&&(t=C("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r=B();f(">");var o=D("normal",r.range[0]-3);return o.name=r,o}if(n.modifiers&&"(?"===e.substring(H,H+2)&&":"!=e[H+2])return function(){var e,t=H;m(2);var r=E(/^[sim]+/);y("-")&&":"!==h()?(e=E(/^[sim]+/))||W("Invalid flags for modifiers group"):r||W("Invalid flags for modifiers group");var n=(r=r?r[0]:"")+(e=e?e[0]:"");(n.length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(n))&&W("flags cannot be duplicated for modifiers group"),y(":")||W("Invalid flags for modifiers group");var o=D("ignore",t);return o.modifierFlags={enabling:r,disabling:e},o}();return C("(?:","ignore","(","normal");case"]":case"}":if(!Y)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=H,(t=T()||!1)&&(H=s,W("Expected atom")),!Y&&y("{")?u=l("{"):W("Expected atom")),t=T()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&W("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=H],raw:e.substring(u,t)}}function C(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return D(o,a)}function D(t,r){var n,o=v();o||W("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=H],raw:e.substring(r,n)};return"normal"==t&&K&&z++,a}function T(){var e,t,r,n,o=H;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=E(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,H):(n=E(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,H):(n=E(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&W("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&W("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function A(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=H;H++;var i=w(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=H,t.raw=e.substring(t.range[0],H)):H=a}}return t}n||(n={});function w(t){var r,a,i,u,p=H;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=H;if(r=E(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=z&&!t)return u=H-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,H],raw:e.substring(u,H)};if(_.push(p),K?G=!0:k(a,H),m(-n.length),r=E(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=H;return o(r=l(E(/^[89]/)),c-1)}return!!(r=E(/^[0-7]{1,3}/))&&(("0"!==(n=r[0])&&k(a,H),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return L();W("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return L();case"c":if(t){if(!Y&&(i=E(/^c(\d)/)))return s("controlLetter",i[1]+16,i[1],2);else if(!Y&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[H-2,H],raw:e.substring(H-2,H)};case"k":return function(){if(n.namedGroups&&E(/^k<(?=.*?>)/)){var t,r=B();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,H],raw:e.substring(t,H)}}}()||L();case"p":case"P":return a=H,!!(n.unicodePropertyEscape&&Y&&(r=E(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,H],raw:e.substring(a-1,H)}||L();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){Y&&W("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?A(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=E(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=H;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=E(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"x":if(e=E(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(Y))return(!e||e.codePoint>1114111)&&W("Invalid escape sequence",null,t,H),e}return L()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||W("Invalid escape sequence",null,o,H),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[H+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function B(){var t,r=H,n=F(R);for(n||W("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}function R(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/.test(r(e))}function P(e){return R(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function L(){var t,r=h();return Y&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!Y&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(H,H+=1)).charCodeAt(0),t,1):null}function N(){var e,t=H;return g("[^")?(e=$(),f("]"),p(e,!0,t,H)):y("[")?(e=$(),f("]"),p(e,!1,t,H)):null}function $(){var e,t;return x("]")?{kind:"union",body:[]}:X?function(){var e,t=[],r=O(!0);for(t.push(r),e="classRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&W("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((t=M())||W("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||W("classAtom"),n=H;var r,n,o,a,i,s,u=$();return(u||W("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?W("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||W("classAtom"),(o=x("]")?s:e(s))||W("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||W("nonEmptyClassRanges"),{kind:"union",body:e})}function M(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=w(!0))){if(!Y&&"c"==h())return l("\\");W("classEscape")}return A(e,Y);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=H;if(y("\\"))if(g("q{"))return function(){var t,r=H-3,n=[];do n.push(function(){for(var t,r,n=[],o=H;r=q();)n.push(r);return{type:"classString",characters:n,range:[o,t=H],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=H],raw:e.substring(r,t)}}();else if(n=w(!0))r=n;else{if(n=V())return n;W("Invalid escape","\\"+h(),o)}else if(n=U())r=n;else{if(n=N())return n;W("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=q())return c(r,n,o,H);W("Invalid range end",h())}return r}function q(){if(y("\\")){var e,t=H;if(e=V())return e;W("Invalid escape","\\"+h(),t)}return U()}function U(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&W("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function V(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))W("\\B not possible inside of ClassContents","",H-2);else if(e=E(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function W(t,r,n,o){n=null==n?H:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var _=[],z=0,K=!0,G=!1,J=-1!==(t||"").indexOf("u"),X=-1!==(t||"").indexOf("v"),Y=J||X,H=0;if(X&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(J&&X)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Q=v();return(Q.range[1]!==e.length&&W("Could not parse entire input - got stuck","",Q.range[1]),G=G||_.some(function(e){return e<=z}))?(H=0,K=!1,v()):Q}},l4.exports?l4.exports=n:window.regjsparser=n,l4.exports)}());let ue=String.raw`\$&`,ut=new i(String.raw`\^$.*+?()[]{}|/-`),{parse:ur}=l7,un="method",uo="pattern",ua="split-join",ui=new i(["i","y"]),us=new i(["anchor","reference"]),ul=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function uu(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:ul(r);if("null"===t||"octal"===t)return ul(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function up(e){return"value"===e.type?uu(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?uc(e.body):void 0:uu(e.body[0])}function uc(e){let t=[];for(let r of e){let e=up(r);if(void 0===e)return;t.push(e)}return t.join("")}let ud=e=>{let{pattern:t,flags:r}=e.regex;try{return ur(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},um=e=>{let t=0;for(let r of e)t+=uf(r);return t};function uf(e){return us.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?um(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>uf(e))):"quantifier"===e.type?e.min*um(e.body):"group"===e.type&&"ignore"===e.behavior?um(e.body):0}let ug=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>ug(e)),uy=e=>td(e)&&Number.isSafeInteger(e.value)&&e.value>=0,uh=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rj(e.left,t)&&tl(e.right,1)||tl(e.left,1)&&rj(e.right,t)))return t},ux=e=>td(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-ux(e.argument):void 0,ub=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,uE="prefer-string-trim-start-end",uv="no-unreadable-iife",uS="suggestion",uC="throw-new-error",uD=/^(?:[A-Z][\da-z]*)*Error$/,uT="escape-uppercase",uA="escape-lowercase",uw=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,uk=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,uI=({node:e,original:t,regex:r=uw,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?uA:uT,fix:t=>o?o(t,a):t.replaceText(e,a)}},uj="prefer-unicode-code-point-escapes",uF="prefer-unicode-code-point-escapes/add-unicode-flag",uB=String.raw`\u{`,uR=/^[\da-f]$/iv,uP=/^[0-7]$/v,uL=/^[A-Za-z]$/v;function uN(e){return uP.test(e)}function u$(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function uM(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function uO(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!uR.test(e))))return Number.parseInt(n,16)}function uq(e){return e>=55296&&e<=56319}function uU(e){return e>=56320&&e<=57343}function uV(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function uW(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1}={}){let n="",o=0,a=!1;for(let i=0;i<e.length;i++){let s=e[i],l=o>0;if(t&&"["===s&&(!l||r)&&!uM(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!uM(e,i)){o--,n+=s;continue}if("\\"!==s||!u$(e,i)){n+=s;continue}let u=function(e,t,{isRegex:r,isInCharacterClass:n}){return function(e,t){if("x"!==e[t+1])return;let r=uO(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:uV(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=uO(e,t+2,4);if(void 0===o||!n&&(uq(o)||uU(o)))return;let a=t+6;if(r&&uq(o)&&"\\"===e[a]&&u$(e,a)&&"u"===e[a+1]){let t=uO(e,a+2,4);if(uU(t))return{end:a+6,replacement:uV((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:uV(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&uL.test(r))return{end:t+3,replacement:uV(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!uN(e[t+2])||!uN(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&uN(e[o]);)o++;return{end:o,replacement:uV(Number.parseInt(e.slice(t+1,o),8))}}(e,t))}(e,i,{isRegex:t,isInCharacterClass:l});if(!u){n+=s;continue}n+=u.replacement,i=u.end-1,a=!0}return{fixed:n,hasReplacement:a}}function u_(e,t,r){let{fixed:n,hasReplacement:o}=uW(t);if(o)return{node:e,messageId:uj,fix:t=>r?r(t,n):t.replaceText(e,n)}}function uz(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let uK=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],uG=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],uJ="missing-message",uX="message-is-empty-string",uY="message-is-not-a-string",uH=new o([["AggregateError",1],["SuppressedError",2]]),uQ=e=>"instanceof"===e.value&&"Keyword"===e.type,uZ="no-instanceof-builtins",u0="switch-to-type-of",u1=new i(["String","Number","Boolean","BigInt","Symbol"]),u2=new i(["global","globalThis","self","window"]),u3=[...uG,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...nL,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],u8=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=nF(t,e),s=i.getTokenAfter(o,uQ),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield sv(n,e,t);let c=ta(o,{sourceCode:i});!ts(o,t)&&i_(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=ta(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},u6=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,u9={create:iP(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new i("strict"===r?[...u3,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:i}=r;if("instanceof"!==i)return;let s="Identifier"===n.type?{name:n.name,referenceText:n.name}:"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.property.type&&"Identifier"===n.object.type&&u2.has(n.object.name)&&rF(n.object,e)?{name:n.property.name,referenceText:e.sourceCode.getText(n)}:void 0;if(!s||o.includes(s.name))return;let{name:l,referenceText:u}=s,p={node:r,messageId:uZ};if("Array"===l||"Error"===l&&t){let t="Array"===l?"isArray":"isError",n=`${u}.${t}`;return p.fix=function*(t){let{left:o,right:a}=r,i=nF(e,r),s=i.getTokenAfter(o,uQ);yield sv(t,r,e);let l=ta(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield sj(s,"",t,e,i),yield sj(a,"",t,e,i)},p}return"Function"===l?(u6(n,e)||(p.fix=u8(r,e,l)),p):u1.has(l)?(u6(n,e)||(p.suggest=[{messageId:u0,data:{type:l.toLowerCase()},fix:u8(r,e,l)}]),p):a.has(l)?p:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[uZ]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[u0]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},u5="prefer-type-error",u4=new i(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),u7=new i(["isNaN","isFinite"]),pe=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&u4.has(e.name)||!1===r&&u7.has(e.name)),pt=(e,t)=>!!pe(e.property,t,!0)||"MemberExpression"===e.object.type&&pt(e.object,t),pr=/^(?:[A-Z][\da-z]*)*Error$/,pn=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,po=(e,t)=>{switch(e.type){case"Identifier":return pe(e,t,!1);case"MemberExpression":return pt(e,t);case"CallExpression":return po(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&po(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?pr.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&pr.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(pn(r)&&tl(n,"undefined")||pn(n)&&tl(r,"undefined"))})(e))return!1;return po(n,t)||po(o,t)}case"LogicalExpression":return po(e.left,t)&&po(e.right,t);default:return!1}},pa="consistentDestructuring",pi="consistentDestructuringSuggest",ps=new i(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),pl=e=>{for(;e.parent;)if(e=e.parent,ps.has(e.type))return e},pu=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,pp=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=eD(n.getScope(o.value),o.value);if(e&&eD(r,o.value)===e)return o}},pc=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{if(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=rP(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?eD(r,l):void 0,c="ThisExpression"===l.type?pl(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))return!1;for(var l=r,u=e.scope;l;){if(l===u)return!0;l=l.upper}return!1},pd=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&tu(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(pd(e.left,t,r)||pd(e.right,t,r)),pm=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&pd(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&pd(e.left,r,n);default:return!1}},pf=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),pg=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...uG,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...nL],py=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],ph="error-date",px="suggestion-date";function pb(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let pE=new ld({objects:["BigInt","Boolean","Number","String","Symbol"],type:ld.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>sb(r,t,e)),o}}),pv=new ld({objects:pg,type:ld.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||nu(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield sv(e,r,t)}let e={node:r,messageId:ph};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:px,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>sS(r,t,e)}}}),pS=new ld({objects:py,type:ld.CALL,handle:pb}),pC=new ld({objects:py,type:ld.CONSTRUCT,handle:pb}),pD="error/array-push",pT="suggestion",pA=e=>tR(e,{property:"classList",computed:!1}),pw=e=>e.arguments.some(e=>"SpreadElement"===e.type),pk=[{description:"Array#push()",test:e=>tL(e,{method:"push",optionalCall:!1}),checkArrayReceiver:!0,ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>tL(e,{method:"unshift",optionalCall:!1}),checkArrayReceiver:!0,keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>tL(e,{method:"add",optionalCall:!1,optionalMember:!1})&&pA(e.callee.object)},{description:"Element#classList.remove()",test:e=>tL(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&pA(e.callee.object)},{description:"importScripts()",test:e=>tv(e,{name:"importScripts"},tx)}],pI={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1,checkArrayReceiver:l=!1}of pk){if(!a(n))continue;let u=function(e,{test:t,ignoredCallee:r,checkArrayReceiver:n},o){let a;if(tq(e.callee,r))return;let i=("ChainExpression"===(a=e.parent).type&&e===a.expression&&(a=a.parent),"ExpressionStatement"===a.type?a:void 0);if(!i)return;let s=iQ(i,o,-1);if(s?.type!=="ExpressionStatement")return;let l=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(s);if(!(!t(l)||!rj(l.callee,e.callee)||n&&op(e.callee.object,o)))return{firstCall:l,firstExpressionStatement:s,secondExpressionStatement:i}}(n,{test:a,ignoredCallee:[...i,...t],checkArrayReceiver:l},e);if(!u)continue;let{firstCall:p,firstExpressionStatement:c,secondExpressionStatement:d}=u,{shouldKeepSecondCall:m,shouldPrependSourceArguments:f,targetCall:g,sourceCall:y}=function(e,t,r){let n=r&&(!nu(t.callee)||nu(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(p,n,s),h=y.arguments,x=r.getRange(c),b=r.getRange(d),E=m?[x[0],b[0]]:[x[1],b[1]],v=!m&&!ek(r.getLastToken(c))&&ek(r.getLastToken(d)),S=m&&ip(r.getTokenBefore(c),e,r.text.slice(b[0],b[0]+1)),C={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:pD,data:{description:o}},D=function*(t){if(h.length>0){let r=rw(e,y,!f),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rA(g,e);f?yield t.insertTextAfter(n,g.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,g.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(E,v||S?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,E)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(pw(e)||pw(t))||r&&o.some(e=>void 0===rH(e,n))||o.some(e=>eZ(e,n.sourceCode))}(p,n,s,e)?C.suggest=[{messageId:pT,fix:D}]:C.fix=D),yield C}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[pD]:"Do not call `{{description}}` multiple times.",[pT]:"Merge with previous one."},languages:["js/js"]}},pj="no-process-exit",pF=e=>tl(e,"node:worker_threads")||tl(e,"worker_threads"),pB="no-single-promise-in-promise-methods/error",pR="no-single-promise-in-promise-methods/unwrap",pP="no-single-promise-in-promise-methods/use-promise-resolve",pL=["all","any","race"],pN=(e,t)=>{let[r]=e.arguments[0].elements,n=ti(r,t);return!ts(r,t)&&16>i$(r)&&(n=`(${n})`),n},p$=(e,t)=>e.getCommentsInside(t).length>0,pM=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",pO="no-static-only-class",pq=({type:e,value:t})=>"Punctuator"===e&&"="===t,pU=e=>"PropertyDefinition"===e.type,pV="ignored-elements",pW="property-assignment",p_={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:pV},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s;"AssignmentPattern"!==r.type&&(i.fix=function*(i){let s=o.indexOf(r),l="RestElement"===r.type,u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!ts(c,e)&&iU(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield sv(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rR(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t)return e(r);if("Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type)return r.parent;if("ObjectPattern"===r.type||"ArrayPattern"===r.type)return r}}(e)?.type==="ArrayPattern")return{node:e,messageId:pW}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[pV]:"Array destructuring may not contain consecutive ignored values.",[pW]:"Do not assign destructured values to object properties."},languages:["js/js"]}},pz="spread-in-list",pK="iterable-to-array",pG="iterable-to-array-in-for-of",pJ="iterable-to-array-in-yield-star",pX="spread-in-collection-constructor",pY="spread-in-object-assign",pH="clone-array",pQ="suggestion/remove-object-assign-spread",pZ=["Map","WeakMap","Set","WeakSet"],p0=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],p1=[...p0,"filter","flatMap","map"],p2=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",p3={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*p8(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o),yield e.remove(a);let[s,l]=n.getLastTokens(t,2);yield e.remove(l),ew(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||o5(o,i,r)||ts(t,r)?yield sv(e,t,r):yield sh(e,u,r)}let p6=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&oi(e.callee.object,t),p9="no-useless-switch-case/error",p5="no-useless-switch-case/suggestion",p4=e=>e.consequent.every(e=>tD(e)),p7=e=>tV(e.test)||tf(e.test),ce=new i(["CallExpression","MemberExpression"]),ct=new i(["Identifier","MemberExpression","Super","ThisExpression"]),cr=e=>"MemberExpression"===(e=rP(e)).type?{...e,object:cr(e.object),property:e.computed?cr(e.property):e.property}:e,cn=(e,t)=>rj(cr(e),cr(t)),co=e=>ct.has(rP(e).type),ca=(e,t)=>tR(e=rP(e),{property:"length",optional:!1,computed:!1})&&cn(e.object,t),ci=e=>!!("ChainExpression"===e.type||ce.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&ci(e)):t.type&&ci(t))),cs="no-useless-undefined",cl="no-useless-undefined/suggestion",cu=new i(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),cp=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},cc={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},cd={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},cm={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},cf={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},cg=new i(["<","<=",">",">="]);function cy(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function ch(e,t){var r;return ca(e,t)?"length":"BinaryExpression"===(r=rP(r=e)).type&&"-"===r.operator&&1===iq(r.right)&&ca(r.left,t)?"lengthMinusOne":void 0}function cx(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let cb={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=cp(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:cs,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tV(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=cp(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>sj(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>sj(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>sj(o," {}",t,e),!0);if("VariableDeclarator"===a.type&&a.init===o&&"VariableDeclaration"===a.parent.type&&"const"!==a.parent.kind&&a.parent.declarations.includes(a)){let[,e]=t.getRange(a.id),[,n]=t.getRange(o);return r(o,t=>t.removeRange([e,n]))}if("AssignmentPattern"===a.type&&a.right===o)return r(o,function*(r){let{left:n}=a,[,i]=t.getRange(n),[,s]=t.getRange(o);yield r.removeRange([i,s]),(n.typeAnnotation||nI(e.physicalFilename))&&!n.optional&&tI(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tV(r.consequent);if(n===tV(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tR(e=rP(e),{computed:!0,optional:!1})||ci(e)||eZ(e.object,t,{considerGetters:!0})||eZ(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rP(e)).type&&"-"===e.operator){let t=iq(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=rP(e)).type||!cg.has(e.operator)||ci(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=iq(n),i=iq(o);return Number.isSafeInteger(i)&&cn(n,t.node)?cy(cc,r,i,t.offset):Number.isSafeInteger(a)&&cn(o,t.node)?cy(cd,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=ch(o,t.node.object);if(a&&cn(n,t.index.node))return cx(cm,r,a);let i=ch(n,t.node.object);if(i&&cn(o,t.index.node))return cx(cf,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:cs};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:cl,fix(n){let a=t.getText(o),i=ip(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||nI(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tV(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),cu.has(n)||"push"===n||"unshift"===n||"includes"===n||"add"===n||"has"===n||"delete"===n||"set"===n||"createContext"===n||/^set[A-Z]/v.test(n)||"useRef"===n||"ref"===n))&&(!(!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name)||1===o.length))return{node:a,messageId:cs,fix:t=>sf(t,a,e)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[cs]:"Do not use useless `undefined`.",[cl]:"Use the indexed access directly."},languages:["js/js"]}},cE="numeric-separators-style";function cv(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let cS={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},cC={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}};e.on("Literal",e=>{let t,r;if(!(td(e)||tg(e))||td(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";tg(e)&&(o=n.slice(0,-1),a="n");let s=o.replaceAll("_",""),{prefix:l,data:u}=(t="",r=s,/^0[box]/i.test(s)&&(t=s.slice(0,2),r=s.slice(2)),{prefix:t,data:r}),{onlyIfContainsSeparator:p}=i[l.toLowerCase()];if(p&&!n.includes("_"))return;let c=function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+cv(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return cv(r,t)+n+cv(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+cv(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:cE,fix:t=>t.replaceText(e,c)}})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(cS).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:cS.binary,octal:cS.octal,hexadecimal:cS.hexadecimal,number:cS.number}],messages:{[cE]:"Invalid group length in numeric value."},languages:["js/js"]}},cD="error-zero-index",cT="error-shift",cA="error-pop",cw="error-at-zero",ck="error-at-minus-one",cI="error-slice-minus-one",cj="error-destructuring-declaration",cF="error-destructuring-assignment",cB="error-variable",cR="suggest-nullish-coalescing-operator",cP="suggest-logical-or-operator",cL=(e,t,r)=>tL(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!os(e.callee.object,t),cN=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,c$=(e,t)=>tL(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&cN(e.arguments[0])&&cL(e.callee.object,t),cM=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*cO(e,t,r){let{left:n}=cM(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||e0(e,t))return!1;let{left:r}=cM(e),[n]=r.elements,{type:o}="AssignmentPattern"===n.type?n.left:n;return"ObjectExpression"===o||"ObjectPattern"===o})(e,t)&&(yield r.insertTextBefore(e,"("),yield r.insertTextAfter(e,")"))}let cq=e=>"AssignmentPattern"===cM(e).left.elements[0].type,cU=(e,t)=>{let r,n,{property:o}=cM(t).right.callee;return cq(t)?r=[{operator:"??",messageId:cR},{operator:"||",messageId:cP}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=cM(e),[i]=o.elements,s=i.right,l=t.getText(s);return(e0(s,t)||"LogicalExpression"===s.type&&(s.operator===n||"||"===n&&"??"===s.operator||"??"===n&&("||"===s.operator||"&&"===s.operator))||"ConditionalExpression"===s.type||"AssignmentExpression"===s.type||"YieldExpression"===s.type||"SequenceExpression"===s.type)&&(l=`(${l})`),r.insertTextAfter(a,` ${n} ${l}`)})(t,e,r,n),yield cO(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield cO(t,e,r)},{fix:n,suggest:r}},cV=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,cW=e=>{let{left:t,right:r}=cM(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},c_={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(!(!(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&cL(t.object,e))||nl(t)))return{node:t.object.callee.property,messageId:cD,fix:r=>[r.replaceText(t.object.callee.property,"find"),sD(r,t,e)]}}),e.on("CallExpression",t=>{if(tL(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&cL(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:cT,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...sT(r,t,e)]}}),e.on("VariableDeclarator",r=>{if("ArrayPattern"===r.id.type&&1===r.id.elements.length&&r.id.elements[0]&&"RestElement"!==r.id.elements[0].type&&cL(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:cj,...cU(t,r)}}),e.on("AssignmentExpression",r=>{if("ArrayPattern"===r.left.type&&1===r.left.elements.length&&r.left.elements[0]&&"RestElement"!==r.left.elements[0].type&&cL(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:cF,...cU(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&cL(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=eD(n,r.id),a=nB(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(cV(e))i.push(e.parent);else{if(!cW(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:cB};return s.every(e=>!cq(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=iX.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=rD(l,rx(n));yield sk(o,r,e,a),yield function*(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}(a,t.getRange(t.ast))}for(let t of i)yield sD(a,t,e);for(let e of s)yield cO(e,t,a)}),l}),e.on("CallExpression",t=>{if(tL(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&cL(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:cw,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...sT(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tL(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&cL(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:cA,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...sT(r,t,e)]}}),e.on("CallExpression",t=>{if(tL(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&cN(t.arguments[0])&&cL(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:ck,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...sT(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nl(r)&&c$(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:cI,*fix(o,{abort:a}){if(nt(e,[ta(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield sT(o,r.object,e),yield sD(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tL(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&c$(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:cI,*fix(o,{abort:a}){if(nt(e,[ta(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield sT(o,r.callee.object,e),yield sT(o,r,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[cB]:"Prefer `.find(…)` over `.filter(…)`.",[cD]:"Prefer `.find(…)` over `.filter(…)[0]`.",[cw]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[cT]:"Prefer `.find(…)` over `.filter(…).shift()`.",[cA]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[ck]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[cI]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[cj]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[cF]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[cR]:"Replace `.filter(…)` with `.find(…) ?? …`.",[cP]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},cz="prefer-array-flat-map",cK="prefer-array-flat-map/filter-flat-map",cG="prefer-array-flat-map/filter-flat-map-suggestion",cJ=["React.Children","Children"],cX=new i(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),cY=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,cH="prefer-array-flat",cQ={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tL(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&ae(r.params[0],r.body)&&!c8(e.callee.object,t)}},cZ={testFunction(e,t){if(!tL(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[r,n]=e.arguments;if(!("ArrowFunctionExpression"===r.type&&!r.async&&2===r.params.length&&tT(n)))return!1;let o=r.body,[a,i]=r.params;return!!(tL(o,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&ae(a,o.callee.object)&&ae(i,o.arguments[0])||"ArrayExpression"===o.type&&2===o.elements.length&&o.elements.every((e,t)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&ae(r.params[t],e.argument)))&&!oi(e.callee.object,t)},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},c0={testFunction:e=>tL(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tT(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},c1={testFunction(e){if(!(tL(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tW(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return tT(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},c2=["_.flatten","lodash.flatten","underscore.flatten"],c3=/^\p{Uppercase_Letter}/u,c8=(e,t)=>{let r,n;return"Identifier"===e.type&&c3.test(e.name)&&(!(r=ni(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=ni(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},c6={create:function(e){let{functions:t}=e.options[0],r=[...t,...c2],n=[cQ,cZ,c0,c1,{testFunction:e=>tv(e,{argumentsLength:1,optional:!1},tx)&&tq(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tO(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,shouldSwitchToArray:i,isOptionalArray:s}of n){if(!r(t,e))continue;let n=a(t),l=s?.(t),u={description:"string"==typeof o?o:o(t)},p={node:t,messageId:cH,data:u},{sourceCode:c}=e;c.getCommentsInside(t).length===c.getCommentsInside(n).length&&(p.fix=function(e,t,r,n,o){return"function"==typeof n&&(n=n(e)),function*(a){let{sourceCode:i}=r,s=ti(t,r);n?s=`[${s}]`:!ts(t,i)&&iU(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,ip(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield sv(a,e,r)}}(t,n,e,i,l)),yield p}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[cH]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},c9="some",c5="some-suggestion",c4="filter",c7={create:iP(e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||os(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tV(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&tf(t.parent.right));if(!r&&!(tX(t,e)||tY(t)||function(e,t){if(!oa(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type&&r.parent.parent.declaration===r.parent)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(!n||1!==n.identifiers.length||n.identifiers[0]!==r.id)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tX(r,t)||tY(r))})}(t,e)))return;let n=t.callee.property,o=r&&nt(e,[ta(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:c9,data:{method:n.name},suggest:o?void 0:[{messageId:c5,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=ta(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(tL(r,{methods:["findIndex","findLastIndex"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&tl(n,0)))||os(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:c9,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[u]=s.getRange(l),[,p]=s.getRange(t);if(nt(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tR(t.left,{property:"length",optional:!1})&&tL(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if("Identifier"===n.type&&n.name.startsWith("$")||os(n,e))return;let[o]=r.arguments;if(!o||o6(o))return;let a=r.callee.property;return{node:a,messageId:c4,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(nt(e,[ta(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield sD(n,s,e),yield n.removeRange([ta(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[c9]:"Prefer `.some(…)` over `.{{method}}(…)`.",[c5]:"Replace `.{{method}}(…)` with `.some(…)`.",[c4]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},de="preferDefaultParameters",dt="preferDefaultParametersSuggest",dr=new i(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),dn=(e,t)=>{if(!t)return!1;if(dr.has(t.type))return!0;for(let r of e.visitorKeys[t.type]){let n=t[r];if(Array.isArray(n)){for(let t of n)if(dn(e,t))return!0}else if(dn(e,n))return!0}return!1},da="prefer-logical-operator-over-ternary/error",di="prefer-logical-operator-over-ternary/optional-chain-error",ds="prefer-logical-operator-over-ternary/suggestion",dl="prefer-logical-operator-over-ternary/optional-chain-suggestion",du=new i(["==","==="]),dp=new i(["!=","!=="]);function dc(e,t,r){if(rj(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return dc(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&dc(e.left,t.left,r)&&dc(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&dc(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function dd({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:da}:{node:t,messageId:da,suggest:o.map(o=>({messageId:ds,data:{operator:o},fix:a=>(function({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a}){let{sourceCode:i}=t,s=[n,o].map((e,r)=>{let n=ts(e,t),o=n?ti(e,t):i.getText(e);return!n&&iz(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return ip(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function dm(e){return tf(e)?"null":tV(e)?"undefined":void 0}function df(e){if("BinaryExpression"!==e.type||!du.has(e.operator)&&!dp.has(e.operator))return;let t=dm(e.left),r=dm(e.right);if(!!t==!!r)return;let n=du.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let dg=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,dy="with-name",dh="without-name",dx="regexp-exec",db="string-match",dE="string-search",dv="suggestion",dS="string",dC="regexp",dD="other",dT="string-or-other",dA="regexp-or-other",dw="unknown";function*dk(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);e0(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!e0(t,a)&&iU(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let dI=[{type:dx,test:e=>tL(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:db,test:e=>tL(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:dk},{type:dE,test:e=>tL(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:dk}],dj=e=>{if(e.includes(dw))return dw;let t=new i(e),r=t.has(dS)||t.has(dT),n=t.has(dC)||t.has(dA);if(r&&n)return dT;let o=t.has(dD)||t.has(dT)||t.has(dA);return r?o?dT:dS:n?o?dA:dC:dD},dF=e=>{let t=new i(e);return t.has(dw)?dw:t.has(dC)?dC:t.has(dS)?dS:dD},dB=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),dR=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return dR(e.typeAnnotation);case"TSStringKeyword":return dS;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?dS:dD;case"TSTypeReference":if("Identifier"!==e.typeName.type)return dw;if("String"===e.typeName.name)return dS;if("RegExp"===e.typeName.name)return dC;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return dD;return dw;case"TSUnionType":return dj(e.types.map(e=>dR(e)));case"TSIntersectionType":return dF(e.types.map(e=>dR(e)));default:return dB.has(e?.type)?dD:dw}},dP=(e,t)=>{let r,n;if(r=e,nN.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),nN.has(n.intrinsicName)))return dw;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?dP(r,t):dw}return e.isUnion()?dj(e.types.map(e=>dP(e,t))):e.isIntersection()?dF(e.types.map(e=>dP(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?dS:"RegExp"===nM(e)?.getName()||nq(e,t).some(e=>dP(e,t)===dC)?dC:dD},dL=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function dN(e,t,r=new i){if(tm(e)||tS(e,{name:"RegExp"}))return dC;if(ok(e,t))return dS;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=eD(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return dw;r.add(o);let[a]=o.defs,i=dR(a.name?.typeAnnotation),s=dw;return i!==dw?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=dN(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==dw)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=dR(e.typeAnnotation);return n===dw?dN(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return dN(e.expression,t,r);case"SequenceExpression":return dN(e.expressions.at(-1),t,r);case"ConditionalExpression":return dj([dN(e.consequent,t,r),dN(e.alternate,t,r)])}let n=((e,t)=>{let r,n=rH(e,t);if(!n&&rX(e,t)){let r=ez(e,t.sourceCode.getScope(e));return r&&void 0!==r.value?dD:dw}return n?"string"==typeof n.value?dS:(r=n.value,"[object RegExp]"===Object.prototype.toString.call(r))?dC:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?dD:dw:dw})(e,t);return n!==dw?n:dL.has(e.type)?dD:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return dw;try{let{program:t}=r;return dP(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return dw}})(e,t)}let d$=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(t_(e.parent)||tJ(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},dM=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),dO=(e,t,r)=>[ta(t,r)[1],r.sourceCode.getRange(e.node)[1]],dq=e=>[{messageId:dv,fix:e}],dU=e=>[dC,dA,dD].includes(e),dV=e=>[dS,dT,dD].includes(e),dW=({type:e,stringType:t,regexpType:r})=>e===dx?dV(r)||dU(t):dU(t)||dV(r),d_=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[ta(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([ta(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!dM(r.sourceCode,e))&&(e.suggest=dq(t));return}if(!o||!dM(r.sourceCode,dO(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=dq(t)}},dz={create:iP(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tR(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(d$(o,t))return;if(tX(o,t)||tY(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&tl(a.right,0)&&!d$(a,t)&&(tX(a,t)||tY(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tN(n)||">="===r&&tl(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tN(n)||"<"===r&&tl(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tX(t,e)||tY(t))for(let{type:o,test:a,getNodes:i,fix:s}of dI){if(o===dE!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=rW(p,e),d=tm(p)?!p.regex.flags.includes("g")&&!p.regex.flags.includes("y"):!!(c&&!c.global&&!c.sticky);if(dW({type:o,stringType:dN(l.stringNode,e),regexpType:dN(p,e)}))continue;let m={node:o===dx?u:t,messageId:o};d_(m,function*(o){for(let a of(r?(yield sD(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([ta(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(dO(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:d,staticRegExp:c}),yield m}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[dx]:"Prefer `.test(…)` over `.exec(…)`.",[db]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[dE]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[dv]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},dK="error",dG="suggestion",dJ=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],dX=["slice","concat"],dY=e=>tL(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.parent.callee.object===e,dH=new i(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),dQ=(e,t,r=new i)=>"ArrayExpression"===e.type||tv(e,{name:"Array",optional:!1},tE)||tL(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tL(e,{methods:dJ,optionalCall:!1,optionalMember:!1})||tL(e,{methods:dX,optionalCall:!1,optionalMember:!1})&&void 0===tc(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new i)=>{if("Identifier"!==e.type)return!1;let n=eD(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs;return"Variable"===o.type&&"const"===o.kind&&!!o.node.init&&dQ(o.node.init,t,r)})(e.callee.object,t,r)),dZ=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,d0=e=>e.some(e=>e?.type==="SpreadElement"),d1=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),d2=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,d3=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t,r=e;for(;d2(r.parent,r);)r=r.parent;return nl(r)||("ForInStatement"===(t=r).parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},d8=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||tL(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},d6={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&dQ(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let r=(i=a.init,s=e,"ArrayExpression"===i.type?d0(i.elements)?void 0:i.elements.length:tv(i,{name:"Array",optional:!1},tE)?((e,t)=>{if(d0(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=rH(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:dZ(n)?n:void 0})(i,s):tL(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?d0(i.arguments)?void 0:i.arguments.length:tL(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(r&&"SpreadElement"!==r.type){if("ArrayExpression"===r.type)return d0(r.elements)?void 0:r.elements.length;if(void 0!==tc(r)){let e=rH(r,t);return"string"==typeof e?.value?[...e.value].length:void 0}return((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=rH(r.value,t);return dZ(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===r||r<t)return}let l=eD(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(dY(o)){t.push(o);continue}if(d3(o)){r.push(o),n.push(o);continue}if(d8(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(nB(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!d0(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=rH(t,e))&&rZ(r.value)&&!Object.is(r.value,-0)}))||0!==r3(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(dH.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:dK,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(d1(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(d1(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!d1(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:dG,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[dK]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[dG]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},d9=e=>tL(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tv(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},tx),d5="prefer-string-raw",d4="unnecessary-string-raw";function d7(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let me="prefer-switch",mt=(e,t)=>e===t||rj(e,t),mr=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tV(e))),mn=new i(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),mo=e=>{for(;e.parent;e=e.parent)if(mn.has(e.type))return e},ma=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},mi={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new i,o=[],a=new i;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||o.push(e)}),e.on("Program:exit",function*(){for(let i of n){if(a.has(i))continue;let{discriminant:n,ifStatements:s}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=mr(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>mt(e,r)||mt(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(i);if(!n||s.length<t.minimumCases)continue;for(let{statement:e}of s)a.add(e);let l={loc:{start:r.getLoc(i).start,end:r.getLoc(i.consequent).start},messageId:me};!eZ(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!ma(n,t,r))continue;let e=mo(n);if(!e||ma(t,e,r))return!0}return!1}(o,t,e))&&(l.fix=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:o}=r,a=o.getText(e);return function*(i){let s=t[0].statement,l=r8(s,r);yield i.insertTextBefore(s,`switch (${a}) {`);let u=t.at(-1).statement;if(u.alternate){let{alternate:e}=u;yield i.insertTextBefore(e,`
31
31
  ${l}default: `)}else switch(n.emptyDefaultCase){case"no-default-comment":yield i.insertTextAfter(s,`
32
32
  ${l}// No default`);break;case"do-nothing-comment":yield i.insertTextAfter(s,`
33
33
  ${l}default:
34
34
  ${l}// Do nothing`)}for(let{statement:r,compareExpressions:n}of(yield i.insertTextAfter(s,`
35
- ${l}}`),t)){let{consequent:t,alternate:a}=r;if(a){let[,e]=o.getRange(t),[r]=o.getRange(a);yield i.removeRange([e,r])}let s=[o.getRange(r)[0],o.getRange(t)[0]];for(let{left:r,right:a}of(yield i.removeRange(s),n)){let n=dI(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
35
+ ${l}}`),t)){let{consequent:t,alternate:a}=r;if(a){let[,e]=o.getRange(t),[r]=o.getRange(a);yield i.removeRange([e,r])}let s=[o.getRange(r)[0],o.getRange(t)[0]];for(let{left:r,right:a}of(yield i.removeRange(s),n)){let n=mt(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
36
36
  ${l}case ${s}: `)}(function e(t){switch(t.type){case"ReturnStatement":case"ThrowStatement":return!1;case"IfStatement":return!t.alternate||e(t.consequent)||e(t.alternate);case"BlockStatement":{let r=function e(t){let{body:r}=t;for(let t=r.length-1;t>=0;t--){let n=r[t];if("FunctionDeclaration"!==n.type&&"EmptyStatement"!==n.type){if("BlockStatement"===n.type){let t=e(n);if(t)return t;continue}return n}}}(t);return!r||e(r)}default:return!0}})(t)&&(yield function*(e,t,r,n){if("BlockStatement"===e.type){let o=r.getLastToken(e);yield t.insertTextBefore(o,`
37
37
  ${n}break;
38
38
  ${n}`)}else yield t.insertTextAfter(e,`
39
39
  ${n}break;`)}(t,i,o,l),yield function*(e,t,r){e&&"BlockStatement"!==e.type&&(yield t.insertTextBefore(e,`{
40
40
  ${r}`),yield t.insertTextAfter(e,`
41
- ${r}}`))}(t,i,l))}}}({discriminant:n,ifStatements:s},e,t)),yield l}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[dk]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},dL="require-number-to-fixed-digits-argument";function dN(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||1/0===r?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}function d$(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}let dM=/^(?:( )+|\t+)/,dO="space";function dq(e,t){let r,n,a=new o,i=0;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(dM);if(null===e)i=0,r="";else{let o=e[0].length,s=e[1]?dO:"tab";if(t&&s===dO&&1===o)continue;s!==r&&(i=0),r=s;let l=1,u=0,p=o-i;if(i=o,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===dO&&1===e)continue;n=(s===dO?"s":"t")+String(e)}let c=a.get(n);a.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return a}function dU(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=dq(e,!0);0===r.size&&(r=dq(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?dO:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===dO?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let dW="template-indent",dV=(e,t=new i)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),d_=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string"},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],dz="no-await-in-promise-methods/error",dK="no-await-in-promise-methods/suggestion",dG=["all","allSettled","any","race"],dJ="no-negation-in-equality-check/error",dX="no-negation-in-equality-check/suggestion",dY=new i(["===","!==","==","!="]),dH=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function dQ(e,{methods:t,messageId:r,checkArrayReceiver:n=!1}){e.on("CallExpression",o=>{if(!tR(o,{methods:t,argumentsLength:2,optionalCall:!1}))return;let a=o.arguments[1],i=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tF(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tF(e,{property:"length",computed:!1})&&rk(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(a,o.callee.object);if(!i||n&&nL(o.callee.object,e))return;let s=o.callee.property.name,l={description:i};return"splice"===s?l.argumentName="deleteCount":"toSpliced"===s&&(l.argumentName="skipCount"),{node:a,messageId:r,data:l,fix:t=>iq(t,a,e)}})}let dZ="no-unnecessary-slice-end",d0="catch-error-name",d1=[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Patterns to ignore."}}}],d2="invalidExport",d3="doNotPassMessageToSuper",d8="doNotAssignMessageWithoutSetter",d6="missingOptionsParameter",d9="invalidOptionsParameter",d5="passMessageToSuper",d4="passOptionsToSuper",d7=/^(?:[A-Z][\da-z]*)*Error$/,me=e=>`
41
+ ${r}}`))}(t,i,l))}}}({discriminant:n,ifStatements:s},e,t)),yield l}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[me]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},ms="require-number-to-fixed-digits-argument";function ml(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||1/0===r?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}function mu(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}let mp=/^(?:( )+|\t+)/,mc="space";function md(e,t){let r,n,a=new o,i=0;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(mp);if(null===e)i=0,r="";else{let o=e[0].length,s=e[1]?mc:"tab";if(t&&s===mc&&1===o)continue;s!==r&&(i=0),r=s;let l=1,u=0,p=o-i;if(i=o,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===mc&&1===e)continue;n=(s===mc?"s":"t")+String(e)}let c=a.get(n);a.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return a}function mm(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=md(e,!0);0===r.size&&(r=md(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?mc:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===mc?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let mf="template-indent",mg=(e,t=new i)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),my=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string"},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],mh="no-await-in-promise-methods/error",mx="no-await-in-promise-methods/suggestion",mb=["all","allSettled","any","race"],mE="no-negation-in-equality-check/error",mv="no-negation-in-equality-check/suggestion",mS=new i(["===","!==","==","!="]),mC=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function mD(e,{methods:t,messageId:r,checkArrayReceiver:n=!1}){e.on("CallExpression",o=>{if(!tL(o,{methods:t,argumentsLength:2,optionalCall:!1}))return;let a=o.arguments[1],i=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tR(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tR(e,{property:"length",computed:!1})&&rj(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(a,o.callee.object);if(!i||n&&op(o.callee.object,e))return;let s=o.callee.property.name,l={description:i};return"splice"===s?l.argumentName="deleteCount":"toSpliced"===s&&(l.argumentName="skipCount"),{node:a,messageId:r,data:l,fix:t=>sf(t,a,e)}})}let mT="no-unnecessary-slice-end",mA="catch-error-name",mw=[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Patterns to ignore."}}}],mk="invalidExport",mI="doNotPassMessageToSuper",mj="doNotAssignMessageWithoutSetter",mF="missingOptionsParameter",mB="invalidOptionsParameter",mR="passMessageToSuper",mP="passOptionsToSuper",mL=/^(?:[A-Z][\da-z]*)*Error$/,mN=new i(["AggregateError","SuppressedError"]),m$=e=>`
42
42
  name = '${e}';
43
- `,mt=e=>{var t;let r=(t=e.superClass,t?.type==="Identifier"?t.name:t?.type!=="MemberExpression"||t.computed||"Identifier"!==t.property.type?void 0:t.property.name);return!!r&&d7.test(r)},mr=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&t$(e.expression.callee,"super"),mn=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&t$(e.expression.left,`this.${t}`),mo=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),ma=(e,t)=>tu(e?.value)===t,mi=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,ms=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,ml=e=>ms(e)?.name==="options",mu=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type)return!0;for(let r of t[e.type]??[]){let n=e[r];if(n){if(Array.isArray(n)){if(n.some(e=>e&&mu(e,t)))return!0;continue}if(mu(n,t))return!0}}return!1},mp=e=>{let t=ms(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},mc=(e,t,r)=>n=>{let o=t.arguments;if(0===o.length){let o=e.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(o,`${r}, options`)}if(1===o.length){let e;return"undefined"!==r&&(!(e=o[0])||tq(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},md=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*mm(e,t){if(!mt(t)||null===t.id)return;let{name:r}=t.id,n=iy(r).replace(/(?:error)?$/i,"Error");r!==n&&(yield{node:t.id,message:`Invalid class name, use \`${n}\`.`});let{body:o}=t.body,{sourceCode:a}=e,i=o.find(e=>"constructor"===e.kind),s=o.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!i){if(ma(s,r))return;let e=a.getRange(t.body);yield{...mo(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,me(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],me(r))};return}let l=o.some(e=>mi(e,"get")),u=o.some(e=>mi(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.find(e=>mr(e)),p=a.findIndex(e=>mr(e)),c=a.findIndex(e=>mn(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tq(r)))m=!0,yield{node:u,messageId:d3};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:d8};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:u,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(i){let s=r.expression.right,[l,d]=t.value.params,m=ms(l),f=1===t.value.params.length&&m&&!ml(l),g=f||ml(d);if(0===u.expression.arguments.length){if(c!==p+1||mu(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${to(s,e)}, options`:to(s,e))}else{let e;if(e=u.expression.arguments[0],n.getText(e)!==n.getText(s))return;g&&1===u.expression.arguments.length&&(yield i.insertTextAfter(u.expression.arguments[0],", options"))}f&&(yield i.insertTextAfter(l,`, ${mp(l)}`));let y=0===c?n.getRange(o)[0]:n.getRange(a[c-1])[1],[,h]=n.getRange(r);yield i.removeRange([y,h])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>mn(e,"name"));return a?tu(a.expression.right)!==n?mo(a.expression.right??e,n):void 0:ma(o,n)?void 0:mo(o?.value??e,n)}(o,a,r);if(f&&(yield f),!f&&l&&!m){let r=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=ms(a);if(0===o.length||!i)return;let s=r.expression;if(ml(a)){if(!ml(s.arguments[1])){let t={node:s,messageId:d4};return md(s.arguments[0],i)||(t.fix=mc(e.sourceCode,s,"undefined")),t}return}let l=o[1],u=!n&&"message"===i.name,p=u?i.name:"undefined";if(!l){if(((e,t)=>{if(t)return!1;let[r,n]=e.arguments;return 2===e.arguments.length&&void 0!==tu(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===ez(n.properties[0])})(s,u))return;return{node:a,messageId:d6,fix:function*(r){let{sourceCode:n}=e,o=mc(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${mp(a)}`),yield o}}}if(!ml(l))return{node:l,messageId:d9};if(u&&!md(s.arguments[0],i)){let t;return{node:s,messageId:d5,fix:(t=e.sourceCode,e=>{let r,n=s.arguments;if(0===n.length){let r=t.getTokenAfter(s.callee,e=>"("===e.value);return e.insertTextAfter(r,`${p}, options`)}if(!(r=n[0])||tq(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!ml(s.arguments[1]))return{node:s,messageId:d4,fix:mc(e.sourceCode,s,p)}})(e,t,u,d);r&&(yield r)}}(e,i,{name:r,nameProperty:s,hasMessageGetter:l,hasMessageSetter:u,checkOptions:r===n})}let mf="no-lonely-if",mg=e=>"IfStatement"===e.type&&!e.alternate;function my(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let mh=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),mx=e=>e.trim()?e:"",mb=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,mE=(e,t)=>mh(e.ifToken,e.openingParenthesisToken,t),mv=(e,t,r)=>{let n,o=mh(e.openingParenthesisToken,e.closingParenthesisToken,r);return ta(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},mS="no-magic-array-flat-depth",mC="no-negated-condition",mD="identifier",mT="non-identifier",mA="prefer-negative-index",mw=new o([["slice",{argumentsIndexes:[0,1],supportObjects:new i(["Array","String","ArrayBuffer",...r9])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new i(r9)}],["splice",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new i(["Array","String",...r9])}]]),mk=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var mI=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function mj(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new i(mI)).has(t)}let mF="prefer-node-protocol",mB="node:",mR="consistent-date-clone/error",mP="no-accessor-recursion/error",mL=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,mN=(e,t)=>["type","name"].every(r=>e[r]===t[r]),m$=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&mL(e.parent.property)&&mN(e.parent.property,t.key),mM="error/calculate-dirname",mO="error/calculate-filename";function mq(e,{modules:t,functionName:r,sourceCode:n}){if(!tb(e,{optional:!1,argumentsLength:1},ty))return!1;let o=new i;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tF(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tR(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&a(t.arguments[0]);if("Identifier"!==t.type||o.has(t))return!1;o.add(t);let s=eS(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!a(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],i)}(e.callee,"property");function a(e){return e?.type==="Literal"&&t.has(e.value)}}function mU(e,t){return mq(e,{modules:new i(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function mW(e,t){return mq(e,{modules:new i(["path","node:path"]),functionName:"dirname",sourceCode:t})}let mV="no-unnecessary-array-flat-depth",m_="no-unnecessary-array-splice-count",mz="no-useless-error-capture-stack-trace/error",mK="prefer-class-fields/error",mG="prefer-class-fields/suggestion",mJ="prefer-bigint-literals/error",mX="prefer-bigint-literals/suggestion",mY="prefer-classlist-toggle/error",mH="prefer-classlist-toggle/suggestion",mQ=e=>tF(e,{property:"classList",computed:!1}),mZ=(e,t,r)=>{let n={node:r??e,messageId:mY};return"IfStatement"===e.type||tT(e)||tT(e.parent)?n.fix=t:n.suggest=[{messageId:mH,fix:t}],n},m0=(e,t,r)=>{let{sourceCode:n}=t,o=to(e,t);return r?(!ta(e,n)&&ia(e,"!")&&(o=`(${o})`),o=`!${o}`):(ta(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},m1=(e,t)=>tR(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&mQ(e.callee.object),m2=(e,t)=>rk(e.callee.object,t.callee.object)&&rk(e.arguments[0],t.arguments[0]),m3=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),m1(e,["contains"])&&m2(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?m3(e.argument,!t,r):void 0,m8="require-module-attributes",m6="error",m9="suggestion/array",m5="suggestion/object",m4="suggestion/object-assign",m7="suggestion/set",fe="suggestion/map",ft=(e,t,r)=>{let{sourceCode:n}=r,o=r1(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function fr(e,t){if(!tE(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*fn(e,t,r){let n=!eA(t.sourceCode.getTokenBefore(e));yield iQ(e,t,r,n)}function fo(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eT(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*fa({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rC(r,e)){let[o]=r.arguments;if(o)yield fo(e,t,o,n);else{let{openingParenthesisToken:o}=rC(r,e)?rD(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*fn(o,e,t)}let fi=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tR(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:m6,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eH(e,a))?l.suggest=[{messageId:m9,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p,l},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=rT(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):fo(e,a,t,i),yield fn(r,e,a)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!("AssignmentExpression"===n.type&&"="===n.operator&&tF(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!ft(t,a.computed?[i,o]:[o],e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,{left:i,right:s}=e,{property:l}=i,u=a.getTokenAfter(i,t=>"Punctuator"===t.type&&t.value===e.operator),p={node:e,loc:{start:a.getLoc(e).start,end:a.getLoc(u).end},messageId:m6,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eH(l,a)||eH(s,a)?p.suggest=[{messageId:m5,data:{assignType:n},fix:c}]:p.fix=c,p},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=to(o,e);n.computed&&(s=`[${s}]`);let l=to(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eT(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield fn(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tR(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[o,a]=n.arguments;if(!("Identifier"!==o.type||o.name!==t.name||"SpreadElement"===a.type||ft(t,[a],e)))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:m6,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eH(i,a)?s.suggest=[{messageId:m4,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i;("ObjectExpression"===o.type?o.properties.length>0&&(i=function(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(eT(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${to(o,e)}`,i&&(yield fo(e,a,t,i)),2!==n.arguments.length)?yield iq(a,o,e):yield fn(r,e,a)}},{testValue:e=>fr(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),tR(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:m6,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eH(e,i))?s.suggest=[{messageId:m7,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rT(e,r,!1);return fa({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>fr(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tR(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!ft(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:m6,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eH(e,i))?s.suggest=[{messageId:fe,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rT(e,r,!1);return fa({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],fs="no-useless-collection-argument/error",fl="no-useless-collection-argument/suggestion",fu="prefer-response-static-json",fp=/([\p{Ll}\d])(\p{Lu})/gu,fc=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,fd=/(\d)\p{Ll}|(\p{L})\d/u,fm=/[^\p{L}\d]+/giu,ff="$1\0$2";function fg(e){let t=e.trim();t=(t=t.replace(fp,ff).replace(fc,ff)).replace(fm,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function fy(e){let t=fg(e);for(let e=0;e<t.length;e++){let r=t[e],n=fd.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function fh(e,t){let[r,n,o]=fC(e,t);return r+n.map(fE(t?.locale)).join(t?.delimiter??" ")+o}function fx(e,t){var r,n;let[o,a,i]=fC(e,t),s=fE(t?.locale),l=fv(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):fS(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function fb(e,t){let[r,n,o]=fC(e,t),a=fS(fE(t?.locale),fv(t?.locale));return r+n.map(a).join("")+o}function fE(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function fv(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function fS(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function fC(e,t={}){let r=t.split??(t.separateNumbers?fy:fg),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let fD="filename-case",fT="directory-case",fA="filename-extension",fw=e=>!/^[\w-]$/.test(e),fk=new i(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),fI=new Intl.ListFormat("en-US",{type:"disjunction"}),fj=/^[\da-z]+$/i,fF=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,fB=e=>e>="0"&&e<="9",fR=e=>e>="a"&&e<="z",fP=e=>e>="A"&&e<="Z",fL={camelCase:{fn:fx,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!fR(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(fR(r)||fB(r))continue;if(!fP(r))return!1;let n=t;for(;fP(e[t+1]);)t++;if(t!==n){if(fR(e[t+1])){t--;continue}for(;fB(e[t+1]);)t++;if(t===e.length-1)return!0;if(!fP(e[t+1]))return!1}}return!0}(e)?fx(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return fh(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return fh(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(fj.test(e)){let t=fF.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&fb(r)===r)return e}return fb(e)},name:"pascal case"}};function fN(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function f$(e,t,{leading:r,trailing:n}){let{samples:o}=function(e,t=1/0){let r=e.reduce((e,{length:t})=>e*t,1),n=Array.from({length:Math.min(r,t)},(t,r)=>{let n=r,o=[];for(let t=e.length-1;t>=0;t--){let r=e[t],{length:a}=r,i=n%a;n=(n-i)/a,o.unshift(r[i])}return o});return{total:r,samples:n}}(e.map(({word:e,ignored:r})=>r?[e]:t.map(t=>t(e))));return[...new i(o.map(e=>`${r}${e.join("")}${n}`))]}let fM=/^(?<leading>_+)(?<tailing>.*)$/;function fO(e){let t,{leading:r="",tailing:n=e}=(fM.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=fw(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function fq(e){let t;return t=e.map(e=>fL[e].name),fI.format(t)}let fU=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1},{properties:{cases:{properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1}]}],fW="consistent-template-literal-escape",fV=["entries","keys","values"],f_=["drop","filter","flatMap","map","take"],fz=["concat","from","zip","zipKeyed"],fK=new i(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:fG}=nC({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:fK}),fJ=e=>{for(;rL(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},fX="iterable-accepting",fY="for-of",fH="yield-star",fQ="spread",fZ="iterator-method",f0="iterable-accepting/suggestion",f1="iterator-method/suggestion",f2=["every","find","forEach","some"],f3="reduce",f8=e=>tR(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),f6=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>iH(r,e,t)},f9=(e,t,r,n)=>{let o=f6(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},f5="prefer-simple-condition-first",f4="prefer-simple-condition-first/unsafe";function f7(e){return"Identifier"===(e=rN(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rN(e.argument).type}function ge(e){if(f7(e=rN(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rN(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function gt(e){if("Identifier"===(e=rN(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return gt(e.argument);if("BinaryExpression"===e.type){let t=rN(e.left),r=rN(e.right);return!!(("=="===e.operator||"!="===e.operator)&&("Identifier"===t.type&&td(r)||td(t)&&"Identifier"===r.type))||ge(t)&&ge(r)&&("==="===e.operator||"!=="===e.operator)&&(f7(t)||f7(r))}return!1}let gr="switch-case-break-position",gn=new i(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),go="first-child",ga="first-element-child",gi="query-selector",gs="closest",gl="merge-query-selector",gu="suggestion-first-child",gp="suggestion-first-element-child",gc="suggestion-merge-query-selector",gd={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},gm=(e,t)=>tF(e,{property:t,optional:!1,computed:!1}),gf=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&tp(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,gg=(e,t)=>t.getCommentsInside(e).length>0,gy=(e,t,r,n)=>{let{sourceCode:o}=n;if(gg(e,o))return;let[,a]=tn(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},gh=e=>tF(e,{property:"parentElement",optional:!1,computed:!1}),gx=e=>void 0!==tu(e),gb=e=>tR(e,gd),gE=new i(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),gv=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),gS=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},gC="consistent-compound-words/error",gD="consistent-compound-words/rename",gT={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},gA=new i(String.raw`\^$.*+?()[]{}|`),gw=e=>{let t="";for(let r of e)t+=gA.has(r)?`\\${r}`:r;return t},gk=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,gI=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>((e,t)=>{let r=t.get(e)??t.get(ih(e));if(r){let t;return(t=e[0])===t.toUpperCase()?iy(r):ih(r)}})(e,r));if(o!==e)return o},gj=(e,t)=>({node:e,messageId:gC,data:{name:e.name,replacement:t}}),gF={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},gB="no-blob-to-file",gR="suggestion";function gP(e,t){let r=eS(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function gL(e,t){if(e?.type!=="Identifier")return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.kind&&o?.type==="VariableDeclarator")return o}let gN="no-canvas-to-image",g$=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function gM(e,t){if(e=g$(e),e?.type!=="Identifier")return e;let r=eS(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return g$(n.parent.init)}let gO=e=>e.toLowerCase().includes("canvas"),gq="replace-one-element",gU="insert-at-negative-one",gW="suggestion-replace-one-element",gV="suggestion-insert-at-negative-one";function g_(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&g_(e.object)}let gz=(e,t)=>t.getCommentsInside(e).length>0,gK="no-duplicate-set-values",gG="first-match",gJ="id-selector",gX="length-check",gY="query-selector-all-nullish",gH="query-selector-undefined",gQ=e=>tR(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oh(e.callee.object),gZ=e=>tR(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oh(e.callee.object),g0=e=>{let t,r;return t=e,r=gZ,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&ti(t.property,0)},g1=e=>{let t,r;return t=e,r=gZ,tR(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&ti(t.arguments[0],0)},g2=e=>nG(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,g3=(e,t,r,n)=>{let[,o]=tn(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},g8=(e,t,r)=>{if("Identifier"!==e.type)return;let n=eS(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},g6=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(t_(e))r=!r,e=e.parent;else if(tz(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tJ(n)||(gZ(e)?!e:!g8(e,r,gZ)))return;let a=r.getText(e);return{node:e,messageId:gX,fix:((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return r.getAllComments().some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(s<=a||t>=i)})})(n,e,r)?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},g9=(e,t,r)=>({node:e,messageId:gG,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?iY(n,e,r):iH(n,e,r)}}),g5=(e,t)=>td(e)||tq(e)&&t.isGlobalReference(e),g4=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:g8(n,r,t))&&g5(a,r)?{node:n,value:a}:(t(a)?a:g8(a,r,t))&&g5(n,r)?{node:a,value:n}:void 0:void 0},g7="no-invalid-file-input-accept/invalid",ye="no-invalid-file-input-accept/static",yt="no-invalid-file-input-accept/normalize",yr=new i(["audio/*","image/*","video/*"]),yn=new o([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),yo=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,ya=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},yi=e=>{if(e.startsWith("."))return e.length>1&&!ya(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!ya(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return yr.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new C.MIMEType(e);return{replacement:yn.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},ys=e=>{if("JSXIdentifier"===e.type)return e.name},yl=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&ys(e.name)===t),yu=(e,t)=>{let r=e.sourceCode.getScope(t),n=eV(t,r)?.value;if("string"==typeof n)return n},yp=e=>">"===e||""===e.trim(),yc=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},yd=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],ym=(e,t,r)=>{let n=t;for(;t<r&&""!==e[t].trim()&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},yf=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!yp(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},yg=(e,t,r)=>{let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=yc(n,i,a),!yd(n,i,a));){let e=ym(n,i,a);if(i=yc(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=yc(n,++i,a);let t=yf(n,i,a);if(i=t.index,e.name===r)return t}},yy=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:g7,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:ye};let r=(e=>{let t=e.split(","),r=new i,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=yi(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let o=n.join(", ");return o===e?{}:{replacement:o}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:g7,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:yt,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},yh=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,yx=e=>{for(let t=e.parent;t;t=t.parent)if(tw(t))return t},yb=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}},yE=e=>{let{sourceCode:t}=e,r=new i,n=e=>{let t=yx(e);t&&r.add(t)};return e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),{isFunctionSuspended:e=>r.has(e),isInsideSuspendingLoop(e,r){for(let n=e,o=e.parent;o&&o!==r;n=o,o=o.parent)if(yb(o,n)&&tY(o,t.visitorKeys))return!0;return!1}}},yv="after-suspension",yS="in-nested-function",yC="no-unnecessary-nested-ternary";function yD(e,t,r){return r.getText(e)===r.getText(t)}function yT(e,t,r,n){let o=to(e,t);return!ta(e,t)&&ii(e,{operator:r,property:n})&&(o=`(${o})`),o}function yA(e,t){let r=to(e,t);return!ta(e,t)&&a4(e)&&(r=`(${r})`),r}function yw(e,t,r){let n={node:t,messageId:yC};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[yT(r,e,n,"left"),yT(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${yA(a,e)} : ${yA(i,e)}`;return aL(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let yk="no-unused-array-method-return",yI=new i(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),yj=/^\p{Uppercase_Letter}/v,yF=Symbol("uncertainValue"),yB=["BigInt","Boolean","Number","RegExp","String","Symbol"],yR=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),yP="prefer-array-last-methods",yL="replace",yN=new o([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),y$=["reverse","toReversed"],yM="prefer-math-abs",yO=new i([">",">=","<","<="]),yq={">":"<",">=":"<=","<":">","<=":">="},yU={">":"<",">=":"<="};function yW(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&tm(e.literal)||"TSTypeAnnotation"===e.type&&yW(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>yW(e))||"TSIntersectionType"===e.type&&e.types.some(e=>yW(e))}function yV(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?yV(e.expression):e}function y_(e){let t;return tm(e)||tb(e,{name:"BigInt",argumentsLength:1,optional:!1},ty)||"UnaryExpression"===e.type&&"-"===e.operator&&y_(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&yW(t)}function yz(e,t){return y_(e)||function(e,t){let r=yV(e);if("Identifier"!==r.type)return!1;let n=eS(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&yW(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&y_(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&yW(e.node.id.typeAnnotation)||e.node.init&&y_(e.node.init)))??!1}(e,t)}function yK(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rk(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&ti(e.left,0)?rk(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rk(e.left,t)&&tP(e.right)||tP(e.left)&&rk(e.right,t))}function yG(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:yq[e.operator]}}function yJ(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:yq[e.operator]}}function yX(e,t){let r=to(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function yY(e,t,r){let n={node:e,messageId:yM};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function yH(e){return["Identifier","Literal","ThisExpression"].includes((e=yV(e)).type)}let yQ="prefer-split-limit",yZ=(e,t)=>{let r=eV(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},y0=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tR(r,{method:"split",argumentsLength:1})&&(ts(t=r.arguments[0])&&""!==t.value||tc(t)))return r},y1=(e,t,r,n)=>({node:e,messageId:yQ,fix:e=>iO(e,t,String(r),n)}),y2=(e,t,r)=>{let{elements:n}=e,o=y0(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return y1(e,o,n.length,r)},y3="prefer-queue-microtask",y8={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tF(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&oA(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:y3,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!oE(n.arguments[0])&&aB(n)&&oA(n.callee,e)?{node:n.callee,messageId:y3,data:{name:"setImmediate()"},fix:(e=>{if(1===e.arguments.length)return t=>t.replaceText(e.callee,"queueMicrotask")})(n)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!oE(n.arguments[0])&&aB(n)&&oA(n.callee,e)?{node:n.callee,messageId:y3,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length)return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!rV(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[y3]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},y6="prefer-string-pad-start-end",y9="suggest-padding-method",y5=new i(["ArrayExpression","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","ObjectExpression"]),y4=(e,t)=>{let r;return y5.has(e.type)||(r=eV(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||y5.has(((e,t)=>{if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];return n?.type==="FunctionName"||n?.type==="ClassName"?n.node:n?.type==="Variable"&&n.node.id===n.name?n.node.init:void 0})(e,t)?.type)||of(e,t)},y7=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,he=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,ht=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&tp(t)&&he(r),hr=(e,t)=>{if(!tR(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},hn=(e,t)=>{let r=hr(e,t);if(!r)return;let{widthNode:n}=r;if("BinaryExpression"===n.type&&"-"===n.operator&&tF(n.right,{property:"length",computed:!1}))return{...r,targetLengthNode:n.left,targetNode:n.right.object}},ho=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=to(t,a),s=to(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${to(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},ha=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:y6,data:{method:t}};return o&&!y7(e,n)&&(a.fix=function(t){let o=aL(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},hi=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:y6,data:{method:t}};return o&&!y7(e,n)&&(a.suggest=[{messageId:y9,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},hs="require-css-escape",hl=["closest","matches","querySelector","querySelectorAll"],hu=e=>e.value.cooked,hp=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=hu(r);if(void 0===e)return!1;n+=e}if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1)){let e=hu(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},hc=e=>tR(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),hd=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],hm={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tR(e,{methods:hl,minimumArguments:1})||oh(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!hc(n)&&(t||hp(r,e))&&(yield{node:n,messageId:hs,fix:hd(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[hs]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},hf="require-passive-events",hg=new i(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),hy=e=>e.computed||"Identifier"!==e.property.type?ts(e.property)?e.property.value:void 0:e.property.name,hh=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===hy(t)&&("CallExpression"===(r=t).parent.type&&r.parent.callee===r?r.parent:"ChainExpression"===r.parent.type&&"CallExpression"===r.parent.parent.type&&r.parent.parent.callee===r.parent?r.parent.parent:void 0)},hx=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=hy(e.parent);return t&&"preventDefault"!==t&&!nG((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},hb="this",hE="class",hv="class-unavailable",hS="super",hC="super-class",hD="super-class-unavailable",hT="suggestion",hA=new i(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),hw=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),hk=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,hI=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,hj=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(hI(r)&&!hk(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(hA.has(r.type))return}},hF=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},hB=(e,t,r)=>eS(e.getScope(t),t)===eS(e.getScope(r),r),hR=(e,t,r)=>eS(e.getScope(t),r.name)===eS(e.getScope(r),r),hP=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,hL=e=>{let t;return(t=e.parent,hw.has(t.type)&&t.expression===e)?e.parent:void 0},hN=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=hL(e);return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},h$=e=>{let t=e;for(;t.parent;){if(hP(t.parent,t))return!0;let e=hN(t);if(!e)break;t=e}return!1},hM=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,hO=e=>{let t=e;for(;t.parent;){let e=hL(t);if(!e)break;t=e}return t},hq=e=>{let t=hO(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},hU=e=>{let t=hO(e);return hM(t)&&"PrivateIdentifier"===t.parent.property.type},hW=e=>{let t=hO(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},hV=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,h_=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:hT,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),hz=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),hK={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||h$(e)||hq(e)||hU(e)||hW(e))return;let n=hj(e);if(!n)return;let o=hF(n.parent.parent);return o&&hR(t,e,o)?h_({node:e,messageId:hE,source:"this",replacement:o.name,name:o.name}):hz(e,hv)}),e.on("Super",e=>{if(n||h$(e))return;let r=hj(e);if(!r)return;let o=hV(r.parent.parent);return o&&hR(t,e,o)?h_({node:e,messageId:hC,source:"super",replacement:o.name,name:o.name}):hz(e,hD)}),e.on("Identifier",o=>{if(!tL(o)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(o)||h$(o)||hq(o)||hU(o)||hW(o))return;let a=hj(o);if(!a)return;let i=a.parent.parent;if(r){let e=hF(i);if(e&&o.name===e.name&&hB(t,o,e))return h_({node:o,messageId:hb,source:o.name,replacement:"this",name:o.name})}if(!n||!(hM(o)&&!o.parent.optional&&!h$(o.parent))||ta(o,e))return;let s=hV(i);if(s&&o.name===s.name&&hB(t,o,s))return h_({node:o,messageId:hS,source:o.name,replacement:"super",name:o.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[hb]:"Use `this` instead of `{{name}}` in static methods.",[hE]:"Use `{{name}}` instead of `this` in static methods.",[hv]:"Use the class name instead of `this` in static methods.",[hS]:"Use `super` instead of `{{name}}` in static methods.",[hC]:"Use `{{name}}` instead of `super` in static methods.",[hD]:"Use the superclass name instead of `super` in static methods.",[hT]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},hG="consistent-optional-chaining/remove-optional",hJ="consistent-optional-chaining/use-optional",hX="consistent-optional-chaining/suggest-remove-optional",hY="consistent-optional-chaining/suggest-use-optional",hH=new i(["Identifier","ThisExpression","Super"]);function hQ(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rN(e)).type&&(e=e.expression);return e}function hZ(e){return"MemberExpression"===(e=hQ(e)).type?e:void 0}function h0(e){return e=hQ(e),!!hH.has(e.type)||"MemberExpression"===e.type&&h0(e.object)}function h1(e,t){let r=rX(e,t);return!rV(t,r)}function h2({memberExpression:e,context:t,fixer:r,replacement:n}){let o=rX(e,t);return r.replaceTextRange(o,n)}function h3(e,t,r){return h2({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let h8="always",h6="never",h9="missing-delay",h5="redundant-delay",h4=new i(["setTimeout","setInterval"]),h7=new i(["window","globalThis","global","self"]),xe=e=>ti(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&xe(e.argument),xt="negative-index",xr="length-index",xn="no-duplicate-loops",xo=["filter","map"],xa="no-declarations-before-early-exit",xi=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),xs=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,xl=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eF(n)},xu=(e,t)=>{let[r,n]=e.getRange(t);return new i(rh(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*xp(e,t,r){let n;for(let[o,a]of t.entries())if(xi(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?oD(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&oD(t.property.name)})(r.init)||r.init&&tY(r.init,e.visitorKeys)||a>o+1&&!xs(r.init)||r.init&&(i=r.init,s=xu(e,n),[...xu(e,i)].some(e=>s.has(e)))&&(eH(r.init,e)||eH(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:xa};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&xs(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!xl(e,t,"before")&&!xl(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eF(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let xc="no-optional-chaining-on-undeclared-variable",xd=e=>"Type"===e.type||"ImportBinding"===e.type&&aN(e.node);function xm(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rN(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let xf="no-object-methods-with-collections/error",xg="no-object-methods-with-collections/suggestion",xy=new i(["entries","keys","values"]),xh="no-subtraction-comparison/error",xx="no-subtraction-comparison/suggestion",xb={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},xE=new i(Object.keys(xb)),xv=new i([">","<"]),xS=e=>"BinaryExpression"===e.type&&"-"===e.operator,xC=(e,t)=>{let r=eV(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},xD="no-unnecessary-global-this",xT=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function xA(e){for(;xT.has(e.type);)e=e.expression;return e}let xw=e=>{for(;xT.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},xk=t1();function xI(e){return"CallExpression"===(e=xw(e)).parent.type&&e.parent.callee===e}let xj=new i(["==","!=","===","!=="]),xF="computed-key",xB="nested-array",xR="deep-object",xP="property-assignment";function xL(e){let{parent:t}=e;if(t){if(rL(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return xL(t);if("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type)return t.parent;if("ObjectPattern"===t.type||"ArrayPattern"===t.type)return t}}function xN(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=xL(e);return t}let x$="no-useless-else",xM=new i(["Program","BlockStatement","StaticBlock","SwitchCase"]),xO=new i(["[","(","<","/","`","+","-"]),xq=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},xU=e=>xO.has(e.value[0]),xW="no-useless-recursion",xV=new i(["using","await using"]),x_=e=>e?.type==="VariableDeclaration"&&xV.has(e.kind),xz=e=>"ForStatement"===e.type?x_(e.init):"ForOfStatement"===e.type&&x_(e.left),xK="prefer-add-event-listener-options",xG="prefer-direct-iteration",xJ="Array",xX="FormData",xY="URLSearchParams",xH=new i([xJ,"Map","Set",xX,xY,...r9]),xQ=new o([["ReadonlyArray",xJ],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),xZ=new o([[xJ,["values"]],["Map",["entries"]],["Set",["values","keys"]],[xX,["entries"]],[xY,["entries"]],...r9.map(e=>[e,["values"]])]),x0=["Map","WeakMap","Set","WeakSet"],x1=["all","allSettled","any","race"],x2=new i(["ArrayExpression","CallExpression","NewExpression"]),x3=e=>new i([e]),x8=(e,t)=>tR(e,{objects:r9,methods:t,optionalCall:!1,optionalMember:!1}),x6=e=>xH.has(e)?e:xQ.get(e),x9=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},x5=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return x9(e.types.map(e=>x5(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return x3(xJ);let n=r7(e);if(!ne(n,r))return;let o=n.getName(),a=o&&x6(o);return a&&x3(a)},x4=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return x4(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return x3(xJ);case"TSTypeOperator":return"readonly"===e.operator?x4(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=x6(e.typeName.name);return t&&x3(t)}case"TSUnionType":return x9(e.types.map(e=>x4(e)))}},x7=(e,t,r=new i)=>((e,t,r)=>{if("ArrayExpression"===e.type||tE(e,{name:"Array"}))return x3(xJ);if(tE(e,{names:r9})||tE(e,{names:["Map","Set",xX,xY]}))return x3(e.callee.name);if(tb(e,{name:"Array"},ty)||tR(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return x3(xJ);if(x8(e,["from","of"]))return x3(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=x4(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?x7(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return x4(e.typeAnnotation)??x7(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return x7(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return x5(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),be="prefer-number-is-safe-integer/error",bt="prefer-number-is-safe-integer/suggestion",br="prefer-number-is-safe-integer/integer-check-error",bn="prefer-number-is-safe-integer/integer-check-suggestion",bo=["_","lodash","underscore"],ba=["floor","trunc"],bi=(e,t)=>{let r=eS(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},bs=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&ti(e.right,1))return e.left},bl=(e,t)=>{if(tR(e,{object:"Math",methods:ba,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},bu="prefer-object-define-properties";function bp(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tR(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let bc="prefer-object-destructuring-defaults",bd="prefer-object-destructuring-defaults/suggestion",bm=new i(Object.getOwnPropertyNames(Object.prototype)),bf={considerGetters:!0,considerImplicitTypeConversion:!0},bg=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,by=(e,t,r)=>rh(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),bh=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=to(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},bx="prefer-single-object-destructuring",bb=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=eS(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},bE=(e,t,r)=>{let n,o,a=bb(e,t),i=bb(e,r);if(!(a&&i&&a.node.kind===i.node.kind&&a.source===i.source&&0===e.getCommentsInside(a.node).length&&0===e.getCommentsInside(i.node).length)||(n=a.node,o=i.node,e.getTokensBetween(n,o,{includeComments:!0}).some(e=>eF(e))))return;let s=t=>t.properties.map(t=>e.getText(t)).join(", "),l=`${a.node.kind} {${s(a.declarator.id)}, ${s(i.declarator.id)}} = ${a.source};`;return{node:i.node,messageId:bx,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*bv(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=bE(e,t[r-1],n);o&&(yield o)}}let bS="prefer-smaller-scope",bC=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function bD(e,t){let r=e.parent;for(;r&&r!==t;){if(bC.has(r.type))return!1;r=r.parent}return r===t}function bT(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eF(n))}function bA(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let bw="prefer-single-array-predicate/error",bk="prefer-single-array-predicate/suggestion",bI=new o([["||","some"],["&&","every"]]),bj=new i(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),bF="prefer-url-href",bB="non-url",bR="unknown",bP=new i(["ClassName","ImportBinding","Type"]),bL=new i(["any","error","unknown"]),bN=new i(["node:url","url"]),b$=e=>bP.has(e.type),bM=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>a$(e,r,n)))return o;t=t.upper}},bO=e=>e.every(e=>"url"===e)?"url":!e.includes(bR)&&e.includes(bB)?bB:bR,bq=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,bN.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},bU=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||aN(e.node)),bW=e=>"Type"===e.type||bU(e),bV=e=>bq(e)&&!bU(e),b_=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!bW(e)&&a$(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(oA(e,t))return!0;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>bW(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>bV(e))??!1})(r,t))},bz=(e,t)=>t.sourceCode.getScope(e.name??e.node),bK=(e,t,r,n=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bK(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return bR;let o=e.typeName.name,a=bM(o,r,e.typeName,t),[i]=a?.defs??[];if(!i)return"URL"!==o||((e,t)=>{for(;t;){let r=t.set.get(e);if(r?.defs.some(e=>b$(e)))return!0;t=t.upper}return!1})(o,r)?bR:"url";if(n.has(o))return bR;if(bq(i))return"url";n.add(o);let s=bR;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=bK(i.node.typeAnnotation,t,bz(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=bR:"ClassName"===i.type&&(s=bB),n.delete(o),s})(e,t,r,n);case"TSUnionType":return bO(e.types.map(e=>bK(e,t,r,n)));case"TSIntersectionType":return bO(e.types.map(e=>bK(e,t,r,n)));case"TSImportType":let o;return(o=e.source,bN.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":bB;default:return e?bB:bR}},bG=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(bL.has(e.intrinsicName)||e.isTypeParameter?.())return bR;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return bG(i,t);if(e.isUnion()||e.isIntersection())return bO(e.types.map(e=>bG(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return bR;let n=bM(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||bq(e))??[];return 0===o.length?bR:o.every(e=>bq(e))?"url":bB})(r.typeToString(e),o,n);if(s!==bR)return s;let l=r7(e);return ne(l,a)&&"URL"===l.getName()?"url":bB},bJ=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return bR;try{let{program:n}=r;return bG(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return bR}};function bX(e,t,r=new i){if(!e)return bR;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return bR;let[o]=n.defs;if(!a$(o,e,t))return bR;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?bX(o.node.init,t,r):bR,i=bK(o.name?.typeAnnotation,t,bz(o,t)),s=bR;return a!==bR?s=a:i!==bR&&(s=i),r.delete(n),s})(e,t,r);if(n!==bR)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=bK(e.typeAnnotation,t,n);return o===bR?bX(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return bX(e.expression,t,r);case"SequenceExpression":return bX(e.expressions.at(-1),t,r);case"ConditionalExpression":return bO([bX(e.consequent,t,r),bX(e.alternate,t,r)])}if(b_(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!bW(e)&&!bV(e))??!1})(e.callee,t))return bB;let r=bJ(e,t);return r===bR?bB:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return bR;let r=eS(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return bR;let[n]=r.defs;return bK(n.node.returnType,t,bz(n,t))})(e,t);return o!==bR?o:bJ(e,t)}let bY=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return bY(e.expression,t);case"SequenceExpression":return bY(e.expressions.at(-1),t);case"ConditionalExpression":return bY(e.consequent,t)&&bY(e.alternate,t);case"NewExpression":return b_(e,t);default:return!1}},bH=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,bQ="require-proxy-trap-boolean-return",bZ=new i(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),b0=new i(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),b1=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,b2=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),b3=new i(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),b8=(e,t)=>({node:e,messageId:bQ,data:{name:t}}),b6=e=>{if(e)return b8(e.node,e.data.name)},b9=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?b6(b9(e.right,t,r)):b8(e,t);if("ConditionalExpression"===e.type)return b9(e.consequent,t,r)??b9(e.alternate,t,r);if("LogicalExpression"===e.type)return b6(b9(e.left,t,r)??b9(e.right,t,r));if("SequenceExpression"===e.type)return b6(b9(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=eV(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(b2.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&b3.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...b8(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},b5=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=ez(e,t.getScope(e));if(bZ.has(r)&&b0.has(e.value.type))return{name:r,functionNode:e.value}},b4=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return b8(e,t);if("BlockStatement"!==e.body.type)return b9(e.body,t,r);let o=[...function* e(t){if(t&&"string"==typeof t.type){if("ReturnStatement"===t.type)return void(yield t);if(!("BlockStatement"!==t.type&&b0.has(t.type))){for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){for(let t of n)yield*e(t);continue}yield*e(n)}}}}(e.body)],a=n.get(e)??!1;if(0===o.length){if(a)return;return b8(e,t)}for(let e of o){if(!e.argument)return b8(e,t);let n=b9(e.argument,t,r);if(n)return n}if(!a)return b8(e,t)},b7=D.builtinRules.get("logical-assignment-operators"),Ee="ifNullish",Et="convertIf",Er={...b7.meta.messages,[Ee]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},En=e=>e.fix??e.suggest?.[0]?.fix,Eo={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof En(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:Ee};if(t.getCommentsInside(e.node).length>0)return n;let o=En(e);return{...n,suggest:[{messageId:Et,data:{operator:"||="},fix:o},{messageId:Et,data:{operator:"??="},fix:e=>o(new Proxy(e,{get(e,t){if("insertTextBefore"!==t){let r=Reflect.get(e,t,e);return"function"==typeof r?r.bind(e):r}return(t,r)=>e.insertTextBefore(t,"||"===r?"??":r)}}))}]}}(r,t))}}});for(let[t,n]of Object.entries(b7.create(r)))e.on(t,n)},meta:{type:b7.meta.type,docs:{description:b7.meta.docs.description,recommended:!0},fixable:b7.meta.fixable,hasSuggestions:b7.meta.hasSuggestions,schema:b7.meta.schema,defaultOptions:[b7.meta.defaultOptions?.[0]],messages:Er,languages:["js/js"]}},Ea="no-useless-coercion",Ei=new o([["Boolean",{type:"boolean",isType:os}],["String",{type:"string",isType:og}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&ou(e.typeAnnotation)||op(e,t))||"bigint"==typeof eV(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>n2(e,t.sourceCode.getScope(e))}]]),Es="no-useless-boolean-cast",El=["every","filter","find","findIndex","findLast","findLastIndex","some"],Eu="no-useless-continue",Ep="no-useless-override",Ec=e=>e.isUnion()?e.types.every(e=>Ec(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,Ed=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},Em="prefer-has-check",Ef=new i(["Map","ReadonlyMap","WeakMap"]),Eg=new i(["Map","WeakMap"]),Ey=new i(["FormData","Headers","URLSearchParams"]),Eh=new i(["Array","ReadonlyArray"]),Ex=Eg.union(Ey),Eb=new i(["ClassName","ImportBinding","TSEnumName","Type"]),EE=new i(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),Ev=new i(["TSTypeAnnotation","TSParenthesizedType"]),ES=new i(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),EC=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),ED=new i(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),ET=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),EA=new i(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),Ew=e=>{for(;EA.has(e.type);)e=e.expression;return e},Ek=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=Ek(e.left);return t?`${t}.${e.right.name}`:void 0}},EI=e=>e.typeArguments?.params??e.typeParameters?.params??[],Ej=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>Eb.has(e.type));if(r)return r;t=t.upper}},EF=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===EI(e.node).length)return e.node.typeAnnotation},EB=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=eS(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},ER=(e,t)=>tq(e)&&EB(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,EP=(e,t)=>Ef.has(e)?{kind:"map",typeName:e,valueType:t}:Ey.has(e)?{kind:"null-sentinel",typeName:e}:void 0,EL=(e,t,r=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return EL(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?EL(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=Ek(e.typeName);if(!n)return;if((Ef.has(n)||Ey.has(n))&&!Ej(n,t))return EP(n,EI(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),EF(Ej(e,t))})(n,t,r);return o?EL(o,t,r):void 0}}},EN=(e,t)=>{let r=t.sourceCode.getScope(e);return EL(e.typeAnnotation,r)},E$=(e,t,r=new i)=>{let n=EN(e,t);if(n)return n;if(tE(e=Ew(e))&&"Identifier"===e.callee.type&&Ex.has(e.callee.name)&&EB(e.callee,t))return EP(e.callee.name);if("Identifier"!==e.type)return;let o=eS(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,s=EL(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return s||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?E$(a.node.init,t,r):void 0)},EM=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=r7(r);if(ne(e,t))return e.getName()}},EO=(e,t,r)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>EO(e,t,r));if(1===new i(n.map(e=>e?.typeName)).size){let[e]=n;if(e?.kind!=="map")return e;let r=n.map(e=>e?.valueType);return{...e,valueType:r.every(Boolean)?t.getUnionType(r):void 0}}if(n.every(e=>e?.kind==="map")){let e=n.map(e=>e.valueType);return{kind:"map",typeName:"Map",valueType:e.every(Boolean)?t.getUnionType(e):void 0}}return n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>EO(e,t,r)).find(e=>e?.kind==="map");let n=EM(e,r);return EP(n,Ef.has(n)?t.getTypeArguments(e).at(-1):void 0)},Eq=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return EO(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},EU=(e,t)=>Eq(e,t)??E$(e,t),EW=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,EV=(e,t,r,n=new i)=>{if(!e||ES.has(e.type))return!1;if(Ev.has(e.type))return EV(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&EV(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>EV(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(EC.has(e.type))return"truthy"!==r;if(ED.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var o;let t="Literal"===(o=e.literal).type?o.value:"TemplateLiteral"===o.type&&0===o.expressions.length?o.quasis[0].value.cooked:"UnaryExpression"===o.type&&("-"===o.operator||"+"===o.operator)&&"Literal"===o.argument.type&&("number"==typeof o.argument.value||"bigint"==typeof o.argument.value)?"-"===o.operator?-o.argument.value:o.argument.value:void 0;return void 0!==t&&EW(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=Ek(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=EF(o=Ej(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=EV(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},E_=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,Ez=(e,t,r)=>{if(r5.has(e.intrinsicName))return!1;let n=E_(e,t);return n&&n!==e?Ez(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>Ez(e,t,r)):!r.has(e.intrinsicName))},EK=(e,t,r)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return!1;let n=E_(e,t);if(n&&n!==e)return EK(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>EK(e,t,r));if(EE.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;if(e.isBigIntLiteral?.())return e.value.negative||"0"!==e.value.base10Value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||Eh.has(EM(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},EG=(e,t,r)=>{if(!tE(e)||"Identifier"!==e.callee.type||!Eg.has(e.callee.name)||!EB(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n;let o;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],(o=eV(n,t.sourceCode.getScope(n)))?EW(o.value,r):!tq(n)&&ET.has(n.type))})},EJ=(e,t,r)=>{let n=EG(Ew(e),t,r);if(void 0!==n)return n;let o=Eq(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?EK(o,n,e):"not-undefined"===r?Ez(o,n,new i(["undefined","void"])):Ez(o,n,new i(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,s=o.visitedVariables??new i,l=o.checkConstructorValues??!0,u=EN(t,r);if(u?.kind==="map")return!!u.valueType&&EV(u.valueType,r,n);let p=((e,t,r,n)=>{if(!tE(e)||"Identifier"!==e.callee.type||!Eg.has(e.callee.name)||!EB(e.callee,t))return;if(n){let n=EG(e,t,r);if(void 0!==n)return n}let o=EI(e).at(-1);return!!o&&EV(o,t,r)})(t=Ew(t),r,n,l);if(void 0!==p)return p;let c=((e,t,r)=>{if("Identifier"!==e.type)return;let n=eS(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,s);if(!c)return!1;s.add(c);let[d]=c.defs,m=(a=EL(d.name?.typeAnnotation,r.sourceCode.getScope(d.name)),a?.kind==="map"?!!a.valueType&&EV(a.valueType,r,n):"Variable"===d.type&&"const"===d.parent.kind&&d.node.id===d.name&&!!d.node.init&&e(d.node.init,r,n,{visitedVariables:s,checkConstructorValues:!1}));return s.delete(c),m}(e,t,r)},EX="logical",EY="ternary",EH="consistent-conditional-object-spread",EQ=new i(["==","==="]),EZ=new i(["!=","!=="]),E0=e=>tD(e)||tq(e)||td(e),E1=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function E2(e,t,r){if(rk(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return E2(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&E2(e.left,t.left,r)&&E2(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&E2(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function E3(e){return td(e)?"null":tq(e)?"undefined":void 0}function E8(e){if("BinaryExpression"!==e.type||!EQ.has(e.operator)&&!EZ.has(e.operator))return;let t=E3(e.left),r=E3(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:EQ.has(e.operator)}}let E6=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function E9(e,t){let r=E8(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=E8(e.left),o=E8(e.right);if(n&&o&&E2(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&E6(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&E6(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function E5(e,t,r){let n=to(e,r);return!ta(e,r)&&ii(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function E4(e,t){let r=to(e,t);return!ta(e,t)&&a4(e)&&(r=`(${r})`),r}let E7="default-export-style/inline",ve="default-export-style/separate",vt="default-export-style/suggestion-inline",vr="default-export-style/suggestion-separate",vn="inline",vo="separate",va="ignore",vi="class",vs="function",vl=()=>({enum:[vn,vo,va]}),vu=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,vp=e=>e.id?.name,vc=e=>{switch(e.type){case"ClassDeclaration":return vi;case"FunctionDeclaration":return vs}},vd=e=>e===vi?"classes":"functions",vm=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return rM(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},vf=(e,t)=>eS(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,vg=e=>!!e&&!!(e.type.startsWith("TS")||e.typeAnnotation||e.typeParameters||e.returnType||e.implements?.length>0||e.superTypeArguments||e.accessibility||e.readonly||e.override||e.definite||e.optional&&"MemberExpression"!==e.type&&"CallExpression"!==e.type||e.abstract||e.declare||e.decorators?.length>0),vy=(e,t)=>{if(vg(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&vy(e,t)))return!0;continue}if(n?.type&&vy(n,t))return!0}return!1},vh=(e,t)=>e.params.every(e=>!r2(e,t.sourceCode.visitorKeys)),vx=(e,t,r)=>eS(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,vb=(e,t)=>{let r=vp(e);if(r){let t=vc(e);return t&&{kind:t,name:r,declaration:e}}let n=((e,t)=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[r]=e.declarations;if(!("Identifier"!==r.id.type||vg(r.id)||r.init?.type!=="ArrowFunctionExpression"||vy(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:vs,name:n.id.name,declaration:e,functionNode:n.init}},vE=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),vv=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||vx(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!vy(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&vh(t,e)&&!r2(t.body,e.sourceCode.visitorKeys))return[{messageId:vr,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${vE(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
44
- export default ${n};`)}]},vS=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===va||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return rM(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||vf(i,r.declaration))&&(o!==vs||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===vs&&"FunctionDeclaration"===t.type&&vy(t,e.sourceCode.visitorKeys))){if(n===vn)return"VariableDeclaration"===t.type?{node:r,messageId:E7,data:{kind:o},suggest:(({context:e,declaration:t,exportDeclaration:r,name:n,scope:o})=>{let[{id:a,init:i}]=t.declarations;if(!(e.sourceCode.getCommentsInside(r).length>0||vm(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||vx(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!vy(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&vh(i,e)&&!r2(i.body,e.sourceCode.visitorKeys))return[{messageId:vt,data:{kind:vs},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${vE(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${to(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===vi&&vy(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||vm(e,r)?{node:r,messageId:E7,data:{kind:o}}:{node:r,messageId:E7,data:{kind:o},fix:function*(n){yield n.insertTextBefore(t,"export default "),yield n.removeRange([e.sourceCode.getRange(t)[1],e.sourceCode.getRange(r)[1]])}};if(n===vo&&o===vs&&"FunctionDeclaration"===t.type)return{node:r,messageId:ve,data:{kind:o,style:"const arrow function"},suggest:vv({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},vC=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=vp(o),i=e.sourceCode.getScope(t);if(!(!a||r===va||r===vn||vf(i,a)||n===vs&&(o.generator||vy(o,e.sourceCode.visitorKeys)))){if(n===vs)return{node:t,messageId:ve,data:{kind:n,style:"const arrow function"},suggest:vv({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===vi&&vy(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:ve,data:{kind:n,style:"class declaration"}}:{node:t,messageId:ve,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
45
- export default ${n.id.name};`)}}}},vD={create:e=>{let t=e.options[0];e.on("Program",r=>{for(let[n,o]of r.body.entries()){if("ExportDefaultDeclaration"===o.type){let{declaration:r}=o,n=vc(r),a=vp(r);if(!n||!a)continue;let i=vC({context:e,exportDeclaration:o,expectedStyle:t[vd(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=vb(o,e);if(!i||!vu(a,i.name))continue;let s=vS({context:e,exportDeclaration:a,expectedStyle:t[vd(i.kind)],scope:e.sourceCode.getScope(a),...i});if(s)return s}})},meta:{type:"suggestion",docs:{description:"Enforce consistent default export declarations.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{functions:vl(),classes:vl()},additionalProperties:!1}],defaultOptions:[{functions:vn,classes:vn}],messages:{[E7]:"Prefer declaring this default-exported {{kind}} inline.",[ve]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[vt]:"Use an inline default {{kind}} declaration.",[vr]:"Use a separate const arrow function default export."},languages:["js/js"]}};function vT(e){for(;;){let t=rN(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function vA(e,t){return eS(t.sourceCode.getScope(e),e)}let vw="no-array-concat-in-loop",vk="no-array-front-mutation",vI=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],vj="no-array-sort-for-min-max/error",vF="no-array-sort-for-min-max/suggestion",vB=e=>tp(e)&&0===e.value,vR=(e,t)=>{if(!tR(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||r3(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tw(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rN((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(rk(t.left,r)&&rk(t.right,n))return"ascending";if(rk(t.left,n)&&rk(t.right,r))return"descending"}})(r);if(n&&!(nB(e.callee.object,t)||nR(e.callee.object,t)))return{direction:n,node:e.callee.object}},vP=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:vj,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=aj(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:vF,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},vL="no-boolean-sort-comparator",vN="no-boolean-sort-comparator/suggestion",v$=new i(["sort","toSorted"]),vM=new i([">",">=","<","<="]),vO=(e,t,r,n)=>(e=rN(e),t=rN(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!rk(e.property,t.property):e.property.name===t.property.name)&&vO(e.object,t.object,r,n),vq=(e,t)=>{for(;rL(e);){if(e.typeAnnotation&&on(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},vU="no-chained-comparison/error",vW="no-chained-comparison/suggestion",vV=new i(["<",">","<=",">="]),v_=new i(["===","!==","==","!="]),vz=vV.union(v_),vK=e=>"BinaryExpression"===e.type&&vz.has(e.operator),vG="no-constant-zero-expression/error",vJ="no-constant-zero-expression/suggestion",vX="no-duplicate-logical-operands",vY="no-duplicate-logical-operands/suggestion",vH=new i(["Identifier","ThisExpression","Literal"]),vQ=new i(["Identifier","ThisExpression"]),vZ=e=>{if(pB(e=rN(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return vZ(e.object)&&(!e.computed||(t=rN(t=e.property),vH.has(t.type)));default:return!1}},v0="no-impossible-length-comparison",v1={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},v2="no-invalid-character-comparison",v3=new i(["==","===","!=","!=="]),v8=(e,t)=>!!(tR(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&og(e.callee.object,t)||tR(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&og(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(tp(e))return!0;if(!ts(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&og(e.object,t),v6="no-loop-iterable-mutation",v9=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],v5=["add","clear","delete"],v4=["clear","delete","set"],v7={array:new i(v9),set:new i(v5),map:new i(v4),unknown:new i([...v9,...v5,...v4])},Se=new i(["entries","keys","values"]),St=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function Sr(e,t){return nj(e,t)?"array":nq(e,t)?"set":nU(e,t)?"map":void 0}function Sn(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function So(e){return"Identifier"===(e=rN(e)).type?e:void 0}function Sa(e){if("ArrayPattern"!==(e=rN(e)).type)return;let[t]=e.elements;return t&&So(t)}function Si(e,t){if(pB(e=rN(e)))return;if(pj(e))return{collectionKind:Sr(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=ez(e.callee,t.sourceCode.getScope(e.callee));if(!(!Se.has(r)||pB(e.callee.object))&&pj(e.callee.object))return{collectionKind:Sr(e.callee.object,t),reference:e.callee.object,method:r}}function Ss(e,t){let r=Sn(e);return"keys"===t.method?So(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?Sa(r):void 0}function Sl(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=Sn(e),"entries"===t.method?Sa(r):"direct"!==t.method||"map"!==t.collectionKind?So(r):void 0),a=Ss(e,t),i=(n=Sn(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?So(n):"direct"===t.method&&"map"!==t.collectionKind?So(n)??Sa(n):Ss(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*Su(e){"Identifier"===(e=rN(e)).type?yield e:"MemberExpression"===e.type&&(yield*Su(e.object),e.computed&&(yield*Su(e.property)))}function Sp(e,t,r){if(!pI(e,t))return!1;let n=[...Su(e)],o=[...Su(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=eS(r.sourceCode.getScope(e),e),i=eS(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function Sc(e,t,r){let[n]=e.arguments;return!!(t&&n&&Sp(n,t,r))}function Sd(e,t,r,n){return"add"===r&&Sc(e,t.addArgumentIdentifier,n)||"set"===r&&Sc(e,t.setKeyIdentifier,n)}let Sm="no-selector-as-dom-name",Sf=["add","remove","contains","toggle","replace"],Sg=/^[#.]-?[A-Z_a-z][\w-]*$/u,Sy=new i([".","#"]),Sh=e=>Sy.has(e?.[0]),Sx=e=>tu(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),Sb=(e,t,r,n)=>({node:e,messageId:Sm,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(Sg.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),SE=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),Sv="no-useless-compound-assignment/error",SS="no-useless-compound-assignment/remove",SC="no-useless-compound-assignment/replace",SD=new o([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),ST="no-useless-delete-check",SA="removeCheck",Sw={considerGetters:!0},Sk=new i(["Map","Set","WeakMap","WeakSet"]),SI=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),Sj=new i(["ClassName","FunctionName"]),SF=new i(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),SB=e=>null!==e&&("object"==typeof e||"function"==typeof e),SR=e=>!!SF.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>SR(e)),SP=(e,t)=>{if("Identifier"!==e.type)return!1;let r=eS(t.sourceCode.getScope(e),e);return r?.defs.some(e=>Sj.has(e.type))??!1},SL=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!SB(r.value)?String(r.value):void 0},SN=(e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if(r)return SB(r.value);let n=rJ(rN(e),t);if(n){let e=rN(n),r=eV(e,t.sourceCode.getScope(e));if(r)return SB(r.value);if(SI.has(e.type))return!0}return!SP(rN(e),t)&&SR(((e,t)=>{if("Identifier"!==(e=rN(e)).type)return;let r=eS(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},S$=(e,t)=>!eH(e,t.sourceCode,Sw),SM=(e,t)=>tR(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),SO=(e,t,r)=>n=>{if(rV(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),aL(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},Sq="no-useless-logical-operand",SU=new o([["&&",!0],["||",!1]]),SW=new o([["&&",!1],["||",!0]]),SV=new i(["FunctionExpression","ClassExpression","ObjectExpression"]),S_="prefer-boolean-return",Sz=new i(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function SK(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return SK(t[0])}return e}}let SG=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function SJ(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return Sz.has(e.operator);case"LogicalExpression":return SJ(e.left,t)&&SJ(e.right,t);case"CallExpression":return tK(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let SX="prefer-flat-math-min-max",SY=["min","max"],SH=(e,t)=>tR(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),SQ=(e,t)=>{let r=[];for(let n of e.arguments){if(SH(n,t)){r.push(...SQ(n,t));continue}r.push(n)}return r},SZ="prefer-hoisting-branch-code/start",S0="prefer-hoisting-branch-code/end",S1="prefer-hoisting-branch-code/suggestion",S2=new i(["await using","using"]),S3=(e,t)=>eH(e,t)||function e(t,r){if("TaggedTemplateExpression"===t.type)return!0;for(let n of r.visitorKeys[t.type]??[]){let o=t[n];if(Array.isArray(o)){for(let t of o)if(t&&e(t,r))return!0;continue}if(o&&e(o,r))return!0}return!1}(e,t),S8=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},S6=(e,t,r)=>{let n=S8(e,r),o=S8(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function S9(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function S5({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!rK(e))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return rV(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&rV(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(rV(a,[r,n-1]))return!0}return rV(a,S9(e,i,a))}))&&(o||t.every(e=>!function(e,t,r){let{sourceCode:n}=r,{body:o}=e,[a]=n.getRange(o[o.length-t]),[i,s]=n.getRange(e);for(let t of n.getScope(e).variables){let[e]=t.defs;if(!e||e.parent?.type==="VariableDeclaration"&&"var"===e.parent.kind)continue;let[r]=n.getRange(e.name);if(!(r<=i)&&!(r>=a)){if(e.parent?.type==="VariableDeclaration"&&S2.has(e.parent.kind))return!0;for(let e of t.references){let[t]=n.getRange(e.identifier);if(t>=a&&t<=s)return!0}}}return!1}(e,n,a))),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?SZ:S0};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rR(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1)),i=n.text.slice(o,a),s=rR(e[0],r);return s===t?i:i.split("\n").map((e,r)=>0===r?e:e.startsWith(s)?`${t}${e.slice(s.length)}`:e).join("\n")}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&aL(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
46
- ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&aL(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
47
- ${s}${c}${n}`)}for(let e of t)yield l.removeRange(S9(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(S3(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!S3(e,s))?c.fix=i:c.suggest=[{messageId:S1,fix:i}]}return c}let{parse:S4}=lT,S7="prefer-single-replace",Ce=new i(["g","m","s"]),Ct=new o([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function Cr(e){if(!tR(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(ts(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(tc(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!Ce.has(e))return;try{r=S4(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):("alternative"!==t.type||1!==t.body.length)&&("characterClass"!==t.type||t.negative||1!==t.body.length)?void 0:e(t.body[0])}(r)}}(t.regex)}let Cn="consistent-tuple-labels",Co="no-invalid-well-known-symbol-methods/async-dispose",Ca="no-invalid-well-known-symbol-methods/dispose-generator",Ci="no-invalid-well-known-symbol-methods/sync-iterator",Cs="no-invalid-well-known-symbol-methods/async-iterator",Cl="no-invalid-well-known-symbol-methods/suggestion",Cu=new i(["Promise","PromiseLike"]),Cp=new i(["dispose","iterator","asyncIterator"]);function Cc(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&Cu.has(e.typeName.name)}function Cd(e,t){let r,n=function(e){if(e.computed&&"MemberExpression"===e.key.type&&!e.key.computed&&"Identifier"===e.key.object.type&&"Symbol"===e.key.object.name&&"Identifier"===e.key.property.type)return e.key.property.name}(e);if(!Cp.has(n))return;let o=function(e){if("get"!==e.kind&&"set"!==e.kind&&("MethodDefinition"===e.type||"PropertyDefinition"===e.type||"Property"===e.type))return e.value}(e);if(o?.type!=="FunctionExpression"&&o?.type!=="ArrowFunctionExpression")return;if("dispose"===n&&o.generator)return{node:e.key,messageId:Ca};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?Cc(r):"TSUnionType"===r.type&&r.types.some(e=>Cc(e)))||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker(),n=r.esTreeNodeToTSNodeMap.get(e),o=t.getSignatureFromDeclaration(n);if(o)return!0===oC(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===oC(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:Co,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:Ci};return o.generator&&(t.suggest=[{messageId:Cl,data:{replacement:"asyncIterator"},fix:t=>t.replaceText(e.key.property,"asyncIterator")}]),t}if("asyncIterator"===n&&!o.generator&&(o.async||a))return{node:e.key,messageId:Cs}}let Cm="after-suspension",Cf="in-generator",Cg="in-nested-function",Cy=["preventDefault","stopImmediatePropagation","stopPropagation"],Ch="prefer-abort-signal-timeout",Cx="prefer-abort-signal-timeout/suggestion",Cb=new i(["reason","throwIfAborted"]),CE=(e,t)=>{let r,{parent:n}=e;if(!(!tF(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nG(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tF(n.parent)&&n.parent.object===n&&(r=n.parent,Cb.has(ez(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rL(r);)t=r,r=r.parent;return{expression:t,parent:r}})(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(n)||rV(t,t.sourceCode.getRange(n))))return n},Cv=(e,t,r,n)=>{let o=eS(n.sourceCode.getScope(r),e);return o&&o!==t},CS="prefer-aggregate-error",CC=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,CD=new i(uu);function CT(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rN(e)}function CA(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=CA(e.left);return t?`${t}.${e.right.name}`:void 0}}function Cw(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?Cw(e.typeAnnotation):e}function Ck(e,t,r,n=new i){switch(e=Cw(e),e?.type){case"TSTypeReference":{let o=CA(e.typeName);if(!o)return!1;let a=aM(o,t);if(CD.has(o)&&!((a?.defs.length??0)>0))return!0;if(n.has(o))return!1;n.add(o);let[i]=a?.defs??[],s=i?r.sourceCode.getScope(i.name):t,l=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&Ck(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>Ck(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>Ck(e,t,r,n));default:return!1}}function CI(e,t){let r;if(tF(e=CT(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,CC.test(r))&&nj(e.object,t)&&function(e,t){let r=aM(e.name,t.sourceCode.getScope(e)),[n]=r?.defs??[],o=n?t.sourceCode.getScope(n.name):t.sourceCode.getScope(e);return function e(t,r,n,o=new i){switch(t=Cw(t),t?.type){case"TSArrayType":return Ck(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>Ck("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=CA(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return Ck(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=aM(a,r),[l]=s?.defs??[],u=l?n.sourceCode.getScope(l.name):r,p=l?.type==="Type"&&"TSTypeAliasDeclaration"===l.node.type&&e(l.node.typeAnnotation,u,n,o);return o.delete(a),p}(t,r,n,o);case"TSUnionType":return t.types.every(t=>e(t,r,n,o));case"TSIntersectionType":return t.types.some(t=>e(t,r,n,o));default:return!1}}(n?.name?.typeAnnotation,o,t)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(!(r.isArrayType(t)||r.isTupleType(t)))return!1;let s=r.getTypeArguments(t);return s.length>0&&s.every(e=>(function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);let s=r7(t);return!!(CD.has(s?.getName())&&ne(s,n))||nt(t,r).some(t=>e(t,r,n,o))})(e,r,n))}(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}}(e,t)}(e.object,t))return e.object}let Cj=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&ti(CT(t),0))return!0;let o=(n=CT(n=t),n?.type==="Literal"&&"number"==typeof n.value?n.value:void 0);return void 0!==o&&(r?">"===e&&o>=0||">="===e&&o>=1:"<"===e&&o>=0||"<="===e&&o>=1)},CF=e=>"LogicalExpression"!==(e=CT(e)).type||"&&"!==e.operator?[e]:[...CF(e.left),...CF(e.right)],CB={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},CR=new i(Object.keys(CB)),CP=new i(["globalThis","self","window"]),CL=new i(["getBoundingClientRect","getClientRects"]),CN=new i(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),C$=new i(["innerHeight","innerWidth"]),CM=new i(["height","width"]),CO=new i(["Window"]),Cq=new i(["VisualViewport"]),CU=new i(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),CW=(e,t,r)=>{let n;if(r5.has(e.intrinsicName))return!1;if(r4.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>CW(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CW(o,t,r);let a=r7(e);return!(!a||nt(e,t).some(e=>!CW(e,t,r)))&&(!ne(a,r)||(n=a.getName(),!(CU.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},CV=(e,t,r,n)=>{if(r5.has(e.intrinsicName)||r4.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!r4.has(e.intrinsicName));return o.length>0&&o.every(e=>CV(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>CV(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CV(o,t,r,n);let a=r7(e);return!!(a&&ne(a,r)&&n.has(a.getName()))||nt(e,t).some(e=>CV(e,t,r,n))},C_=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return CV(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},Cz=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return CW(r.getTypeAtLocation(e),n,t)}catch{return!1}},CK=e=>e.computed||"Identifier"!==e.property.type?tu(rN(e.property)):e.property.name,CG=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?tu(rN(e.key)):e.key.name})(e))),CJ=(e,t)=>"Identifier"===e.type&&CP.has(e.name)&&oA(e,t),CX=e=>nG(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),CY=(e,t)=>"Identifier"===(e=rN(e)).type?"visualViewport"===e.name&&oA(e,t):"MemberExpression"===e.type&&"visualViewport"===CK(e)&&CJ(rN(e.object),t),CH=(e,t)=>{var r;return CJ(e=rN(e),t)||("Identifier"===(r=rN(r=e)).type?"document"===r.name&&oA(r,t):"MemberExpression"===r.type&&"document"===CK(r)&&CJ(rN(r.object),t))||CY(e,t)},CQ=(e,t,r)=>{let n=rN(t);return CG(e,C$)&&(CJ(n,r)||C_(t,r,CO))||CG(e,CM)&&(CY(n,r)||C_(t,r,Cq))||CG(e,CN)&&!CH(n,r)&&!Cz(t,r)},CZ=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tw(e))return!1;if(a=e,i=t,tb(a,void 0,ty)&&"MemberExpression"===a.callee.type&&CL.has(CK(a.callee))&&!CH(a.callee.object,i)&&!Cz(a.callee.object,i)||tL(e)&&C$.has(e.name)&&!CX(e)&&oA(e,t)||"MemberExpression"===e.type&&!CX(e)&&(n=CK(e),o=rN(e.object),C$.has(n)&&(CJ(o,t)||C_(e.object,t,CO))||CM.has(n)&&(CY(o,t)||C_(e.object,t,Cq))||CN.has(CK(e))&&!CH(e.object,t)&&!Cz(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?CQ(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&CQ(e.left,e.right,t)))return!0;for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if(Array.isArray(o)){if(o.some(e=>CZ(e,t,r)))return!0;continue}if(CZ(o,t,r))return!0}return!1},C0="prefer-set-methods/union",C1="prefer-set-methods/intersection",C2="prefer-set-methods/intersection-suggestion",C3="prefer-set-methods/difference",C8="prefer-set-methods/difference-suggestion",C6=(e,t)=>tE(e,{name:"Set",argumentsLength:1})&&oA(e.callee,t),C9=(e,t)=>{let r=to(e,t);return it(e,t)&&!ta(e,t)?`(${r})`:r},C5=(e,t,r)=>((e,t)=>{let r=e;for(;r.parent;){if("ExpressionStatement"===r.parent.type)return t.sourceCode.getRange(t.sourceCode.getFirstToken(r.parent.expression))[0]===t.sourceCode.getRange(t.sourceCode.getFirstToken(e))[0];r=r.parent}return!1})(e,r)&&aL(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,C4=(e,t)=>("ParenthesizedExpression"===e.type||rL(e))&&e.expression===t,C7=e=>{for(;e.parent;){let{parent:t}=e;if(C4(t,e)){e=t;continue}break}return e},De=(e,t)=>e?.type==="SpreadElement"&&"Set"===aY(e.argument,t),Dt=(e,t,r)=>{if(!(!tR(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rk(e.arguments[0],t)||rk(e.callee.object,t))&&"Set"===aY(e.callee.object,r))return e.callee.object},Dr=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=C7(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rL(e.parent))return;let o=((e,t)=>{if(!tR(e,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let r=((e,t)=>{if("ArrayExpression"===e.type&&1===e.elements.length&&De(e.elements[0],t))return e.elements[0].argument})(e.callee.object,t);if(!r)return;let[n]=e.arguments;if("ArrowFunctionExpression"!==n.type||n.async||1!==n.params.length||"Identifier"!==n.params[0].type)return;let o=((e,t,r)=>{let n=Dt(e,t,r);if(n)return{method:"intersection",messageId:C1,suggestionMessageId:C2,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=Dt(e.argument,t,r);if(o)return{method:"difference",messageId:C3,suggestionMessageId:C8,otherSet:o}})(n.body,n.params[0],t);if(!(!o||eH(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${C9(r,t)}.${o.method}(${to(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,C5(t,o.replacement,r))}]}},Dn="prefer-toggle-attribute/error",Do="prefer-toggle-attribute/suggestion",Da=(e,t,r)=>{let n=to(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?Da(e.argument,t,!1):(!ta(e,t.sourceCode)&&ia(e,"!")&&(n=`(${n})`),`!${n}`):ta(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},Di=(e,t,r)=>tR(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function Ds(e){if(e?.type==="ChainExpression"&&(e=e.expression),Di(e,["removeAttribute","hasAttribute"],1)||Di(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(tu(r)?.toLowerCase().startsWith("data-"))return;let o=t.property.name;return{node:e,method:o,receiver:t.object,attributeName:r,attributeValue:n,isOptional:!!t.optional,hasEmptyAttributeValue:"setAttribute"!==o||ti(n,"")}}}function Dl(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),Ds(e)}}let Du=(e,t)=>e.isOptional===t.isOptional&&rk(e.receiver,t.receiver)&&rk(e.attributeName,t.attributeName),Dp=(e,t)=>oh(e.receiver)||nz(e.receiver,t),Dc="prefer-url-search-parameters/error",Dd="prefer-url-search-parameters/suggestion",Dm=new i(["node:url","url"]),Df=e=>"Type"===e.type||"ImportBinding"===e.type&&aN(e.node),Dg=(e,t,r)=>{let n=eS(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>Df(e))},Dy=(e,t)=>tu(rN(e))===t,Dh=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},Dx=(e,t)=>{if(!tR(e=rN(e),{method:"map",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let r=((e,t)=>{var r;let n;if(tR(e=rN(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!Dy(e.arguments[0],"&")||of(e.callee.object,t)||(n=eV(r=e.callee.object,t.sourceCode.getScope(r)))&&"string"!=typeof n.value))return e})(e.callee.object,t);if(!r)return;let[n]=e.arguments,o="ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||n.async||n.generator||1!==n.params.length||"Identifier"!==n.params[0].type?void 0:"BlockStatement"!==n.body.type?{parameter:n.params[0],returnExpression:n.body}:1===n.body.body.length&&"ReturnStatement"===n.body.body[0].type&&n.body.body[0].argument?{parameter:n.params[0],returnExpression:n.body.body[0].argument}:void 0;if(o&&((e,t,r)=>{let n;return!!tR(e=rN(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!oT(rN(e.callee.object),t)&&!!Dy(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],eV(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},Db=(e,t)=>`new URLSearchParams(${Dh(e,t)})`,DE=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=tn(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},Dv=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=tn(t,r);return[[n,a],[i,o]]},DS=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=eS(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>Df(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return Dm.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||rU(n,e,r)))return[{messageId:Dd,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:Dc,suggest:a}},DC="no-unsafe-promise-all-settled-values",DD=new i(["PromiseSettledResult","PromiseRejectedResult"]),DT=new i(["PromiseFulfilledResult"]),DA=new i(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Dw=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",Dk=e=>{for(;e&&DA.has(e.type);)e=e.expression;return e},DI=e=>tR(Dk(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),Dj=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,DF=e=>tR(Dk(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function DB(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?DB(e.right):void 0}function DR(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function DP(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DB(t.typeName);return DD.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(DR(e))}function DL(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DB(t.typeName);return DT.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(DR(e))}function DN(e){if(e.isUnion())return e.types.every(e=>DN(e));let t=e.aliasSymbol??e.getSymbol();return DT.has(t?.getName())}function D$(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>D$(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function DM(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let DO=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function Dq(e,t,r=new i){var n;let o;return!!(DO(o=e)&&DP(o.typeAnnotation))||!!(e=Dk(e))&&(n=Dk(n=e),!!(n?.type==="AwaitExpression"&&DI(n.argument)||DP(e.typeAnnotation)||function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D$(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return DD.has(r?.getName())}(a))}(e,t))||(DF(e)?Dq(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=eS(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(DP(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&Dq(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let DU=e=>(e=Dk(e),e?.type==="Identifier"?e.name:void 0),DW=e=>{if(e=Dk(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===ez(t)&&"Identifier"===t.value.type)return t.value}},DV=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function D_(e,t){return e=Dk(e),!!(t.statusVariable&&D0(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&D0(e.object,t.entryVariable,t.context)&&"status"===ez(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&DU(e.object)===t.entryName&&"status"===ez(e))}function Dz(e,t){if(e=Dk(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=D_(e.left,t)?DV(e.right):D_(e.right,t)?DV(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function DK(e,t){return"fulfilled"===Dz(e=Dk(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(DK(e.left,t)||DK(e.right,t))}function DG(e,t){return"unfulfilled"===Dz(e=Dk(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(DG(e.left,t)||DG(e.right,t))}let DJ=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&DK(e.test,r)||e.alternate===t&&DG(e.test,r)),DX=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&DK(e.left,r)||"||"===e.operator&&e.right===t&&DG(e.left,r)),DY=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&DK(e.test,r)||e.alternate===t&&DG(e.test,r)),DH=e=>{let t;if(!Dw(e)||0===e.params.length)return!1;let r={entryName:DU(e.params[0]),statusName:(t=e.params[0],DW(t)?.name)},n=Dk(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&DK(e.argument,r)}return DK(n,r)};function DQ(e){if(e=Dk(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===ez(t))return t}}let DZ=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function D0(e,t,r){return e=Dk(e),e?.type==="Identifier"&&t&&eS(r.sourceCode.getScope(e),e)===t}function D1(e){for(e=Dk(e);DF(e);){if(DH(e.arguments[0]))return!0;e=Dk(e.callee.object)}return!1}function D2(e,t,{knownPromiseSettledResultArray:r=!1,branchAlwaysExits:n}={}){let o,a;if(!tR(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!Dq(e.callee.object,t)||function e(t,r,n=new i){return!!(DO(t)&&DL(t.typeAnnotation)||function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D$(n,o);return!!(a&&DN(a))}(t=Dk(t),r))||("Identifier"===t.type?function(t,r,n){let o=eS(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(DL(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):DF(t)&&D1(t)&&Dq(t,r))}(e.callee.object,t))return;let[s]=e.arguments;if(!Dw(s)||0===s.params.length)return;let[l]=s.params;if(function(e,t){let r=DM(e,t);if(!r)return!1;let{type:n}=r;return DN(n)}(l,t))return;let u=DQ(l);if(u&&"Identifier"!==u.value.type)return{node:u.key,messageId:DC};let p=DU(l),c=p&&eS(t.sourceCode.getScope(l),l),d=(o=DQ(l),a=o?.value,a?.type==="Identifier"?a:a?.type==="AssignmentPattern"&&"Identifier"===a.left.type?a.left:void 0),m=d&&eS(t.sourceCode.getScope(d),d),f=DW(l),g=f?.name,y=f&&eS(t.sourceCode.getScope(f),f),h=function e(t,r){var n;if(n=t=Dk(t),n=Dk(n),(n?.type==="MemberExpression"&&D0(n.object,r.entryVariable,r.context)&&"value"===ez(n)||n?.type==="Identifier"&&D0(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;n&&"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(DJ(n,r,t)||DX(n,r,t)||DY(n,r,t)||function(e,t,r,n){let o,a=e.parent?.body;if(!Array.isArray(a))return!1;let i=a.indexOf(e),s=a[i-1];return s?.type==="IfStatement"&&!s.alternate&&DG(s.test,t)&&(o=s.consequent,aA(o,r,e=>{var t;return t=Dk(t=e),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||n(e)})||af(o,r))}(n,t,t.context,t.branchAlwaysExits))return!0;if(Dj(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||DZ(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||Dw(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(s.body,{entryName:p,entryVariable:c,statusName:g,statusVariable:y,valueVariable:m,context:t,branchAlwaysExits:n});if(h)return{node:h,messageId:DC}}let D3="prefer-abort-signal-any",D8="prefer-abort-signal-any/suggestion",D6=new i(["reason","throwIfAborted"]),D9=new i(["capture","once","passive"]),D5=new i(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),D4=e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]},D7=(e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})},Te=e=>{let t=e,{parent:r}=e;for(;rL(r);)t=r,r=r.parent;return{expression:t,parent:r}},Tt=(e,t)=>{let{parent:r}=e;if(!(!tF(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||nG(r)||("ForInStatement"===r.parent.type||"ForOfStatement"===r.parent.type)&&r.parent.left===r||((e,t)=>{let{expression:r,parent:n}=Te(e);return tF(n)&&n.object===r&&D6.has(ez(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=Te(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||rV(t,t.sourceCode.getRange(r))))return r},Tr=(e,t,r)=>{if(r5.has(e.intrinsicName))return;if(r4.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!r4.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>Tr(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>Tr(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return Tr(n,t,r);let o=r7(e);if(o&&ne(o,r))return"AbortSignal"===o.getName();let a=nt(e,t).map(e=>Tr(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},Tn=(e,t)=>tb(e,{optional:!1},ty)&&tF(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),To=e=>Tn(e,["any","timeout"]),Ta=e=>Tn(e,["any"]),Ti=(e,t)=>{if("Identifier"!==(e=rN(e)).type)return;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},Ts=(e,t)=>{if("Identifier"!==(e=rN(e)).type)return!1;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},Tl=(e,t,r)=>tb(e,{optional:!1},ty)&&tF(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&oA(e.callee.object,r),Tu=(e,t)=>(tb(e,{name:"Array",optional:!1},ty)||tE(e,{name:"Array"}))&&oA(e.callee,t),Tp=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return!1;if(r.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Tp(e,t,r));if(Tl(e,"of",t)||Tu(e,t))return e.arguments.some(e=>Tp(e,t,r));if(Tl(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=Ti(n,t);if(o)return!!(!nj(o,t)||Ts(n,t))||Tp(o,t,r);let a=rN(n);return"ArrayExpression"!==a.type||Tp(a,t,r)}if(Ta(e))return e.arguments[0]&&Tp(e.arguments[0],t,r);let n=Ti(e,t);return n?!!(nj(n,t)&&Ts(e,t))||Tp(n,t,r):Tn(rN(e),["abort"])},Tc=(e,t,r,n=new i)=>{var o;if(e=rN(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Tc(e,t,r,n));if(Tl(e,"of",r)||Tu(e,r))return e.arguments.some(e=>Tc(e,t,r,n));if(Tl(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=Ti(o,r);if(a)return!!(!nj(a,r)||Ts(o,r))||Tc(a,t,r,n);let i=rN(o);return"ArrayExpression"!==i.type||Tc(i,t,r,n)}if(Ta(e))return e.arguments[0]&&Tc(e.arguments[0],t,r,n);let a=Ti(e,r);return a?!!(nj(a,r)&&Ts(e,r))||Tc(a,t,r,n):tF(o=rN(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},Td=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return Tr(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rN(e),t);if(!0===r)return!0;if(!1===r||t.sourceCode.parserServices?.program)return!1;if("Identifier"===e.type){let t;return"signal"===(t=e.name)||t.endsWith("Signal")}return To(e)},Tm=(e,t)=>"Identifier"===(e=rN(e)).type?Td(e,t):To(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!eH(e,t.sourceCode)),Tf=(e,t)=>{if(!Tl(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rN(r);if("ArrayExpression"===n.type)return n;let o=Ti(r,t);if(o&&nj(o,t)&&!Ts(r,t))return o},Tg=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(e=>e&&"SpreadElement"!==e.type)?e.elements:void 0;if(Tl(e,"of",t)||Tu(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=Tf(e,t);if(n)return Tg(n,t,r);let o=Ti(e,t);if(o&&nj(o,t)&&!Ts(e,t))return Tg(o,t,r)},Ty=(e,t,r=new i)=>{if(e=rN(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||Tl(e,"of",t)||Tu(e,t))return!0;let n=Tf(e,t);return!!n&&Ty(n,t,r)},Th=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Th(e.right):void 0,Tx=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Tx(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=Th(n.typeName);if("AbortSignal"===o)return!0;if(!o||"Identifier"!==n.typeName.type||r.has(n.typeName.name))return!1;r.add(n.typeName.name);let a=eS(t.sourceCode.getScope(n),n.typeName),s=a?.defs[0],l=s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&Tx(s.node.typeAnnotation,t,r);return r.delete(n.typeName.name),l},Tb=(e,t,r=new i)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?Tb(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?Tb(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?Tx(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>Tx("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=Th(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return Tx(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=eS(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=Tb(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,TE=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return TE(e.typeAnnotation,t,r);if(e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===Th(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=eS(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&TE(o.node.typeAnnotation,t,r)},Tv=(e,t,r,n=new i)=>{if(!e||r5.has(e.intrinsicName)||r4.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>Tv(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Tv(o,t,r,n);let a=r7(e);if(a&&ne(a,r)&&"ReadonlyArray"===a.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||nt(e,t).some(e=>Tv(e,t,r,n))},TS=(e,t)=>{if(D5.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===Th(r.typeName)||TE(e.typeAnnotation,t)||TS(e.expression,t)}if("Identifier"!==(e=rN(e)).type)return!1;let r=eS(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&TE(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&TS(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return Tv(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},TC=(e,t,r=new i)=>{if(r.has(e))return!1;if(r.add(e),D5.has(e.type))return Tb(e.typeAnnotation,t)??TC(e.expression,t,r);if("Identifier"===(e=rN(e)).type){let n=eS(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=Tb(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&TC(o.node.init,t,r))return!0}return nj(e,t)},TD=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(tb(s,{optional:!1},ty)&&tF(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tF(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rN(o),a=rN(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&eS(n.sourceCode.getScope(o),o)===eS(n.sourceCode.getScope(a),a)))))return s.callee.object},TT=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tb(r,{minimumArguments:2,maximumArguments:3,optional:!1},ty)&&tF(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===tu(rN(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rN(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return D9.has(t)})))return{call:r,sourceSignal:r.callee.object}},TA=(e,t)=>!rV(t,t.sourceCode.getRange(e))&&!rW(t,e),Tw=(e,t,r,n)=>{let o=eS(n.sourceCode.getScope(r),e);return o&&o!==t},Tk="prefer-block-statement-over-iife",TI=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,Tj=(e,t)=>e!==t&&tw(e),TF=(e,t)=>Tj(e,t)&&"ArrowFunctionExpression"!==e.type;function TB(e,t,r,n=Tj){return function o(a){if(r(a))return!0;if(n(a,e))return!1;for(let e of t[a.type]??[]){let t=a[e];for(let e of Array.isArray(t)?t:[t])if(e?.type&&o(e))return!0}return!1}(e)}let TR=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,eA(o)?t.getRange(o)[1]:n]},TP="no-multiple-promise-resolver-calls",TL=e=>rL(e)||e?.type==="TSInstantiationExpression",TN=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type;function T$(e){for(;TL(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function TM(e){for(;TL(e);)e=e.expression;return e}let TO=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=T$(e);return tE(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&oA(r.parent.callee,t)},Tq=e=>e.references.some(e=>e.isWrite()),TU=(e,t)=>{if("CallExpression"!==e.type)return;let r=TM(e.callee);return"Identifier"===r.type?t.get(r):void 0},TW=(e,t)=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&0===e.expression.arguments.length&&!!TU(e.expression,t);function TV(e){let t=[];return e.traverseSegments(e=>{e.reachable&&t.push(e)}),t}let T_=({isTerminated:e=!1,resolverUncalled:t=!1,resolverCalled:r=!1,catchClausesAfterResolverCall:n=new i,pendingFinallyBlocksByCatchClause:a=new o}={})=>({isTerminated:e,resolverUncalled:t,resolverCalled:r,catchClausesAfterResolverCall:n,pendingFinallyBlocksByCatchClause:a}),Tz=e=>T_({isTerminated:e.isTerminated,resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new i(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new o;for(let[r,n]of e)t.set(r,new i(n));return t}(e.pendingFinallyBlocksByCatchClause)}),TK=(e,t,r)=>{if(e.isTerminated)return e;if(t.executor===r){let r=Tz(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=Tz(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new i,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function TG(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let TJ=(e,t)=>void 0!==t&&e.isTerminated===t.isTerminated&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&TG(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!TG(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function TX(e){let t=[],r=e,{parent:n}=e;for(;n&&!tw(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}function TY(e,t,r){let n=T_({isTerminated:e!==r.codePath.initialSegment,resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.terminatedSegments.has(t)||e.isTerminated||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return T_({isTerminated:!0});let o=n.catchClausesBySegment.get(r);return o?T_({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??T_(),o,e,r);if(!a.isTerminated){for(let e of(n.isTerminated=!1,n.resolverUncalled||=a.resolverUncalled,n.resolverCalled||=a.resolverCalled,a.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of a.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let o of(r||(r=new i,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(o)}}}return n}let TH=e=>{let t=TM(e.test);return t?.type==="Literal"&&!t.value},TQ=e=>{let t=T$(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t};function TZ(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&TO(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}let T0=(e,t,r)=>"SequenceExpression"===e.type&&e.expressions.includes(t)||"LogicalExpression"===e.type&&e.left===t||"BinaryExpression"===e.type&&(e.left===t||e.right===t)||"UnaryExpression"===e.type&&e.argument===t||"AwaitExpression"===e.type&&e.argument===t||"ConditionalExpression"===e.type&&aA(e,r,TN)||TL(e)&&e.expression===t||"CallExpression"===e.type&&(e.callee===t||e.arguments.includes(t)&&!e.optional&&!oZ(e.callee))||"NewExpression"===e.type&&(e.callee===t||e.arguments.includes(t))||"MemberExpression"===e.type&&(e.object===t||e.computed&&e.property===t&&!e.optional&&!oZ(e.object)),T1=(e,t)=>af(e,t),T2=(e,t)=>"class-static-block"===e.origin||"class-field-initializer"===e.origin&&t.parent?.type==="PropertyDefinition"&&t.parent.value===t&&t.parent.static,T3="no-unnecessary-string-trim",T8=["startsWith","endsWith"],T6=new i(["bigint","boolean","number","string","undefined"]),T9=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),T5=(e,t)=>eV(e=rN(e),t.sourceCode.getScope(e)),T4="no-useless-re-export",T7=e=>"Identifier"===e.type?e.name:e.value;function Ae(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let At="preferGuard",Ar="preferFallback",An="guard",Ao="fallback",Aa=["keys","values","entries"],Ai=e=>{if("ForInStatement"===e.type)return;let t=rN(e.right);if(tR(t,{object:"Object",methods:Aa,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return t},As=e=>Ai(e)?.arguments[0]??e.right,Al=e=>"ForInStatement"===e.type||!!Ai(e),Au={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},recommended:{...c.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return Au}},rules:Object.assign({"sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended),{"sukka/prefer-single-boolean-return":"off"})},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-array-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"error","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"warn","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":["warn",{preferThis:!1,preferSuper:!1}],"sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"error","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"error","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"error","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"error","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"error","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn","sukka/unicorn/no-invalid-well-known-symbol-methods":"error","sukka/unicorn/no-late-event-control":"error","sukka/unicorn/prefer-abort-signal-timeout":"warn","sukka/unicorn/prefer-aggregate-error":"warn","sukka/unicorn/prefer-observer-apis":"warn","sukka/unicorn/prefer-set-methods":"warn","sukka/unicorn/prefer-toggle-attribute":"warn","sukka/unicorn/prefer-url-search-parameters":"warn","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"error","sukka/unicorn/no-useless-re-export":"warn","sukka/unicorn/iteration-fallback-style":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return Au}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn","sukka/unicorn/default-export-style":"warn"}},recommended_extra_with_typed_lint:{...c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return Au}},rules:Object.assign({"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/require-project-reference":"off","sukka/no-default-error":"off","sukka/unicorn/consistent-tuple-labels":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint))},recommended_react:{...c.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return Au}}}},rules:Object.assign(c.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":N,"browser/prefer-location-assign":M,"jsx/no-template-literal":q,"jsx/no-unneeded-nested":U,"string/no-locale-case":V,"string/no-simple-template-literal":_,"unicode/no-bidi":H,"unicode/no-invisible":Z,"no-redundant-variable":ee,"no-single-return":er,"prefer-early-return":eo,"prefer-fetch":ea,"prefer-timer-id":el,"string/no-unneeded-to-string":eu,"type/no-force-cast-via-top-type":ep,"type/no-wrapper-type-reference":ed,"no-default-error":em,"require-project-reference":ey},Object.fromEntries(Object.entries({"unicorn/catch-error-name":{create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>v.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(iy(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(tR(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tR(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(o(n)||o(n.replaceAll(/_+$/g,"")))return;let a=eS(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=rS(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:d0,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>i0(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:d1,defaultOptions:[{name:"error",ignore:[]}],messages:{[d0]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>mm(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return mm(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name){let t=e.right;if("ClassExpression"!==t.type||!mt(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:d2,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[d2]:"Exported error name should match error class",[d3]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[d8]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[d6]:"Error constructors should accept `options` as the second parameter.",[d9]:"Error constructors should use `options` as the second parameter.",[d5]:"Pass the error message to `super()` as the first argument.",[d4]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||ta(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:ix}:void 0:{node:t,messageId:ib,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[ix]:"Do not nest ternary expressions.",[ib]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(iv.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&iS(e.parent.parent)&&iC(e.parent.parent.parent.init))||!!(iS(e)&&tF(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&iC(e.parent.init.object))}(eS(r,t)?.defs[0]?.name))return{node:t,messageId:iE}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[iE]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(iw.has(t.name)){for(let r of iB(e,t))if(r.references?.some(e=>iF(t,e.identifier)))return iR(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&iw.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of iB(e,t))if(iL(t.key,r))return iR(t.key,r);for(let r of iB(e,t))if(iP(t.key,r))return iR(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[iT]:"Use `.key` instead of `.{{name}}`.",[iA]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tF(t,{property:"innerText"})||nz(t.object,e))return;let r=t.property;return{node:r,messageId:iN,suggest:[{messageId:i$,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(nz(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&nz(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&nz(r.right,t)})(t.parent.parent,e))return{node:t,messageId:iN,suggest:[{messageId:i$,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[iN]:"Prefer `.textContent` over `.innerText`.",[i$]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"join",argumentsLength:0,optionalCall:!1})||tR(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tU(t.callee.object,{property:"join"}))||0===t.arguments.length&&nL(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:i3,fix:r=>iO(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[i3]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of i7)e.on(t??r,function*(t){for(let r of o(t,e))yield{node:r,messageId:n}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[i8]:"Do not add `then` to an object.",[i6]:"Do not export `then`.",[i9]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tR(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eR(r,e.sourceCode),messageId:se}:{node:r.callee.property,messageId:se}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[se]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":sl,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tE(r,{name:"Buffer"}))return;let n=((e,t)=>{if(1!==e.length)return"from";let[r]=e;if("SpreadElement"===r.type)return;if("ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";if(n2(r,t))return"alloc";let n=eV(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(r.arguments,t.getScope(r));return n?{node:r,messageId:su,data:{method:n},fix:sd(r,e,n)}:{node:r,messageId:sp,suggest:["from","alloc"].map(t=>({messageId:sc,data:{replacement:t},fix:sd(r,e,t)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[su]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[sp]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[sc]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:ic(l,e),messageId:sm,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tR(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!ts(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&sf(o)&&(yield r(i,n,"leading")),e!==a-1&&sg(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[sm]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":sh,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tD(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:sx,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=ta(i,e),[,l]=s?tn(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield iM(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[sx]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new i,n=new i,o=(t,r,n)=>tR(t,{method:r,optionalCall:!1,optionalMember:!1})&&rk(n.left.object,t.callee.object)&&!nB(t.callee.object,e);e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tF(e.left,{property:"length",optional:!1})&&tW(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("LogicalExpression",e=>{tW(e)&&t.push(e)}),e.on("Program:exit",function*(){let a=new i(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,a,i)=>(function({node:e,operator:t,siblings:a}){return"||"===t&&r.has(e)&&a.some(t=>o(t,"every",e))||"&&"===t&&n.has(e)&&a.some(t=>o(t,"some",e))})({node:e,operator:t,siblings:[i[a-1],i[a+1]].filter(Boolean)}))})(e))),{sourceCode:s}=e;for(let t of a)yield{loc:{start:s.getLoc(t.left.property).start,end:s.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=tn(n,e),i=tn(o,e),s=[];return n===t?(s[0]=a[0],s[1]=i[0]):(s[0]=a[1],s[1]=i[1]),r.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{let{expression:r,parent:n}=sb(t);if(!(tR(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tw(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=sb(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=sb(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?tn(e,a):o&&"YieldExpression"===t.type?tn(t,a):"ArrowFunctionExpression"===t.type?o?tn(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!rU(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=sE(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(tn(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(tn(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(tn(e,r),(n=sE(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>a5(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{e.on("Literal",t=>{if(!tp(t))return;let{raw:r}=t,n=r.match(/^(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!n)return;let{before:o,dotAndFractions:a,after:i}=n.groups,s=(o+a.replaceAll(/[.0_]+$/g,"")||"0")+i;if(s===r)return;let l="."===a,{sourceCode:u}=e,p=u.getRange(t)[0]+o.length+a.length;return{loc:ic([p-(r.length-s.length),p],e),messageId:l?sS:sv,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&a7.test(s)&&!ta(t,e)&&(n=`(${n})`,aL(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield iG(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[sv]:"Don't use a zero fraction in the number.",[sS]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":sF,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tA,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){if(("ArrowFunctionExpression"===e.type&&"Identifier"===e.body.type&&e.body.name===e.params[0].name||"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&e.body.body[0].argument?.type==="Identifier"&&e.body.body[0].argument.name===e.params[0].name)&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&sP.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e){let t,r=(t=e.params[0].name,"ArrowFunctionExpression"===e.type&&sL(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&sL(e.body.body[0].argument,t)?e.body.body[0].argument:void 0);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=t=>{let r=n;return"Property"===e.parent.type&&e.parent.method&&e.parent.value===e?r=`: ${r}`:"MethodDefinition"===e.parent.type&&(r=` = ${r};`),t.replaceText(e,r)}),o}(t);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eR(t,n),messageId:sB,data:{functionNameWithKind:eK(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||(r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",messages:{[sB]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){sq.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[sO]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":s_,"unicorn/prefer-array-index-of":sH,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tR(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:sQ,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[sQ]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tR(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&s2(e.callee.object)){let t=e.callee.property;return s3(e,{node:t,messageId:s0,data:{method:t.name}})}if(tb(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},ty)&&s2(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?s3(e,{messageId:s1}):s3(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&s2(t.argument))return s3("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&s2(e.right))return s3(e.right)}),e.on("BinaryExpression",function*(e){if("-"===e.operator||"*"===e.operator||"/"===e.operator||"%"===e.operator||"**"===e.operator)for(let t of[e.left,e.right])s2(t)&&(yield s3(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[sZ]:"Prefer `Date.now()` over `new Date()`.",[s0]:"Prefer `Date.now()` over `Date#{{method}}()`.",[s1]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":ln,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tR(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=lp(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rk(e.left,e.right)||"**"===e.operator&&ti(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new i(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:lo,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(a){let{sourceCode:i}=e;for(let r of(yield a.replaceText(t.callee.property,n),o)){let t=i.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield i2(t,",",a,e),yield iM(r,a,e)}for(let t of r)yield a.removeRange([tn(t.left,e)[1],i.getRange(t)[1]])}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of lu){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[lo]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":lm,"unicorn/prefer-number-properties":lb,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let{sourceCode:r}=e,n=((e,t)=>{if("apply"===ez(e.callee)&&2===e.arguments.length&&lv(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,lS(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===ez(e.callee)&&"apply"===ez(e.callee.object)&&"prototype"===ez(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&lv(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,lS(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:lE,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[lE]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tF(t,{property:"length",optional:!1}))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:tR(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&nq(n,e))return{node:t.property,messageId:lC,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);it(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield iG(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[lC]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,o=((e,t)=>{let r;if(!tR(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tR(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(of(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=tu(o);if("string"==typeof i){if(0===i.length)return;r=tQ(i)}else if(!(r=(e=>{if(!tc(e)||e.regex.flags.includes("y"))return;let t=lM(e);if(!t||lU(t)||0===lq(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=tu(a);if("string"==typeof s)return`${to(n.callee.object,t)}.replaceAll(${r}, ${tQ(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:lF,fix:e=>e.replaceText(t,o)};if(!tR(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tR(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&tc(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new i,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!lw.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&ts(n=t.arguments[1])&&n.value===lA)return;let{arguments:a,callee:{property:s}}=t;if(of(t.callee.object,e))return;let[l]=a;if(!((e,t)=>{if(tc(e))return e.regex.flags.includes("g");if(tE(e,{name:"RegExp"})&&e.arguments[0]?.type!=="SpreadElement"&&e.arguments[1]?.type==="Literal"&&"string"==typeof e.arguments[1].value)return e.arguments[1].value.includes("g");let r=eV(e,t);if(!r)return!1;let{value:n}=r;return"[object RegExp]"===Object.prototype.toString.call(n)&&n.global})(l,e.sourceCode.getScope(l)))return;let u=s.name,p=function(e){if(!tc(e))return;let t=lM(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(lB.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?l$(t.body):lN(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:lj,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:lI,*fix(e){yield e.insertTextAfter(s,"All"),p&&(yield e.replaceText(l,p))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[lI]:"Prefer `String#replaceAll()` over `String#replace()`.",[lj]:"This pattern can be replaced with {{replacement}}.",[lF]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["substr","substring"]})||of(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tR(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(lW(t)&&lW(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&ti(e.right,1))return e.left})(t);return lV(r,t)??(lV(t,r)?r:void 0)??(n&&rk(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let{sourceCode:s}=r,l=eV(a,s.getScope(e)),u=tn(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(tp(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!lz(e.left)||!("Identifier"===t.type||ts(t))||!rk(e.left.object,t)||(o=((e,t)=>{let[r,n]=tn(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r),a.getAllComments().some(e=>{let t=a.getRange(e);return t[0]>=o[0]&&t[1]<=o[1]}))))return`-${e.right.raw}`})(i,e.callee.object,r);if(n)return void(yield iU(t,i,n,r));if(tp(i)||lz(i))return;let o=l_(i);return"number"==typeof o?void(yield iU(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>tp(e))){let e;return void(yield(e=String(a.value+i.value),iU(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?l_(o):void 0;if(!a){if(lz(o))return;if(void 0!==i)return void(yield iU(t,o,String(Math.max(0,i)),r));let e=tn(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=l_(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield iU(t,o,String(e[0]),r)),e[1]!==s&&(yield iU(t,a,String(e[1]),r));return}if(0===i||0===s){let e=to(o,r),n=to(a,r);yield iU(t,o,"0",r),yield iU(t,a,`Math.max(0, ${0===i?n:e})`,r);return}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||of(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:lK,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[lK]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!ta(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:ic(tn(r,e),e),messageId:lG};return!function(e,t){let{sourceCode:r}=t,[n,o]=tn(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:lJ,fix:t=>t.replaceTextRange(tn(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[lG]:"IIFE with parenthesized arrow function body is considered unreadable.",[lJ]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type)return;let{callee:r}=t;if(!(t.optional||r3(r))&&("Identifier"===r.type&&lY.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&lY.test(r.property.name))&&!tF(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:lX,fix:r=>iJ(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[lX]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("Literal",e=>{if(ts(e))return l1({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(tc(e))return l1({node:e,original:e.raw,regex:l0,lowercase:t})}),e.on("TemplateElement",r=>{if(!tO(r.parent))return l1({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>i1(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[lH]:"Use uppercase characters for the value of the escape sequence.",[lQ]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>ts(e)?ui(e,e.raw):tc(e)?function(e){let t,{raw:r}=e,{pattern:n,flags:o}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:i,hasReplacement:s}=ua(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),l=o.includes("u")||o.includes("v"),u=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(l8,t))return;let n=t+l8.length;for(;r=e[n],l6.test(r);)n++;if(n===t+l8.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+l8.length,n),16);if(!(o>1114111))return o}(e,t)&&l7(e,t))return!0;return!1}(n);if(!s&&(l||!u))return;let p=`/${s?i:n}/${us(o)}`;return l?{node:e,messageId:l2,fix:t=>t.replaceText(e,p)}:!function(e,t){try{return new a(e,t),!0}catch{return!1}}(s?i:n,us(o))?{node:e,messageId:l2}:{node:e,messageId:l2,suggest:[{messageId:l3,fix:t=>t.replaceText(e,p)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tO(t.parent))return ui(t,t.value.raw,(r,n)=>i1(t,n,e,r))})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l2]:"Prefer Unicode code point escapes.",[l3]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new s;for(let{node:e,path:r}of new e5(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(ul.map(e=>[e,{[e5.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tR(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tR(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tF(e,{optional:!1}))return;let n=e.object;if(tC(n)||tD(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:ez(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r){if(o)return void(yield r.replaceText(n,`${a}.prototype.${i}`));if(tF(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield iG(r,e,t))}}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tb(t,{names:uu,optional:!1},tx)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=um.has(r)?um.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:up,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:ud};let i=eV(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:ud}:""===s?{node:a,messageId:uc}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[up]:"Pass a message to the `{{constructorName}}` constructor.",[uc]:"Error message should not be an empty string.",[ud]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":uS,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tE(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&uj(t.test)))return;let r=e.argument.callee;return{node:r,messageId:uC,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[uC]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,r=new o,n=[],a=[],i=e=>{let r=rN(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);a.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?eS(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?uP(r):void 0,start:t.getRange(e)[0],scope:n})},s=e=>{switch(e.type){case"MemberExpression":i(e);break;case"AssignmentPattern":s(e.left);break;case"RestElement":s(e.argument);break;case"ObjectPattern":for(let t of e.properties)s("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&s(t)}};e.on("AssignmentExpression",e=>{s(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&s(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("VariableDeclarator",e=>{let n;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(n=e.init).type||"ThisExpression"===n.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&eS(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?uP(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let l=e=>{let n,o;if((o=e).computed||tb(o.parent,void 0,tx)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||nG(o))return;let i=rN(e.object),s=r.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&eS(l,u),c="ThisExpression"===i.type?uP(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(u$({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})&&(n=uN(r.objectPattern.properties.filter(e=>uL(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!uq(n);){if(uO(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type)return{node:e,messageId:uF};let m=t.getText(e),f=n.value.name;return{node:e,messageId:uF,suggest:[{messageId:uB,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=l(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[uF]:"Use destructured variables over properties.",[uB]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{uK.listen({context:e}),uG.listen({context:e}),uJ.listen({context:e}),uX.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[uV]:"Use `String(new Date())` instead of `Date()`.",[u_]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":u1,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tR(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tN(e)&&u3(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&u3(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tR(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:u2}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[u2]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,accessibility:a,decorators:i,key:s}=e;return(!!pn(e)||"MethodDefinition"===e.type)&&!!r&&!t&&"PrivateIdentifier"!==s.type&&!(n||o||void 0!==a||Array.isArray(i)&&i.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:pt,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body)if(pn(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tX(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r)if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,""),yield i_(a,t,n);else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);tX(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield i_(o,t,r);let a=pn(e)?n.getLastToken(e):n.getTokenAfter(e),i=eA(a);if(pn(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,pr);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[pt]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":pi,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tb(r.parent.parent,void 0,tx)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:ps,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:pb[a]}};return"NewExpression"===a&&px(r)&&tE(n.parent,{names:pg,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield iM(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eT(u)&&(yield i.remove(u)),tC(r)||tD(r)){let e=t.getTokenAfter(n);eT(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return eT(e)?e:void 0}let a=t.getTokenAfter(e||s,eT);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!tR(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:pd};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:pf,fix:t=>t.replaceText(r,r.properties.map(t=>to(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tE(e,{names:pg,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:pc,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!px(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tE(r,{names:pg,argumentsLength:1})||tE(r,{names:r9,minimumArguments:1})||tR(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{objects:["Array",...r9],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=pl;switch(r.type){case"ForOfStatement":o=pu;break;case"YieldExpression":o=pp;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>pE(r,t,e)}}),e.on("ArrayExpression",t=>{if(!px(t))return;let r=t.elements[0].argument,n=!!tR(r,{methods:ph,optionalCall:!1,optionalMember:!1})&&nj(r.callee.object,e)&&nj(r,e);if(!n&&!(!nF(r,e)&&(tR(r,{methods:py,optionalCall:!1,optionalMember:!1})?!pv(r,e):tR(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||pv(r,e)):tR(r,{method:"split",optionalCall:!1,optionalMember:!1})||tR(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tR(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tR(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tE(r,{name:"Array"}))))return;let o={node:t,messageId:pm};return tE(r,{name:"Array"})||tR(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>pE(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ps]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[pl]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[pu]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[pp]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[pc]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[pd]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[pm]:"Unnecessarily cloning an array.",[pf]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rQ(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!pD(o))break;t&&pT(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ew);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:pS,suggest:[{messageId:pC,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[pS]:"Useless case in switch statement.",[pC]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":pz,"unicorn/numeric-separators-style":pX,"unicorn/prefer-array-find":ci,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&tR(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tM(r.callee.object,cp)||nL(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=rU(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield iH(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:cs,fix:a}}),e.on("CallExpression",t=>{let r;if(!tR(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tR(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||r3(n.callee.object)||nB(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!cd(a)||!cd(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!oT(s,l))return;let u=function(e,t){if(ta(e,t))return to(e,t);let r=t.sourceCode.getText(e);return it(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(ta(e,t))return to(e,t);let r=t.sourceCode.getText(e);return cc.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:cl,suggest:[{messageId:cu,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cs]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[cl]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[cu]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":cv,"unicorn/prefer-array-some":cT,"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=(e,n,o,a)=>{let i,s=r.at(-1);if(!s||!n||!o||"Identifier"!==n.type||"LogicalExpression"!==o.type||"||"!==o.operator&&"??"!==o.operator||"Identifier"!==o.left.type||"Literal"!==o.right.type)return;let{name:l}=n,{left:{name:u},right:{raw:p}}=o;if(a&&l!==u)return;let c=eS(t.getScope(e),u);if(!c)return;let{references:d}=c,{params:m}=s,f=m.find(e=>"Identifier"===e.type&&e.name===u);if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(cI(e,n))return!0}return!1})(t,s,e)||a&&d[0].identifier!==n||!a&&d.length>1||(i=m.at(-1),!f||f!==i))return;let g=((e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r),o=e.getTokenAfter(r);return!o||!n||"("!==n.value||")"!==o.value})(t,s)?`(${l} = ${p})`:`${l} = ${p}`;return{node:e,messageId:cA,suggest:[{messageId:cw,fix:r=>[r.replaceText(f,g),((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)]}]}};e.on(tA,e=>{r.push(e)}),e.onExit(tA,()=>{r.pop()}),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return n(e.parent,e.left,e.right,!0)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&e.parent.declarations[0]===e)return n(e.parent,e.id,e.init,!1)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters over reassignment.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cA]:"Prefer default parameters over reassignment.",[cw]:"Replace reassignment with default parameter."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r,i=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=cO(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=cO(e.left),o=cO(e.right);if(n&&o&&cN(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&cq(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&cq(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||t.sourceCode.getCommentsInside(e).length>0)return;let{reference:i}=a;if(a.isTrueWhenNullish&&cN(i,o,t.sourceCode))return c$({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&cN(i,n,t.sourceCode))return c$({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tq(s)||!tF(l)||l.optional||!rk(rN(i),rN(l.object))||function(e){let t=e,{parent:r}=t;for(;rL(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=rX(e,t);if(rV(t,n))return;let[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);if(u)return{node:e,messageId:cF,suggest:[{messageId:cR,fix(r){let n=u;return aL(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(cN(n,o,t)?c$({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&cN(n.argument,a,t)?c$({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cj]:"Prefer using a logical operator over a ternary.",[cF]:"Prefer using optional chaining over a ternary.",[cB]:"Switch to `{{operator}}` operator.",[cR]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?cU:cW,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tX(t,{test:ek,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tX(o,{test:eI,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[cU]:"Remove unused catch binding `{{name}}`.",[cW]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":du,"unicorn/prefer-set-has":dC,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!ts(t)||function(e){let{parent:t}=e,{type:r}=t;return tv(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||dD(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=dw(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:dT,*fix(r){yield iG(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||dw(t)!==e)||dD(t)))return{node:t,messageId:dT,*fix(r){for(let n of(yield iG(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield i1(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tF(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/\r?\n/.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:dA,*fix(r){let n=a.getTokenBefore(t);aL(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||oS(n,t.quasi,e)||ta(t,e)||(yield iV(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||oS(n,t.quasi,e)||ta(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield iM(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[dT]:"`String.raw` should be used to avoid escaping `\\`.",[dA]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":dP,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:dL,fix:r=>iO(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[dL]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new i,r=[e.ast];for(;r.length>0;){let n=r.pop();if(n){if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}for(let t of e.visitorKeys[n.type]??[]){let e=n[t];Array.isArray(e)?r.push(...e):r.push(e)}}}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let o=new l,a=a=>{let i;if("TemplateLiteral"!==a.type||o.has(a))return;o.add(a);let s="__PLACEHOLDER__"+Math.random(),l=a.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(a),d=t.lines[c.start.line-1].match(/^(\s*)\S/),m=d?d[1]:"";i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return dU(dV(e.lines,t)).indent||dU(dN(r=dV(n.split(/\r?\n/)))).indent||dU(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=dN(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+d$(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:dW,fix:t=>g.split(s).map((r,n)=>i1(a.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(dD(e)||r.tags.length>0&&tO(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tM(e.parent.callee,r.functions))})(e))return a(e)}),e.on(r.selectors,e=>a(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:d_,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[dW]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{object:"Promise",methods:u5,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:u8,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tT(t.parent.parent)))return n.fix=r=>r.replaceText(t,u4(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(u7(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&pe(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&pe(t.left)&&tT(t.parent)?t.left:void 0})(n);if(o){if(u7(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,u4(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&ti(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!u7(r,a))return r=>r.replaceText(a,`await ${u4(e,t)}`)})(t,e),n):(n.suggest=[{messageId:u6,fix:r=>{let[n]=t.arguments[0].elements,o=to(n,e);return ta(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),aL(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:u9,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),eT(i)&&(yield e.remove(i))}}],n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[u8]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[u6]:"Use the value directly.",[u9]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tR(t,{object:"Promise",methods:dG,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements)r?.type==="AwaitExpression"&&(yield{node:r,messageId:dz,data:{method:t.callee.property.name},suggest:[{messageId:dK,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield i_(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dz]:"Promise in `Promise.{{method}}()` should not be awaited.",[dK]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&dY.has(t.operator)&&dH(n))||dH(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:dJ,suggest:[{messageId:dX,data:{operator:i},*fix(s){yield iG(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!ta(t,e)&&(oS(o.getFirstToken(u),l,e)||(yield iV(s,u,e))),yield s.remove(a),aL(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dJ]:"Negated expression is not allowed in equality check.",[dX]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){dQ(e,{methods:["slice"],messageId:dZ})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[dZ]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(mg(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&mg(t.parent.parent)&&t.parent.parent.consequent===t.parent||mg(t.parent)&&t.parent.consequent===t))return{node:t,messageId:mf,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...my(i,r)},l={...e,...my(e,r)},u=mE(s,r),p=mv(s,t,r),c=mb(mx(mE(l,r)),mv(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(eB(a)){let t=n.getTokenAfter(e);t&&aL(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?mx(mh(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?mx(mh(s.openingBraceToken,l.ifToken,r)):mx(mh(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?mx(mh(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:mx(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:mx(mb(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=mh(t.closingParenthesisToken,t.openingBraceToken,n),r=mh(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=mh(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[mf]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!tp(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rD(t,e);if(!(n.commentsExistBetween(o,a)||nL(t.callee.object,e)))return{node:r,messageId:mS}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[mS]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:mC,*fix(n){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield iM(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r){let n="IfStatement"===t.type,[o,a]=[t.consequent,t.alternate].map(e=>{let t=tn(e,r),o=r.sourceCode.text.slice(...t);return n&&"BlockStatement"!==e.type&&(o=`{${o}}`),{range:t,text:o}});if(o.text===a.text)return;let{sourceCode:i}=r;yield e.replaceTextRange(i.getRange(o),a.text),yield e.replaceTextRange(i.getRange(a),o.text)}(n,t,e),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield iG(n,t,e);let{sourceCode:o}=e,{parent:a}=t,[i,s]=o.getFirstTokens(r,2);"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type||a.argument!==t||oS(i,s,e)||ta(t,e)||ta(r,e)?aL(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield iV(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[mC]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{if(!("ObjectExpression"===e.right.type&&e.right.properties.length>0&&tw(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:mD,data:{parameter:t.name}}:{node:r,messageId:mT}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[mD]:"Do not use an object literal as default for parameter `{{parameter}}`.",[mT]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{e.on("CallExpression",t=>{if("MemberExpression"!==t.callee.type)return;let r=function(e){let{callee:t,arguments:r}=e,n=t.property.name,o=t.object,a=r;if(mw.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=mk(t.object),!mw.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=mw.get(n),l=t.object.object;if(tC(l)||"slice"===n&&ti(l,"")||"prototype"===mk(l)&&"Identifier"===l.object.type&&s.has(l.object.name)){if([o]=r,i){let[,e]=r;if(!e||"ArrayExpression"!==e.type)return;a=e.elements}else a=r.slice(1);return{method:n,target:o,argumentsNodes:a}}}(t);if(!r)return;let{method:n,target:o,argumentsNodes:a}=r,{argumentsIndexes:i}=mw.get(n),s=i.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=rN(t);if("BinaryExpression"===o&&"-"===a&&tp(n=rN(s))&&n.value>0)return pF(i,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:mA,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=tn(e,r);return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[mA]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(tR(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tN(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(mB)&&mj(r)&&mj(`${mB}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:mF,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],mB)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[mF]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tE(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tR(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e;return{node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:mR,fix:t=>iH(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[mR]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&mL(n.key)&&("get"===n.kind&&(m$(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&mN(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!m$(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)})(e,n)))return{node:e.parent,messageId:mP,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[mP]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tF(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(mU(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tE(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&mU(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&(o=e.arguments[0],o?.type==="Literal"&&("."===o.value||"./"===o.value))&&e.arguments[1]===r&&mU(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(mW(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"!==n.type||n.init!==e||"Identifier"!==n.id.type||"VariableDeclaration"!==n.parent.type||"const"!==n.parent.kind)return;let o=eS(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;mW(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?mM:mO,fix:r=>r.replaceText(e,`import.meta.${t}`)}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[mM]:"Do not construct dirname.",[mO]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tR(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&ti(t.arguments[0],1))||nL(t.callee.object,e))return;let[r]=t.arguments;return{node:r,messageId:mV,fix:t=>iq(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[mV]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){dQ(e,{methods:["splice","toSpliced"],messageId:m_,checkArrayReceiver:!0})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[m_]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&uu.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&tR(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tF(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=eS(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:mz},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[mz]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=r.body.find(e=>"PropertyDefinition"===e.type&&!e.computed&&!e.static&&e.key.type===s&&e.key.name===a),u={node:o,messageId:mK};function*p(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),l){if(l.value)return void(yield s.replaceText(l.value,i));let e=` = ${i}`,r=t.getLastToken(l);return eA(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=rR(n,e),c=`${p}${a} = ${i};
43
+ `,mM=e=>e?.type==="Identifier"?e.name:e?.type!=="MemberExpression"||e.computed||"Identifier"!==e.property.type?void 0:e.property.name,mO=e=>{let t=mM(rP(e.superClass));return!!t&&mL.test(t)},mq=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tO(e.expression.left,`this.${t}`),mU=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),mV=(e,t)=>tc(rP(e?.value))===t,mW=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,m_=e=>!e||tV(rP(e)),mz=e=>e?.type==="TSParameterProperty"?mz(e.parameter):e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,mK=e=>mz(rP(e))?.name==="options",mG=(e,t)=>eR(e.getTokenAfter(t,{includeComments:!0})),mJ=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type)return!0;for(let r of t[e.type]??[]){let n=e[r];if(n){if(Array.isArray(n)){if(n.some(e=>e&&mJ(e,t)))return!0;continue}if(mJ(n,t))return!0}}return!1},mX=e=>{let t=mz(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},mY=(e,t,r)=>n=>{let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let a=t.arguments;if(0===a.length){let e=o.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(e,`${r}, options`)}if(1===a.length)return ts(a[0],e)?void 0:"undefined"!==r&&m_(a[0])?n.replaceText(a[0],`${r}, options`):n.insertTextAfter(a[0],", options")},mH=(e,t)=>(e=rP(e),e?.type==="Identifier"&&e.name===t.name);function*mQ(e,t){let r,n;if(!mO(t)||null===t.id)return;let{name:o}=t.id,a=i0(o).replace(/(?:error)?$/i,"Error");o!==a&&(yield{node:t.id,message:`Invalid class name, use \`${a}\`.`});let{body:i}=t.body,{sourceCode:s}=e,l=i.find(e=>"constructor"===e.kind&&e.value.body)??i.find(e=>"constructor"===e.kind),u=i.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!l){if(mV(u,o))return;let e=s.getRange(t.body);yield{...mU(u?.value??t,o),fix(t){if(u?.value){let e=rP(u.value);if(void 0!==tc(e))return t.replaceText(e,`'${o}'`);if(s.getCommentsInside(u.value).length>0)return;return t.replaceText(u.value,`'${o}'`)}return u?t.replaceText(u,m$(o).trim()):t.insertTextAfterRange([e[0],e[0]+1],m$(o))}};return}let p=i.some(e=>mW(e,"get")),c=i.some(e=>mW(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.findIndex(e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tO(e.expression.callee,"super")),p=a[u],c=a.findIndex(e=>mq(e,"message")),d=i||s,m=!1;if(p){if(d&&!m_(p.expression.arguments[0]))m=!0,yield{node:p,messageId:mI};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:mj};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:p,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(i){if(c<u)return;let s=r.expression.right,[l,d]=t.value.params,m=mz(l),f=1===t.value.params.length&&m&&!mK(l),g=0===c?n.getRange(o)[0]:n.getRange(a[c-1])[1],[,y]=n.getRange(r);if(f&&mG(n,l)||nt(e,[g,y])||mG(n,r))return;let h=p.expression;if(n.getCommentsInside(h).length>0)return;let x=f||mK(d);if(0===h.arguments.length){if(c!==u+1||mJ(s,n.visitorKeys))return;let t=n.getTokenAfter(h.callee,e=>"("===e.value);yield i.insertTextAfter(t,x?`${ti(s,e)}, options`:ti(s,e))}else{let t;if(t=h.arguments[0],n.getText(rP(t))!==n.getText(rP(s)))return;if(x&&1===h.arguments.length){if(ts(h.arguments[0],e))return;yield i.insertTextAfter(h.arguments[0],", options")}}f&&(yield i.insertTextAfter(l,`, ${mX(l)}`)),yield i.removeRange([g,y])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>mq(e,"name"));return a?tc(rP(a.expression.right))!==n?mU(a.expression.right??e,n):void 0:mV(o,n)?void 0:mU(o?.value??e,n)}(o,a,r);if(f&&(yield f),!f&&l&&!m){let r=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=mz(a);if(0===o.length||!i)return;let s=r.expression;if(mK(a)){if(!mK(s.arguments[1])){let t={node:s,messageId:mP};return mH(s.arguments[0],i)||(t.fix=mY(e,s,"undefined")),t}return}let l=o[1],u=!n&&"message"===i.name,p=u?i.name:"undefined";if(!l){if(((e,t)=>{if(t)return!1;let[r,n]=e.arguments,o=rP(n);return 2===e.arguments.length&&void 0!==tc(rP(r))&&"ObjectExpression"===o.type&&1===o.properties.length&&"cause"===eG(o.properties[0])})(s,u))return;return{node:a,messageId:mF,fix:function*(r){let{sourceCode:n}=e,o=t.value.params[0];if(mG(n,o))return;let a=mY(e,s,p)(r);a&&(yield r.insertTextAfter(o,`, ${mX(o)}`),yield a)}}}if(!mK(l))return{node:l,messageId:mB};if(u&&!mH(s.arguments[0],i))return{node:s,messageId:mR,fix:t=>{let{sourceCode:r}=e;if(r.getCommentsInside(s).length>0)return;let n=s.arguments;if(0===n.length){let e=r.getTokenAfter(s.callee,e=>"("===e.value);return t.insertTextAfter(e,`${p}, options`)}if(m_(n[0])){if(ts(n[0],e))return;return t.replaceText(n[0],1===n.length?`${p}, options`:p)}}};if(!mK(s.arguments[1]))return{node:s,messageId:mP,fix:mY(e,s,p)}})(e,t,p,d);r&&(yield r)}}(e,l,{name:o,nameProperty:u,hasMessageGetter:p,hasMessageSetter:c,checkOptions:o===a&&(n=mM(r=rP(t.superClass)),uG.includes(n)&&!mN.has(n)&&("Identifier"===r.type||tO(r,`globalThis.${n}`)))})}let mZ="no-lonely-if",m0=e=>"IfStatement"===e.type&&!e.alternate;function m1(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let m2=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),m3=e=>e.trim()?e:"",m8=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,m6=(e,t)=>m2(e.ifToken,e.openingParenthesisToken,t),m9=(e,t,r)=>{let n,o=m2(e.openingParenthesisToken,e.closingParenthesisToken,r);return ts(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},m5="no-magic-array-flat-depth",m4="no-negated-condition",m7="identifier",fe="non-identifier",ft="prefer-negative-index",fr=new o([["slice",{argumentsIndexes:[0,1],supportObjects:new i(["Array","String","ArrayBuffer",...nL])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new i(nL)}],["splice",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new i(["Array","String",...nL])}]]),fn=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var fo=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function fa(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new i(fo)).has(t)}let fi="prefer-node-protocol",fs="node:",fl="consistent-date-clone/error",fu="no-accessor-recursion/error",fp=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,fc=(e,t)=>["type","name"].every(r=>e[r]===t[r]),fd=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&fp(e.parent.property)&&fc(e.parent.property,t.key),fm="error/calculate-dirname",ff="error/calculate-filename";function fg(e,{modules:t,functionName:r,sourceCode:n}){if(!tv(e,{optional:!1,argumentsLength:1},tx))return!1;let o=new i;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tR(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tL(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&a(t.arguments[0]);if("Identifier"!==t.type||o.has(t))return!1;o.add(t);let s=eD(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!a(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],i)}(e.callee,"property");function a(e){return e?.type==="Literal"&&t.has(e.value)}}function fy(e,t){return fg(e,{modules:new i(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function fh(e,t){return fg(e,{modules:new i(["path","node:path"]),functionName:"dirname",sourceCode:t})}let fx="no-unnecessary-array-flat-depth",fb="no-unnecessary-array-splice-count",fE="no-useless-error-capture-stack-trace/error",fv="prefer-class-fields/error",fS="prefer-class-fields/suggestion",fC="prefer-bigint-literals/error",fD="prefer-bigint-literals/suggestion",fT="prefer-classlist-toggle/error",fA="prefer-classlist-toggle/suggestion",fw=e=>tR(e,{property:"classList",computed:!1}),fk=(e,t,r)=>{let n={node:r??e,messageId:fT};return"IfStatement"===e.type||tw(e)||tw(e.parent)?n.fix=t:n.suggest=[{messageId:fA,fix:t}],n},fI=(e,t,r)=>{let{sourceCode:n}=t,o=ti(e,t);return r?(!ts(e,n)&&i_(e,"!")&&(o=`(${o})`),o=`!${o}`):(ts(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},fj=(e,t)=>tL(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&fw(e.callee.object),fF=(e,t)=>rj(e.callee.object,t.callee.object)&&rj(e.arguments[0],t.arguments[0]),fB=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),fj(e,["contains"])&&fF(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?fB(e.argument,!t,r):void 0,fR="require-module-attributes",fP="error",fL="suggestion/array",fN="suggestion/object",f$="suggestion/object-assign",fM="suggestion/set",fO="suggestion/map",fq=(e,t,r)=>{let{sourceCode:n}=r,o=nB(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function fU(e,t){if(!tS(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*fV(e,t,r){let n=!ek(t.sourceCode.getTokenBefore(e));yield sA(e,t,r,n)}function fW(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!ew(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*f_({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rT(r,e)){let[o]=r.arguments;if(o)yield fW(e,t,o,n);else{let{openingParenthesisToken:o}=rT(r,e)?rA(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*fV(o,e,t)}let fz=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tL(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!fq(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:fP,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eZ(e,a))?l.suggest=[{messageId:fL,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p,l},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=rw(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):fW(e,a,t,i),yield fV(r,e,a)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!("AssignmentExpression"===n.type&&"="===n.operator&&tR(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!fq(t,a.computed?[i,o]:[o],e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,{left:i,right:s}=e,{property:l}=i,u=a.getTokenAfter(i,t=>"Punctuator"===t.type&&t.value===e.operator),p={node:e,loc:{start:a.getLoc(e).start,end:a.getLoc(u).end},messageId:fP,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eZ(l,a)||eZ(s,a)?p.suggest=[{messageId:fN,data:{assignType:n},fix:c}]:p.fix=c,p},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=ti(o,e);n.computed&&(s=`[${s}]`);let l=ti(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!ew(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield fV(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tL(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[o,a]=n.arguments;if(!("Identifier"!==o.type||o.name!==t.name||"SpreadElement"===a.type||fq(t,[a],e)))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:fP,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eZ(i,a)?s.suggest=[{messageId:f$,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i;("ObjectExpression"===o.type?o.properties.length>0&&(i=function(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(ew(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${ti(o,e)}`,i&&(yield fW(e,a,t,i)),2!==n.arguments.length)?yield sf(a,o,e):yield fV(r,e,a)}},{testValue:e=>fU(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),tL(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!fq(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:fP,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eZ(e,i))?s.suggest=[{messageId:fM,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rw(e,r,!1);return f_({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>fU(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tL(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!fq(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:fP,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eZ(e,i))?s.suggest=[{messageId:fO,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rw(e,r,!1);return f_({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],fK="no-useless-collection-argument/error",fG="no-useless-collection-argument/suggestion",fJ="prefer-response-static-json",fX=/([\p{Ll}\d])(\p{Lu})/gu,fY=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,fH=/(\d)\p{Ll}|(\p{L})\d/u,fQ=/[^\p{L}\d]+/giu,fZ="$1\0$2";function f0(e){let t=e.trim();t=(t=t.replace(fX,fZ).replace(fY,fZ)).replace(fQ,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function f1(e){let t=f0(e);for(let e=0;e<t.length;e++){let r=t[e],n=fH.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function f2(e,t){let[r,n,o]=f4(e,t);return r+n.map(f6(t?.locale)).join(t?.delimiter??" ")+o}function f3(e,t){var r,n;let[o,a,i]=f4(e,t),s=f6(t?.locale),l=f9(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):f5(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function f8(e,t){let[r,n,o]=f4(e,t),a=f5(f6(t?.locale),f9(t?.locale));return r+n.map(a).join("")+o}function f6(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function f9(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function f5(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function f4(e,t={}){let r=t.split??(t.separateNumbers?f1:f0),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let f7="filename-case",ge="directory-case",gt="filename-extension",gr=e=>!/^[\w-]$/.test(e),gn=new i(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),go=new Intl.ListFormat("en-US",{type:"disjunction"}),ga=/^[\da-z]+$/i,gi=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,gs=e=>e>="0"&&e<="9",gl=e=>e>="a"&&e<="z",gu=e=>e>="A"&&e<="Z",gp={camelCase:{fn:f3,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!gl(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(gl(r)||gs(r))continue;if(!gu(r))return!1;let n=t;for(;gu(e[t+1]);)t++;if(t!==n){if(gl(e[t+1])){t--;continue}for(;gs(e[t+1]);)t++;if(t===e.length-1)return!0;if(!gu(e[t+1]))return!1}}return!0}(e)?f3(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return f2(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return f2(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(ga.test(e)){let t=gi.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&f8(r)===r)return e}return f8(e)},name:"pascal case"}};function gc(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function gd(e,t,{leading:r,trailing:n}){let{samples:o}=function(e,t=1/0){let r=e.reduce((e,{length:t})=>e*t,1),n=Array.from({length:Math.min(r,t)},(t,r)=>{let n=r,o=[];for(let t=e.length-1;t>=0;t--){let r=e[t],{length:a}=r,i=n%a;n=(n-i)/a,o.unshift(r[i])}return o});return{total:r,samples:n}}(e.map(({word:e,ignored:r})=>r?[e]:t.map(t=>t(e))));return[...new i(o.map(e=>`${r}${e.join("")}${n}`))]}let gm=/^(?<leading>_+)(?<tailing>.*)$/;function gf(e){let t,{leading:r="",tailing:n=e}=(gm.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=gr(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function gg(e){let t;return t=e.map(e=>gp[e].name),go.format(t)}let gy=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1},{properties:{cases:{properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},ignore:{type:"array",items:{type:["string","object"],additionalProperties:!0},uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1}]}],gh="consistent-template-literal-escape",gx=["entries","keys","values"],gb=["drop","filter","flatMap","map","take"],gE=["concat","from","zip","zipKeyed"],gv=new i(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:gS}=n4({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:gv}),gC=e=>{for(;rR(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},gD="iterable-accepting",gT="for-of",gA="yield-star",gw="spread",gk="iterator-method",gI="iterable-accepting/suggestion",gj="iterator-method/suggestion",gF=["every","find","forEach","some"],gB="reduce",gR=e=>tL(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),gP=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>sT(r,e,t)},gL=(e,t,r,n)=>{let o=gP(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},gN="prefer-simple-condition-first",g$="prefer-simple-condition-first/unsafe";function gM(e){return"Identifier"===(e=rP(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rP(e.argument).type}function gO(e){if(gM(e=rP(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rP(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function gq(e){if("Identifier"===(e=rP(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return gq(e.argument);if("BinaryExpression"===e.type){let t=rP(e.left),r=rP(e.right);return!!(("=="===e.operator||"!="===e.operator)&&("Identifier"===t.type&&tf(r)||tf(t)&&"Identifier"===r.type))||gO(t)&&gO(r)&&("==="===e.operator||"!=="===e.operator)&&(gM(t)||gM(r))}return!1}let gU="switch-case-break-position",gV=new i(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),gW="first-child",g_="first-element-child",gz="query-selector",gK="closest",gG="merge-query-selector",gJ="suggestion-first-child",gX="suggestion-first-element-child",gY="suggestion-merge-query-selector",gH={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},gQ=(e,t)=>tR(e,{property:t,optional:!1,computed:!1}),gZ=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&td(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,g0=(e,t)=>t.getCommentsInside(e).length>0,g1=(e,t,r,n)=>{let{sourceCode:o}=n;if(g0(e,o))return;let[,a]=ta(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},g2=e=>tR(e,{property:"parentElement",optional:!1,computed:!1}),g3=e=>void 0!==tc(e),g8=e=>tL(e,gH),g6=new i(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),g9=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),g5=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},g4="consistent-compound-words/error",g7="consistent-compound-words/rename",ye={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},yt=new i(String.raw`\^$.*+?()[]{}|`),yr=e=>{let t="";for(let r of e)t+=yt.has(r)?`\\${r}`:r;return t},yn=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,yo=({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:r="internal",checkShorthandImports:n="internal",checkShorthandProperties:a=!1,extendDefaultReplacements:s=!0,replacements:l={},allowList:u={}}={})=>{let p=new o(Object.entries(s?{...ye,...l}:l).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:a,replacements:p,replacementRegExp:p.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(yr(n)),r.push(yr(i0(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${yn}`,"gv")})(p):void 0,allowList:new i(Object.keys(u))}},ya=yo(),yi=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>((e,t)=>{let r=t.get(e)??t.get(i1(e));if(r){let t;return(t=e[0])===t.toUpperCase()?i0(r):i1(r)}})(e,r));if(o!==e)return o},ys=(e,t)=>({node:e,messageId:g4,data:{name:e.name,replacement:t}}),yl={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},yu="no-blob-to-file",yp="suggestion";function yc(e,t){let r=eD(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function yd(e,t){if(e?.type!=="Identifier")return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.kind&&o?.type==="VariableDeclarator")return o}let ym="no-canvas-to-image",yf=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function yg(e,t){if(e=yf(e),e?.type!=="Identifier")return e;let r=eD(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return yf(n.parent.init)}let yy=e=>e.toLowerCase().includes("canvas"),yh="replace-one-element",yx="insert-at-negative-one",yb="suggestion-replace-one-element",yE="suggestion-insert-at-negative-one";function yv(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&yv(e.object)}let yS=(e,t)=>t.getCommentsInside(e).length>0,yC="no-duplicate-set-values",yD="first-match",yT="id-selector",yA="length-check",yw="query-selector-all-nullish",yk="query-selector-undefined",yI=e=>tL(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!o2(e.callee.object),yj=e=>tL(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!o2(e.callee.object),yF=e=>{let t,r;return t=e,r=yj,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&tl(t.property,0)},yB=e=>{let t,r;return t=e,r=yj,tL(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&tl(t.arguments[0],0)},yR=e=>nl(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,yP=(e,t,r,n)=>{let[,o]=ta(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},yL=(e,t,r)=>{if("Identifier"!==e.type)return;let n=eD(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},yN=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tK(e))r=!r,e=e.parent;else if(tG(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tY(n)||(yj(e)?!e:!yL(e,r,yj)))return;let a=r.getText(e);return{node:e,messageId:yA,fix:((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return r.getAllComments().some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(s<=a||t>=i)})})(n,e,r)?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},y$=(e,t,r)=>({node:e,messageId:yD,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?sD(n,e,r):sT(n,e,r)}}),yM=(e,t)=>tf(e)||tV(e)&&t.isGlobalReference(e),yO=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:yL(n,r,t))&&yM(a,r)?{node:n,value:a}:(t(a)?a:yL(a,r,t))&&yM(n,r)?{node:a,value:n}:void 0:void 0},yq="no-invalid-file-input-accept/invalid",yU="no-invalid-file-input-accept/static",yV="no-invalid-file-input-accept/normalize",yW=new i(["audio/*","image/*","video/*"]),y_=new o([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),yz=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,yK=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},yG=e=>{if(e.startsWith("."))return e.length>1&&!yK(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!yK(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return yW.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new C.MIMEType(e);return{replacement:y_.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},yJ=e=>{if("JSXIdentifier"===e.type)return e.name},yX=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&yJ(e.name)===t),yY=(e,t)=>{let r=rH(t,e)?.value;if("string"==typeof r)return r},yH=e=>">"===e||""===e.trim(),yQ=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},yZ=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],y0=(e,t,r)=>{let n=t;for(;t<r&&""!==e[t].trim()&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},y1=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!yH(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},y2=(e,t,r)=>{let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=yQ(n,i,a),!yZ(n,i,a));){let e=y0(n,i,a);if(i=yQ(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=yQ(n,++i,a);let t=y1(n,i,a);if(i=t.index,e.name===r)return t}},y3=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:yq,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:yU};let r=(e=>{let t=e.split(","),r=new i,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=yG(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let o=n.join(", ");return o===e?{}:{replacement:o}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:yq,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:yV,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},y8=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,y6=e=>{for(let t=e.parent;t;t=t.parent)if(tI(t))return t},y9=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}},y5=e=>{let{sourceCode:t}=e,r=new i,n=e=>{let t=y6(e);t&&r.add(t)};return e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),{isFunctionSuspended:e=>r.has(e),isInsideSuspendingLoop(e,r){for(let n=e,o=e.parent;o&&o!==r;n=o,o=o.parent)if(y9(o,n)&&tQ(o,t.visitorKeys))return!0;return!1}}},y4="after-suspension",y7="in-nested-function",he="no-unnecessary-nested-ternary";function ht(e,t,r){return r.getText(e)===r.getText(t)}function hr(e,t,r,n){let o=ti(e,t);return!ts(e,t)&&iz(e,{operator:r,property:n})&&(o=`(${o})`),o}function hn(e,t){let r=ti(e,t);return!ts(e,t)&&iM(e)&&(r=`(${r})`),r}function ho(e,t,r){let n={node:t,messageId:he};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[hr(r,e,n,"left"),hr(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${hn(a,e)} : ${hn(i,e)}`;return ip(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let ha="no-unused-array-method-return",hi=new i(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),hs=/^\p{Uppercase_Letter}/v,hl=Symbol("uncertainValue"),hu=["BigInt","Boolean","Number","RegExp","String","Symbol"],hp=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),hc="prefer-array-last-methods",hd="replace",hm=new o([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),hf=["reverse","toReversed"],hg="prefer-math-abs",hy=new i([">",">=","<","<="]),hh={">":"<",">=":"<=","<":">","<=":">="},hx={">":"<",">=":"<="};function hb(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&tg(e.literal)||"TSTypeAnnotation"===e.type&&hb(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>hb(e))||"TSIntersectionType"===e.type&&e.types.some(e=>hb(e))}function hE(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?hE(e.expression):e}function hv(e){let t;return tg(e)||tv(e,{name:"BigInt",argumentsLength:1,optional:!1},tx)||"UnaryExpression"===e.type&&"-"===e.operator&&hv(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&hb(t)}function hS(e,t){return hv(e)||function(e,t){let r=hE(e);if("Identifier"!==r.type)return!1;let n=eD(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&hb(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&hv(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&hb(e.node.id.typeAnnotation)||e.node.init&&hv(e.node.init)))??!1}(e,t)}function hC(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rj(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&tl(e.left,0)?rj(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rj(e.left,t)&&tN(e.right)||tN(e.left)&&rj(e.right,t))}function hD(e,t){if(!("BinaryExpression"!==e.type||!hy.has(e.operator)||hS(e.left,t)||hS(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:hh[e.operator]}}function hT(e,t){if(!("BinaryExpression"!==e.type||!hy.has(e.operator)||hS(e.left,t)||hS(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:hh[e.operator]}}function hA(e,t){let r=ti(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function hw(e,t,r){let n={node:e,messageId:hg};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function hk(e){return["Identifier","Literal","ThisExpression"].includes((e=hE(e)).type)}let hI="prefer-split-limit",hj=(e,t)=>{let r=rH(e,t);if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},hF=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tL(r,{method:"split",argumentsLength:1})&&(tu(t=r.arguments[0])&&""!==t.value||tm(t)))return r},hB=(e,t,r,n)=>({node:e,messageId:hI,fix:e=>sm(e,t,String(r),n)}),hR=(e,t,r)=>{let{elements:n}=e,o=hF(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return hB(e,o,n.length,r)},hP="prefer-queue-microtask",hL={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tR(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&rF(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:hP,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!o6(n.arguments[0])&&is(n)&&rF(n.callee,e)?{node:n.callee,messageId:hP,data:{name:"setImmediate()"},fix:(e=>{if(1===e.arguments.length)return t=>t.replaceText(e.callee,"queueMicrotask")})(n)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!o6(n.arguments[0])&&is(n)&&rF(n.callee,e)?{node:n.callee,messageId:hP,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length)return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!nt(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[hP]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},hN="prefer-string-pad-start-end",h$="suggest-padding-method",hM=new i(["ArrayExpression","ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","ObjectExpression"]),hO=(e,t)=>{if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0,o=r?.references.some(e=>e.isWrite()&&!e.init);return o||n?.type!=="FunctionName"&&n?.type!=="ClassName"?!o&&n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init?n.node.init:void 0:n.node},hq=(e,t)=>{let r=hO(e,t)??e;if(rK(e,t))return;let n=rO(r)?rQ(r,t):rH(r,t);return"SequenceExpression"!==r.type?n:r.expressions.some(e=>rX(e,t))?void 0:n??ez(r,t.sourceCode.getScope(r))},hU=(e,t)=>{let r=hO(e,t)??e;return hM.has(e.type)||((e,t)=>{let r=hO(e,t)??e;if("SequenceExpression"===r.type&&rX(r,t)){let e=rH(r.expressions.at(-1),t);return!e||"string"!=typeof e.value}let n=hq(r,t);return rO(r)?!n||"string"!=typeof n.value:n&&"string"!=typeof n.value})(e,t)||hM.has(r.type)||oN(r,t)||oH(r,t)||ow(e,t)},hV=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,hW=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,h_=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&td(t)&&hW(r),hz=(e,t)=>{if(!tL(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=hq(e,t);if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},hK=(e,t)=>{let r=hz(e,t);if(!r)return;let{widthNode:n}=r;if("BinaryExpression"===n.type&&"-"===n.operator&&tR(n.right,{property:"length",computed:!1}))return{...r,targetLengthNode:n.left,targetNode:n.right.object}},hG=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=ti(t,a),s=ti(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${ti(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},hJ=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:hN,data:{method:t}};return o&&!hV(e,n)&&(a.fix=function(t){let o=ip(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},hX=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:hN,data:{method:t}};return o&&!hV(e,n)&&(a.suggest=[{messageId:h$,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},hY="require-css-escape",hH=["closest","matches","querySelector","querySelectorAll"],hQ=e=>e.value.cooked,hZ=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=hQ(r);if(void 0===e)return!1;n+=e}if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1)){let e=hQ(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},h0=e=>tL(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),h1=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],h2={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tL(e,{methods:hH,minimumArguments:1})||o2(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!h0(n)&&(t||hZ(r,e))&&(yield{node:n,messageId:hY,fix:h1(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[hY]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},h3="require-passive-events",h8=new i(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),h6=e=>e.computed||"Identifier"!==e.property.type?tu(e.property)?e.property.value:void 0:e.property.name,h9=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===h6(t)&&("CallExpression"===(r=t).parent.type&&r.parent.callee===r?r.parent:"ChainExpression"===r.parent.type&&"CallExpression"===r.parent.parent.type&&r.parent.parent.callee===r.parent?r.parent.parent:void 0)},h5=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=h6(e.parent);return t&&"preventDefault"!==t&&!nl((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},h4="this",h7="class",xe="class-unavailable",xt="super",xr="super-class",xn="super-class-unavailable",xo="suggestion",xa=new i(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),xi=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),xs=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,xl=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,xu=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(xl(r)&&!xs(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(xa.has(r.type))return}},xp=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},xc=(e,t,r)=>eD(e.getScope(t),t)===eD(e.getScope(r),r),xd=(e,t,r)=>eD(e.getScope(t),r.name)===eD(e.getScope(r),r),xm=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,xf=e=>{let t;return(t=e.parent,xi.has(t.type)&&t.expression===e)?e.parent:void 0},xg=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=xf(e);return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},xy=e=>{let t=e;for(;t.parent;){if(xm(t.parent,t))return!0;let e=xg(t);if(!e)break;t=e}return!1},xh=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,xx=e=>{let t=e;for(;t.parent;){let e=xf(t);if(!e)break;t=e}return t},xb=e=>{let t=xx(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},xE=e=>{let t=xx(e);return xh(t)&&"PrivateIdentifier"===t.parent.property.type},xv=e=>{let t=xx(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},xS=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,xC=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:xo,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),xD=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),xT={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||xy(e)||xb(e)||xE(e)||xv(e))return;let n=xu(e);if(!n)return;let o=xp(n.parent.parent);return o&&xd(t,e,o)?xC({node:e,messageId:h7,source:"this",replacement:o.name,name:o.name}):xD(e,xe)}),e.on("Super",e=>{if(n||xy(e))return;let r=xu(e);if(!r)return;let o=xS(r.parent.parent);return o&&xd(t,e,o)?xC({node:e,messageId:xr,source:"super",replacement:o.name,name:o.name}):xD(e,xn)}),e.on("Identifier",o=>{if(!t$(o)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(o)||xy(o)||xb(o)||xE(o)||xv(o))return;let a=xu(o);if(!a)return;let i=a.parent.parent;if(r){let e=xp(i);if(e&&o.name===e.name&&xc(t,o,e))return xC({node:o,messageId:h4,source:o.name,replacement:"this",name:o.name})}if(!n||!(xh(o)&&!o.parent.optional&&!xy(o.parent))||ts(o,e))return;let s=xS(i);if(s&&o.name===s.name&&xc(t,o,s))return xC({node:o,messageId:xt,source:o.name,replacement:"super",name:o.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[h4]:"Use `this` instead of `{{name}}` in static methods.",[h7]:"Use `{{name}}` instead of `this` in static methods.",[xe]:"Use the class name instead of `this` in static methods.",[xt]:"Use `super` instead of `{{name}}` in static methods.",[xr]:"Use `{{name}}` instead of `super` in static methods.",[xn]:"Use the superclass name instead of `super` in static methods.",[xo]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},xA="consistent-optional-chaining/remove-optional",xw="consistent-optional-chaining/use-optional",xk="consistent-optional-chaining/suggest-remove-optional",xI="consistent-optional-chaining/suggest-use-optional",xj=new i(["Identifier","ThisExpression","Super"]);function xF(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rP(e)).type&&(e=e.expression);return e}function xB(e){return"MemberExpression"===(e=xF(e)).type?e:void 0}function xR(e){return e=xF(e),!!xj.has(e.type)||"MemberExpression"===e.type&&xR(e.object)}function xP(e,t){let r=ns(e,t);return!nt(t,r)}function xL({memberExpression:e,context:t,fixer:r,replacement:n}){let o=ns(e,t);return r.replaceTextRange(o,n)}function xN(e,t,r){return xL({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let x$="always",xM="never",xO="missing-delay",xq="redundant-delay",xU=new i(["setTimeout","setInterval"]),xV=new i(["window","globalThis","global","self"]),xW=e=>tl(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&xW(e.argument),x_="negative-index",xz="length-index",xK="no-duplicate-loops",xG=["filter","map"],xJ="no-declarations-before-early-exit",xX=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),xY=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,xH=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eR(n)},xQ=(e,t)=>{let[r,n]=e.getRange(t);return new i(rb(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*xZ(e,t,r){let n;for(let[o,a]of t.entries())if(xX(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?o7(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&o7(t.property.name)})(r.init)||r.init&&tQ(r.init,e.visitorKeys)||a>o+1&&!xY(r.init)||r.init&&(i=r.init,s=xQ(e,n),[...xQ(e,i)].some(e=>s.has(e)))&&(eZ(r.init,e)||eZ(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:xJ};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&xY(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!xH(e,t,"before")&&!xH(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eR(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let x0="no-optional-chaining-on-undeclared-variable",x1=e=>"Type"===e.type||"ImportBinding"===e.type&&ic(e.node);function x2(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rP(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let x3="no-object-methods-with-collections/error",x8="no-object-methods-with-collections/suggestion",x6=new i(["entries","keys","values"]),x9="no-subtraction-comparison/error",x5="no-subtraction-comparison/suggestion",x4={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},x7=new i(Object.keys(x4)),be=new i([">","<"]),bt=e=>"BinaryExpression"===e.type&&"-"===e.operator,br=(e,t)=>{let r=rQ(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},bn="no-unnecessary-global-this",bo=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function ba(e){for(;bo.has(e.type);)e=e.expression;return e}let bi=e=>{for(;bo.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},bs=t3();function bl(e){return"CallExpression"===(e=bi(e)).parent.type&&e.parent.callee===e}let bu=new i(["==","!=","===","!=="]),bp="computed-key",bc="nested-array",bd="deep-object",bm="property-assignment",bf=new o([["Math",new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"])],["String",new i(["raw"])]]);function bg(e){let{parent:t}=e;if(t){if(rR(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return bg(t);if("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type)return t.parent;if("ObjectPattern"===t.type||"ArrayPattern"===t.type)return t}}function by(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=bg(e);return t}let bh="no-useless-else",bx=new i(["Program","BlockStatement","StaticBlock","SwitchCase"]),bb=new i(["[","(","<","/","`","+","-"]),bE=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},bv=e=>bb.has(e.value[0]),bS="no-useless-recursion",bC=new i(["using","await using"]),bD=e=>e?.type==="VariableDeclaration"&&bC.has(e.kind),bT=e=>"ForStatement"===e.type?bD(e.init):"ForOfStatement"===e.type&&bD(e.left),bA="prefer-add-event-listener-options",bw="prefer-direct-iteration",bk="Array",bI="FormData",bj="URLSearchParams",bF=new i([bk,"Map","Set",bI,bj,...nL]),bB=new o([["ReadonlyArray",bk],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),bR=new o([[bk,["values"]],["Map",["entries"]],["Set",["values","keys"]],[bI,["entries"]],[bj,["entries"]],...nL.map(e=>[e,["values"]])]),bP=["Map","WeakMap","Set","WeakSet"],bL=["all","allSettled","any","race"],bN=new i(["ArrayExpression","CallExpression","NewExpression"]),b$=e=>new i([e]),bM=(e,t)=>tL(e,{objects:nL,methods:t,optionalCall:!1,optionalMember:!1}),bO=e=>bF.has(e)?e:bB.get(e),bq=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},bU=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return bq(e.types.map(e=>bU(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return b$(bk);let n=nM(e);if(!nO(n,r))return;let o=n.getName(),a=o&&bO(o);return a&&b$(a)},bV=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bV(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return b$(bk);case"TSTypeOperator":return"readonly"===e.operator?bV(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=bO(e.typeName.name);return t&&b$(t)}case"TSUnionType":return bq(e.types.map(e=>bV(e)))}},bW=(e,t,r=new i)=>((e,t,r)=>{if("ArrayExpression"===e.type||tS(e,{name:"Array"}))return b$(bk);if(tS(e,{names:nL})||tS(e,{names:["Map","Set",bI,bj]}))return b$(e.callee.name);if(tv(e,{name:"Array"},tx)||tL(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return b$(bk);if(bM(e,["from","of"]))return b$(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=bV(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?bW(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return bV(e.typeAnnotation)??bW(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return bW(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return bU(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),b_="prefer-number-is-safe-integer/error",bz="prefer-number-is-safe-integer/suggestion",bK="prefer-number-is-safe-integer/integer-check-error",bG="prefer-number-is-safe-integer/integer-check-suggestion",bJ=["_","lodash","underscore"],bX=["floor","trunc"],bY=(e,t)=>{let r=eD(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},bH=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&tl(e.right,1))return e.left},bQ=(e,t)=>{if(tL(e,{object:"Math",methods:bX,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},bZ="prefer-object-define-properties";function b0(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tL(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let b1="prefer-object-destructuring-defaults",b2="prefer-object-destructuring-defaults/suggestion",b3=new i(Object.getOwnPropertyNames(Object.prototype)),b8={considerGetters:!0,considerImplicitTypeConversion:!0},b6=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,b9=(e,t,r)=>rb(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),b5=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=ti(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},b4="prefer-single-object-destructuring",b7=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=eD(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},Ee=(e,t,r)=>{let n,o,a=b7(e,t),i=b7(e,r);if(!(a&&i&&a.node.kind===i.node.kind&&a.source===i.source&&0===e.getCommentsInside(a.node).length&&0===e.getCommentsInside(i.node).length)||(n=a.node,o=i.node,e.getTokensBetween(n,o,{includeComments:!0}).some(e=>eR(e))))return;let s=t=>t.properties.map(t=>e.getText(t)).join(", "),l=`${a.node.kind} {${s(a.declarator.id)}, ${s(i.declarator.id)}} = ${a.source};`;return{node:i.node,messageId:b4,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*Et(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=Ee(e,t[r-1],n);o&&(yield o)}}let Er="prefer-smaller-scope",En=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function Eo(e,t){let r=e.parent;for(;r&&r!==t;){if(En.has(r.type))return!1;r=r.parent}return r===t}function Ea(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eR(n))}function Ei(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let Es="prefer-single-array-predicate/error",El="prefer-single-array-predicate/suggestion",Eu=new o([["||","some"],["&&","every"]]),Ep=new i(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),Ec="prefer-url-href",Ed="non-url",Em="unknown",Ef=new i(["ClassName","ImportBinding","Type"]),Eg=new i(["any","error","unknown"]),Ey=new i(["node:url","url"]),Eh=e=>Ef.has(e.type),Ex=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>id(e,r,n)))return o;t=t.upper}},Eb=e=>e.every(e=>"url"===e)?"url":!e.includes(Em)&&e.includes(Ed)?Ed:Em,EE=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,Ey.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},Ev=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||ic(e.node)),ES=e=>"Type"===e.type||Ev(e),EC=e=>EE(e)&&!Ev(e),ED=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!ES(e)&&id(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(rF(e,t))return!0;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>ES(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>EC(e))??!1})(r,t))},ET=(e,t)=>t.sourceCode.getScope(e.name??e.node),EA=(e,t,r,n=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return EA(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return Em;let o=e.typeName.name,a=Ex(o,r,e.typeName,t),[i]=a?.defs??[];if(!i)return"URL"!==o||((e,t)=>{for(;t;){let r=t.set.get(e);if(r?.defs.some(e=>Eh(e)))return!0;t=t.upper}return!1})(o,r)?Em:"url";if(n.has(o))return Em;if(EE(i))return"url";n.add(o);let s=Em;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=EA(i.node.typeAnnotation,t,ET(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=Em:"ClassName"===i.type&&(s=Ed),n.delete(o),s})(e,t,r,n);case"TSUnionType":return Eb(e.types.map(e=>EA(e,t,r,n)));case"TSIntersectionType":return Eb(e.types.map(e=>EA(e,t,r,n)));case"TSImportType":let o;return(o=e.source,Ey.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":Ed;default:return e?Ed:Em}},Ew=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(Eg.has(e.intrinsicName)||e.isTypeParameter?.())return Em;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return Ew(i,t);if(e.isUnion()||e.isIntersection())return Eb(e.types.map(e=>Ew(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return Em;let n=Ex(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||EE(e))??[];return 0===o.length?Em:o.every(e=>EE(e))?"url":Ed})(r.typeToString(e),o,n);if(s!==Em)return s;let l=nM(e);return nO(l,a)&&"URL"===l.getName()?"url":Ed},Ek=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return Em;try{let{program:n}=r;return Ew(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return Em}};function EI(e,t,r=new i){if(!e)return Em;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return Em;let[o]=n.defs;if(!id(o,e,t))return Em;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?EI(o.node.init,t,r):Em,i=EA(o.name?.typeAnnotation,t,ET(o,t)),s=Em;return a!==Em?s=a:i!==Em&&(s=i),r.delete(n),s})(e,t,r);if(n!==Em)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=EA(e.typeAnnotation,t,n);return o===Em?EI(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return EI(e.expression,t,r);case"SequenceExpression":return EI(e.expressions.at(-1),t,r);case"ConditionalExpression":return Eb([EI(e.consequent,t,r),EI(e.alternate,t,r)])}if(ED(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!ES(e)&&!EC(e))??!1})(e.callee,t))return Ed;let r=Ek(e,t);return r===Em?Ed:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return Em;let r=eD(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return Em;let[n]=r.defs;return EA(n.node.returnType,t,ET(n,t))})(e,t);return o!==Em?o:Ek(e,t)}let Ej=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return Ej(e.expression,t);case"SequenceExpression":return Ej(e.expressions.at(-1),t);case"ConditionalExpression":return Ej(e.consequent,t)&&Ej(e.alternate,t);case"NewExpression":return ED(e,t);default:return!1}},EF=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,EB="require-proxy-trap-boolean-return",ER=new i(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),EP=new i(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),EL=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type,EN=e=>tS(e,{name:"Proxy",argumentsLength:2})||tL(e,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}),E$=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),EM=new i(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),EO=(e,t)=>({node:e,messageId:EB,data:{name:t}}),Eq=e=>{if(e)return EO(e.node,e.data.name)},EU=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?Eq(EU(e.right,t,r)):EO(e,t);if("ConditionalExpression"===e.type)return EU(e.consequent,t,r)??EU(e.alternate,t,r);if("LogicalExpression"===e.type)return Eq(EU(e.left,t,r)??EU(e.right,t,r));if("SequenceExpression"===e.type)return Eq(EU(e.expressions.at(-1),t,r));let n=((e,t)=>{let r={sourceCode:t},n=rP(e),o=rH(n,r);if(void 0!==o)return"boolean"==typeof o.value?void 0:!!o.value;if(rX(n,r)||rK(n,r))return;let a=ez(n,t.getScope(n));if(a&&"boolean"!=typeof a.value)return!!a.value})(e,r);if(void 0===n&&!(E$.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&EM.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...EO(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},EV=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eG(e,t.getScope(e));if(ER.has(r)&&EP.has(e.value.type))return{name:r,functionNode:e.value}},EW=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return EO(e,t);if("BlockStatement"!==e.body.type)return EU(e.body,t,r);let o=[...function* e(t){if(t&&"string"==typeof t.type){if("ReturnStatement"===t.type)return void(yield t);if(!("BlockStatement"!==t.type&&EP.has(t.type))){for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){for(let t of n)yield*e(t);continue}yield*e(n)}}}}(e.body)],a=n.get(e)??!1;if(0===o.length){if(a)return;return EO(e,t)}for(let e of o){if(!e.argument)return EO(e,t);let n=EU(e.argument,t,r);if(n)return n}if(!a)return EO(e,t)},E_=D.builtinRules.get("logical-assignment-operators"),Ez="ifNullish",EK="convertIf",EG={...E_.meta.messages,[Ez]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},EJ=e=>e.fix??e.suggest?.[0]?.fix,EX={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof EJ(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:Ez};if(t.getCommentsInside(e.node).length>0)return n;let o=EJ(e);return{...n,suggest:[{messageId:EK,data:{operator:"||="},fix:o},{messageId:EK,data:{operator:"??="},fix:e=>o(new Proxy(e,{get(e,t){if("insertTextBefore"!==t){let r=Reflect.get(e,t,e);return"function"==typeof r?r.bind(e):r}return(t,r)=>e.insertTextBefore(t,"||"===r?"??":r)}}))}]}}(r,t))}}});for(let[t,n]of Object.entries(E_.create(r)))e.on(t,n)},meta:{type:E_.meta.type,docs:{description:E_.meta.docs.description,recommended:!0},fixable:E_.meta.fixable,hasSuggestions:E_.meta.hasSuggestions,schema:E_.meta.schema,defaultOptions:[E_.meta.defaultOptions?.[0]],messages:EG,languages:["js/js"]}},EY="no-useless-coercion",EH=new o([["Boolean",{type:"boolean",isType:oH}],["String",{type:"string",isType:ok}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&oZ(e.typeAnnotation)||o0(e,t))||"bigint"==typeof rH(e,t)?.value)}}],["Number",{type:"number",isType:oN}]]),EQ="no-useless-boolean-cast",EZ=["every","filter","find","findIndex","findLast","findLastIndex","some"],E0="no-useless-continue",E1="no-useless-override",E2=e=>e.isUnion()?e.types.every(e=>E2(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,E3=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},E8="prefer-has-check",E6=new i(["Map","ReadonlyMap","WeakMap"]),E9=new i(["Map","WeakMap"]),E5=new i(["FormData","Headers","URLSearchParams"]),E4=new i(["Array","ReadonlyArray"]),E7=E9.union(E5),ve=new i(["ClassName","ImportBinding","TSEnumName","Type"]),vt=new i(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),vr=new i(["TSTypeAnnotation","TSParenthesizedType"]),vn=new i(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),vo=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),va=new i(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),vi=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),vs=new i(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),vl=e=>{for(;vs.has(e.type);)e=e.expression;return e},vu=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=vu(e.left);return t?`${t}.${e.right.name}`:void 0}},vp=e=>e.typeArguments?.params??e.typeParameters?.params??[],vc=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>ve.has(e.type));if(r)return r;t=t.upper}},vd=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===vp(e.node).length)return e.node.typeAnnotation},vm=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=eD(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},vf=(e,t)=>tV(e)&&vm(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,vg=(e,t)=>E6.has(e)?{kind:"map",typeName:e,valueType:t}:E5.has(e)?{kind:"null-sentinel",typeName:e}:void 0,vy=(e,t,r=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return vy(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?vy(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=vu(e.typeName);if(!n)return;if((E6.has(n)||E5.has(n))&&!vc(n,t))return vg(n,vp(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),vd(vc(e,t))})(n,t,r);return o?vy(o,t,r):void 0}}},vh=(e,t)=>{let r=t.sourceCode.getScope(e);return vy(e.typeAnnotation,r)},vx=(e,t,r=new i)=>{let n=vh(e,t);if(n)return n;if(tS(e=vl(e))&&"Identifier"===e.callee.type&&E7.has(e.callee.name)&&vm(e.callee,t))return vg(e.callee.name);if("Identifier"!==e.type)return;let o=eD(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,s=vy(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return s||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?vx(a.node.init,t,r):void 0)},vb=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=nM(r);if(nO(e,t))return e.getName()}},vE=(e,t,r)=>{if(nN.has(e.intrinsicName)||n$.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>vE(e,t,r));if(1===new i(n.map(e=>e?.typeName)).size){let[e]=n;if(e?.kind!=="map")return e;let r=n.map(e=>e?.valueType);return{...e,valueType:r.every(Boolean)?t.getUnionType(r):void 0}}if(n.every(e=>e?.kind==="map")){let e=n.map(e=>e.valueType);return{kind:"map",typeName:"Map",valueType:e.every(Boolean)?t.getUnionType(e):void 0}}return n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>vE(e,t,r)).find(e=>e?.kind==="map");let n=vb(e,r);return vg(n,E6.has(n)?t.getTypeArguments(e).at(-1):void 0)},vv=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return vE(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},vS=(e,t)=>vv(e,t)??vx(e,t),vC=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,vD=(e,t,r,n=new i)=>{if(!e||vn.has(e.type))return!1;if(vr.has(e.type))return vD(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&vD(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>vD(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(vo.has(e.type))return"truthy"!==r;if(va.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var o;let t="Literal"===(o=e.literal).type?o.value:"TemplateLiteral"===o.type&&0===o.expressions.length?o.quasis[0].value.cooked:"UnaryExpression"===o.type&&("-"===o.operator||"+"===o.operator)&&"Literal"===o.argument.type&&("number"==typeof o.argument.value||"bigint"==typeof o.argument.value)?"-"===o.operator?-o.argument.value:o.argument.value:void 0;return void 0!==t&&vC(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=vu(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=vd(o=vc(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=vD(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},vT=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,vA=(e,t,r)=>{if(nN.has(e.intrinsicName))return!1;let n=vT(e,t);return n&&n!==e?vA(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>vA(e,t,r)):!r.has(e.intrinsicName))},vw=(e,t,r)=>{if(nN.has(e.intrinsicName)||n$.has(e.intrinsicName))return!1;let n=vT(e,t);if(n&&n!==e)return vw(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>vw(e,t,r));if(vt.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;if(e.isBigIntLiteral?.())return e.value.negative||"0"!==e.value.base10Value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||E4.has(vb(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},vk=(e,t,r)=>{if(!tS(e)||"Identifier"!==e.callee.type||!E9.has(e.callee.name)||!vm(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n,o,a;let i;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],o=t,a=r,(i=rH(n,o))?vC(i.value,a):!tV(n)&&vi.has(n.type))})},vI=(e,t,r)=>{let n=vk(vl(e),t,r);if(void 0!==n)return n;let o=vv(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?vw(o,n,e):"not-undefined"===r?vA(o,n,new i(["undefined","void"])):vA(o,n,new i(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,s=o.visitedVariables??new i,l=o.checkConstructorValues??!0,u=vh(t,r);if(u?.kind==="map")return!!u.valueType&&vD(u.valueType,r,n);let p=((e,t,r,n)=>{if(!tS(e)||"Identifier"!==e.callee.type||!E9.has(e.callee.name)||!vm(e.callee,t))return;if(n){let n=vk(e,t,r);if(void 0!==n)return n}let o=vp(e).at(-1);return!!o&&vD(o,t,r)})(t=vl(t),r,n,l);if(void 0!==p)return p;let c=((e,t,r)=>{if("Identifier"!==e.type)return;let n=eD(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,s);if(!c)return!1;s.add(c);let[d]=c.defs,m=(a=vy(d.name?.typeAnnotation,r.sourceCode.getScope(d.name)),a?.kind==="map"?!!a.valueType&&vD(a.valueType,r,n):"Variable"===d.type&&"const"===d.parent.kind&&d.node.id===d.name&&!!d.node.init&&e(d.node.init,r,n,{visitedVariables:s,checkConstructorValues:!1}));return s.delete(c),m}(e,t,r)},vj="logical",vF="ternary",vB="consistent-conditional-object-spread",vR=new i(["==","==="]),vP=new i(["!=","!=="]),vL=e=>tA(e)||tV(e)||tf(e),vN=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function v$(e,t,r){if(rj(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return v$(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&v$(e.left,t.left,r)&&v$(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&v$(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function vM(e){return tf(e)?"null":tV(e)?"undefined":void 0}function vO(e){if("BinaryExpression"!==e.type||!vR.has(e.operator)&&!vP.has(e.operator))return;let t=vM(e.left),r=vM(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:vR.has(e.operator)}}let vq=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function vU(e,t){let r=vO(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=vO(e.left),o=vO(e.right);if(n&&o&&v$(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&vq(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&vq(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function vV(e,t,r){let n=ti(e,r);return!ts(e,r)&&iz(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function vW(e,t){let r=ti(e,t);return!ts(e,t)&&iM(e)&&(r=`(${r})`),r}function v_(e){for(;;){let t=rP(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function vz(e,t){return eD(t.sourceCode.getScope(e),e)}let vK="no-array-concat-in-loop",vG="no-array-front-mutation",vJ=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],vX="no-array-sort-for-min-max/error",vY="no-array-sort-for-min-max/suggestion",vH=e=>td(e)&&0===e.value,vQ=(e,t)=>{if(!tL(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||nu(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tI(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rP((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(rj(t.left,r)&&rj(t.right,n))return"ascending";if(rj(t.left,n)&&rj(t.right,r))return"descending"}})(r);if(n&&!(os(e.callee.object,t)||ol(e.callee.object,t)))return{direction:n,node:e.callee.object}},vZ=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:vX,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=ia(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:vY,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},v0="no-boolean-sort-comparator",v1="no-boolean-sort-comparator/suggestion",v2=new i(["sort","toSorted"]),v3=new i([">",">=","<","<="]),v8=(e,t,r,n)=>(e=rP(e),t=rP(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!rj(e.property,t.property):e.property.name===t.property.name)&&v8(e.object,t.object,r,n),v6=(e,t)=>{for(;rR(e);){if(e.typeAnnotation&&oG(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},v9="no-chained-comparison/error",v5="no-chained-comparison/suggestion",v4=new i(["<",">","<=",">="]),v7=new i(["===","!==","==","!="]),Se=v4.union(v7),St=e=>"BinaryExpression"===e.type&&Se.has(e.operator),Sr="no-constant-zero-expression/error",Sn="no-constant-zero-expression/suggestion",So="no-duplicate-logical-operands",Sa="no-duplicate-logical-operands/suggestion",Si=new i(["Identifier","ThisExpression","Literal"]),Ss=new i(["Identifier","ThisExpression"]),Sl=e=>{if(ci(e=rP(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return Sl(e.object)&&(!e.computed||(t=rP(t=e.property),Si.has(t.type)));default:return!1}},Su="no-impossible-length-comparison",Sp={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},Sc=(e,t)=>{var r;let n=rQ(e,t);return void 0!==n?n.value:("UnaryExpression"===(r=rP(r=e)).type&&("+"===r.operator||"-"===r.operator)&&(r=rP(r.argument)),"MemberExpression"!==r.type||r.computed&&"Literal"!==r.property.type||"Identifier"!==r.object.type||"Math"!==r.object.name&&"Number"!==r.object.name)?void 0:ez(e,t.sourceCode.getScope(e))?.value},Sd="no-invalid-character-comparison",Sm=new i(["==","===","!=","!=="]),Sf=(e,t)=>!!(tL(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&ok(e.callee.object,t)||tL(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&ok(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(td(e))return!0;if(!tu(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&ok(e.object,t),Sg="no-loop-iterable-mutation",Sy=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],Sh=["add","clear","delete"],Sx=["clear","delete","set"],Sb={array:new i(Sy),set:new i(Sh),map:new i(Sx),unknown:new i([...Sy,...Sh,...Sx])},SE=new i(["entries","keys","values"]),Sv=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function SS(e,t){return oa(e,t)?"array":og(e,t)?"set":oy(e,t)?"map":void 0}function SC(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function SD(e){return"Identifier"===(e=rP(e)).type?e:void 0}function ST(e){if("ArrayPattern"!==(e=rP(e)).type)return;let[t]=e.elements;return t&&SD(t)}function SA(e,t){if(ci(e=rP(e)))return;if(co(e))return{collectionKind:SS(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eG(e.callee,t.sourceCode.getScope(e.callee));if(!(!SE.has(r)||ci(e.callee.object))&&co(e.callee.object))return{collectionKind:SS(e.callee.object,t),reference:e.callee.object,method:r}}function Sw(e,t){let r=SC(e);return"keys"===t.method?SD(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?ST(r):void 0}function Sk(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=SC(e),"entries"===t.method?ST(r):"direct"!==t.method||"map"!==t.collectionKind?SD(r):void 0),a=Sw(e,t),i=(n=SC(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?SD(n):"direct"===t.method&&"map"!==t.collectionKind?SD(n)??ST(n):Sw(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*SI(e){"Identifier"===(e=rP(e)).type?yield e:"MemberExpression"===e.type&&(yield*SI(e.object),e.computed&&(yield*SI(e.property)))}function Sj(e,t,r){if(!cn(e,t))return!1;let n=[...SI(e)],o=[...SI(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=eD(r.sourceCode.getScope(e),e),i=eD(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function SF(e,t,r){let[n]=e.arguments;return!!(t&&n&&Sj(n,t,r))}function SB(e,t,r,n){return"add"===r&&SF(e,t.addArgumentIdentifier,n)||"set"===r&&SF(e,t.setKeyIdentifier,n)}let SR="no-selector-as-dom-name",SP=["add","remove","contains","toggle","replace"],SL=/^[#.]-?[A-Z_a-z][\w-]*$/u,SN=new i([".","#"]),S$=e=>SN.has(e?.[0]),SM=e=>tc(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),SO=(e,t,r,n)=>({node:e,messageId:SR,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(SL.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),Sq=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),SU="no-useless-compound-assignment/error",SV="no-useless-compound-assignment/remove",SW="no-useless-compound-assignment/replace",S_=new o([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),Sz="no-useless-delete-check",SK="removeCheck",SG={considerGetters:!0},SJ=new i(["Map","Set","WeakMap","WeakSet"]),SX=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),SY=new i(["ClassName","FunctionName"]),SH=new i(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),SQ=e=>null!==e&&("object"==typeof e||"function"==typeof e),SZ=e=>!!SH.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>SZ(e)),S0=(e,t)=>{if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e);return r?.defs.some(e=>SY.has(e.type))??!1},S1=(e,t)=>{let r=rH(e,t);if(!r&&rX(e,t))return;let n=r??ez(e,t.sourceCode.getScope(e));return n&&"symbol"!=typeof n.value&&!SQ(n.value)?String(n.value):void 0},S2=(e,t)=>{let r=ez(e,t.sourceCode.getScope(e));if(r)return SQ(r.value);let n=ni(rP(e),t);if(n){let e=rP(n),r=ez(e,t.sourceCode.getScope(e));if(r)return SQ(r.value);if(SX.has(e.type))return!0}return!S0(rP(e),t)&&SZ(((e,t)=>{if("Identifier"!==(e=rP(e)).type)return;let r=eD(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},S3=(e,t)=>!eZ(e,t.sourceCode,SG),S8=(e,t)=>tL(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),S6=(e,t,r)=>n=>{if(nt(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),ip(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},S9="no-useless-logical-operand",S5=new o([["&&",!0],["||",!1]]),S4=new o([["&&",!1],["||",!0]]),S7=new i(["FunctionExpression","ClassExpression","ObjectExpression"]),Ce="prefer-boolean-return",Ct=new i(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function Cr(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return Cr(t[0])}return e}}let Cn=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function Co(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return Ct.has(e.operator);case"LogicalExpression":return Co(e.left,t)&&Co(e.right,t);case"CallExpression":return tJ(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let Ca="prefer-flat-math-min-max",Ci=["min","max"],Cs=(e,t)=>tL(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),Cl=(e,t)=>{let r=[];for(let n of e.arguments){if(Cs(n,t)){r.push(...Cl(n,t));continue}r.push(n)}return r},Cu="prefer-hoisting-branch-code/start",Cp="prefer-hoisting-branch-code/end",Cc="prefer-hoisting-branch-code/suggestion",Cd=new i(["await using","using"]),Cm=(e,t)=>eZ(e,t)||function e(t,r){if("TaggedTemplateExpression"===t.type)return!0;for(let n of r.visitorKeys[t.type]??[]){let o=t[n];if(Array.isArray(o)){for(let t of o)if(t&&e(t,r))return!0;continue}if(o&&e(o,r))return!0}return!1}(e,t),Cf=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},Cg=(e,t,r)=>{let n=Cf(e,r),o=Cf(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function Cy(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function Ch({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!no(e))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return nt(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&nt(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(nt(a,[r,n-1]))return!0}return nt(a,Cy(e,i,a))}))&&(o||t.every(e=>!function(e,t,r){let{sourceCode:n}=r,{body:o}=e,[a]=n.getRange(o[o.length-t]),[i,s]=n.getRange(e);for(let t of n.getScope(e).variables){let[e]=t.defs;if(!e||e.parent?.type==="VariableDeclaration"&&"var"===e.parent.kind)continue;let[r]=n.getRange(e.name);if(!(r<=i)&&!(r>=a)){if(e.parent?.type==="VariableDeclaration"&&Cd.has(e.parent.kind))return!0;for(let e of t.references){let[t]=n.getRange(e.identifier);if(t>=a&&t<=s)return!0}}}return!1}(e,n,a))),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?Cu:Cp};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=r8(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1)),i=n.text.slice(o,a),s=r8(e[0],r);return s===t?i:i.split("\n").map((e,r)=>0===r?e:e.startsWith(s)?`${t}${e.slice(s.length)}`:e).join("\n")}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&ip(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
44
+ ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&ip(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
45
+ ${s}${c}${n}`)}for(let e of t)yield l.removeRange(Cy(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(Cm(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!Cm(e,s))?c.fix=i:c.suggest=[{messageId:Cc,fix:i}]}return c}let{parse:Cx}=l7,Cb="prefer-single-replace",CE=new i(["g","m","s"]),Cv=new o([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function CS(e){if(!tL(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(tu(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(tm(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!CE.has(e))return;try{r=Cx(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):("alternative"!==t.type||1!==t.body.length)&&("characterClass"!==t.type||t.negative||1!==t.body.length)?void 0:e(t.body[0])}(r)}}(t.regex)}let CC="consistent-tuple-labels",CD="no-invalid-well-known-symbol-methods/async-dispose",CT="no-invalid-well-known-symbol-methods/dispose-generator",CA="no-invalid-well-known-symbol-methods/sync-iterator",Cw="no-invalid-well-known-symbol-methods/async-iterator",Ck="no-invalid-well-known-symbol-methods/suggestion",CI=new i(["Promise","PromiseLike"]),Cj=new i(["dispose","iterator","asyncIterator"]);function CF(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&CI.has(e.typeName.name)}function CB(e,t){let r,n=function(e){if(e.computed&&"MemberExpression"===e.key.type&&!e.key.computed&&"Identifier"===e.key.object.type&&"Symbol"===e.key.object.name&&"Identifier"===e.key.property.type)return e.key.property.name}(e);if(!Cj.has(n))return;let o=function(e){if("get"!==e.kind&&"set"!==e.kind&&("MethodDefinition"===e.type||"PropertyDefinition"===e.type||"Property"===e.type))return e.value}(e);if(o?.type!=="FunctionExpression"&&o?.type!=="ArrowFunctionExpression")return;if("dispose"===n&&o.generator)return{node:e.key,messageId:CT};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?CF(r):"TSUnionType"===r.type&&r.types.some(e=>CF(e)))||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker(),n=r.esTreeNodeToTSNodeMap.get(e),o=t.getSignatureFromDeclaration(n);if(o)return!0===o4(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===o4(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:CD,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:CA};return o.generator&&(t.suggest=[{messageId:Ck,data:{replacement:"asyncIterator"},fix:t=>t.replaceText(e.key.property,"asyncIterator")}]),t}if("asyncIterator"===n&&!o.generator&&(o.async||a))return{node:e.key,messageId:Cw}}let CR="after-suspension",CP="in-generator",CL="in-nested-function",CN=["preventDefault","stopImmediatePropagation","stopPropagation"],C$="prefer-abort-signal-timeout",CM="prefer-abort-signal-timeout/suggestion",CO=new i(["reason","throwIfAborted"]),Cq=(e,t)=>{let r,{parent:n}=e;if(!(!tR(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nl(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tR(n.parent)&&n.parent.object===n&&(r=n.parent,CO.has(eG(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rR(r);)t=r,r=r.parent;return{expression:t,parent:r}})(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(n)||nt(t,t.sourceCode.getRange(n))))return n},CU=(e,t,r,n)=>{let o=eD(n.sourceCode.getScope(r),e);return o&&o!==t},CV="prefer-aggregate-error",CW=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,C_=new i(uG);function Cz(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rP(e)}function CK(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=CK(e.left);return t?`${t}.${e.right.name}`:void 0}}function CG(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?CG(e.typeAnnotation):e}function CJ(e,t,r,n=new i){switch(e=CG(e),e?.type){case"TSTypeReference":{let o=CK(e.typeName);if(!o)return!1;let a=im(o,t);if(C_.has(o)&&!((a?.defs.length??0)>0))return!0;if(n.has(o))return!1;n.add(o);let[i]=a?.defs??[],s=i?r.sourceCode.getScope(i.name):t,l=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&CJ(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>CJ(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>CJ(e,t,r,n));default:return!1}}function CX(e,t){let r;if(tR(e=Cz(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,CW.test(r))&&oa(e.object,t)&&function(e,t){let r=im(e.name,t.sourceCode.getScope(e)),[n]=r?.defs??[],o=n?t.sourceCode.getScope(n.name):t.sourceCode.getScope(e);return function e(t,r,n,o=new i){switch(t=CG(t),t?.type){case"TSArrayType":return CJ(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>CJ("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=CK(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return CJ(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=im(a,r),[l]=s?.defs??[],u=l?n.sourceCode.getScope(l.name):r,p=l?.type==="Type"&&"TSTypeAliasDeclaration"===l.node.type&&e(l.node.typeAnnotation,u,n,o);return o.delete(a),p}(t,r,n,o);case"TSUnionType":return t.types.every(t=>e(t,r,n,o));case"TSIntersectionType":return t.types.some(t=>e(t,r,n,o));default:return!1}}(n?.name?.typeAnnotation,o,t)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(!(r.isArrayType(t)||r.isTupleType(t)))return!1;let s=r.getTypeArguments(t);return s.length>0&&s.every(e=>(function e(t,r,n,o=new i){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);let s=nM(t);return!!(C_.has(s?.getName())&&nO(s,n))||nq(t,r).some(t=>e(t,r,n,o))})(e,r,n))}(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}}(e,t)}(e.object,t))return e.object}let CY=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&tl(Cz(t),0))return!0;let o=(n=Cz(n=t),n?.type==="Literal"&&"number"==typeof n.value?n.value:void 0);return void 0!==o&&(r?">"===e&&o>=0||">="===e&&o>=1:"<"===e&&o>=0||"<="===e&&o>=1)},CH=e=>"LogicalExpression"!==(e=Cz(e)).type||"&&"!==e.operator?[e]:[...CH(e.left),...CH(e.right)],CQ={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},CZ=new i(Object.keys(CQ)),C0=new i(["globalThis","self","window"]),C1=new i(["getBoundingClientRect","getClientRects"]),C2=new i(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),C3=new i(["innerHeight","innerWidth"]),C8=new i(["height","width"]),C6=new i(["Window"]),C9=new i(["VisualViewport"]),C5=new i(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),C4=(e,t,r)=>{let n;if(nN.has(e.intrinsicName))return!1;if(n$.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>C4(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return C4(o,t,r);let a=nM(e);return!(!a||nq(e,t).some(e=>!C4(e,t,r)))&&(!nO(a,r)||(n=a.getName(),!(C5.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},C7=(e,t,r,n)=>{if(nN.has(e.intrinsicName)||n$.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!n$.has(e.intrinsicName));return o.length>0&&o.every(e=>C7(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>C7(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return C7(o,t,r,n);let a=nM(e);return!!(a&&nO(a,r)&&n.has(a.getName()))||nq(e,t).some(e=>C7(e,t,r,n))},De=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return C7(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},Dt=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return C4(r.getTypeAtLocation(e),n,t)}catch{return!1}},Dr=e=>e.computed||"Identifier"!==e.property.type?tc(rP(e.property)):e.property.name,Dn=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?tc(rP(e.key)):e.key.name})(e))),Do=(e,t)=>"Identifier"===e.type&&C0.has(e.name)&&rF(e,t),Da=e=>nl(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),Di=(e,t)=>"Identifier"===(e=rP(e)).type?"visualViewport"===e.name&&rF(e,t):"MemberExpression"===e.type&&"visualViewport"===Dr(e)&&Do(rP(e.object),t),Ds=(e,t)=>{var r;return Do(e=rP(e),t)||("Identifier"===(r=rP(r=e)).type?"document"===r.name&&rF(r,t):"MemberExpression"===r.type&&"document"===Dr(r)&&Do(rP(r.object),t))||Di(e,t)},Dl=(e,t,r)=>{let n=rP(t);return Dn(e,C3)&&(Do(n,r)||De(t,r,C6))||Dn(e,C8)&&(Di(n,r)||De(t,r,C9))||Dn(e,C2)&&!Ds(n,r)&&!Dt(t,r)},Du=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tI(e))return!1;if(a=e,i=t,tv(a,void 0,tx)&&"MemberExpression"===a.callee.type&&C1.has(Dr(a.callee))&&!Ds(a.callee.object,i)&&!Dt(a.callee.object,i)||t$(e)&&C3.has(e.name)&&!Da(e)&&rF(e,t)||"MemberExpression"===e.type&&!Da(e)&&(n=Dr(e),o=rP(e.object),C3.has(n)&&(Do(o,t)||De(e.object,t,C6))||C8.has(n)&&(Di(o,t)||De(e.object,t,C9))||C2.has(Dr(e))&&!Ds(e.object,t)&&!Dt(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?Dl(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&Dl(e.left,e.right,t)))return!0;for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if(Array.isArray(o)){if(o.some(e=>Du(e,t,r)))return!0;continue}if(Du(o,t,r))return!0}return!1},Dp="prefer-set-methods/union",Dc="prefer-set-methods/intersection",Dd="prefer-set-methods/intersection-suggestion",Dm="prefer-set-methods/difference",Df="prefer-set-methods/difference-suggestion",Dg=(e,t)=>tS(e,{name:"Set",argumentsLength:1})&&rF(e.callee,t),Dy=(e,t)=>{let r=ti(e,t);return iU(e,t)&&!ts(e,t)?`(${r})`:r},Dh=(e,t,r)=>((e,t)=>{let r=e;for(;r.parent;){if("ExpressionStatement"===r.parent.type)return t.sourceCode.getRange(t.sourceCode.getFirstToken(r.parent.expression))[0]===t.sourceCode.getRange(t.sourceCode.getFirstToken(e))[0];r=r.parent}return!1})(e,r)&&ip(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,Dx=(e,t)=>("ParenthesizedExpression"===e.type||rR(e))&&e.expression===t,Db=e=>{for(;e.parent;){let{parent:t}=e;if(Dx(t,e)){e=t;continue}break}return e},DE=(e,t)=>e?.type==="SpreadElement"&&"Set"===iA(e.argument,t),Dv=(e,t,r)=>{if(!(!tL(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rj(e.arguments[0],t)||rj(e.callee.object,t))&&"Set"===iA(e.callee.object,r))return e.callee.object},DS=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=Db(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rR(e.parent))return;let o=((e,t)=>{if(!tL(e,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let r=((e,t)=>{if("ArrayExpression"===e.type&&1===e.elements.length&&DE(e.elements[0],t))return e.elements[0].argument})(e.callee.object,t);if(!r)return;let[n]=e.arguments;if("ArrowFunctionExpression"!==n.type||n.async||1!==n.params.length||"Identifier"!==n.params[0].type)return;let o=((e,t,r)=>{let n=Dv(e,t,r);if(n)return{method:"intersection",messageId:Dc,suggestionMessageId:Dd,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=Dv(e.argument,t,r);if(o)return{method:"difference",messageId:Dm,suggestionMessageId:Df,otherSet:o}})(n.body,n.params[0],t);if(!(!o||eZ(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${Dy(r,t)}.${o.method}(${ti(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,Dh(t,o.replacement,r))}]}},DC="prefer-toggle-attribute/error",DD="prefer-toggle-attribute/suggestion",DT=(e,t,r)=>{let n=ti(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?DT(e.argument,t,!1):(!ts(e,t.sourceCode)&&i_(e,"!")&&(n=`(${n})`),`!${n}`):ts(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},DA=(e,t,r)=>tL(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function Dw(e){if(e?.type==="ChainExpression"&&(e=e.expression),DA(e,["removeAttribute","hasAttribute"],1)||DA(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(tc(r)?.toLowerCase().startsWith("data-"))return;let o=t.property.name;return{node:e,method:o,receiver:t.object,attributeName:r,attributeValue:n,isOptional:!!t.optional,hasEmptyAttributeValue:"setAttribute"!==o||tl(n,"")}}}function Dk(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),Dw(e)}}let DI=(e,t)=>e.isOptional===t.isOptional&&rj(e.receiver,t.receiver)&&rj(e.attributeName,t.attributeName),Dj=(e,t)=>o2(e.receiver)||oE(e.receiver,t),DF="prefer-url-search-parameters/error",DB="prefer-url-search-parameters/suggestion",DR=new i(["node:url","url"]),DP=e=>"Type"===e.type||"ImportBinding"===e.type&&ic(e.node),DL=(e,t,r)=>{let n=eD(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>DP(e))},DN=(e,t)=>tc(rP(e))===t,D$=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},DM=(e,t)=>{var r,n;let o,a;if(!tL(e=rP(e),{method:"map",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let i=((e,t)=>{if(tL(e=rP(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})){var r;let n;if(!(!DN(e.arguments[0],"&")||ow(e.callee.object,t)||(r=e.callee.object,(n=rH(r,t))&&"string"!=typeof n.value)))return e}})(e.callee.object,t);if(!i)return;let[s]=e.arguments,l="ArrowFunctionExpression"!==s.type&&"FunctionExpression"!==s.type||s.async||s.generator||1!==s.params.length||"Identifier"!==s.params[0].type?void 0:"BlockStatement"!==s.body.type?{parameter:s.params[0],returnExpression:s.body}:1===s.body.body.length&&"ReturnStatement"===s.body.body[0].type&&s.body.body[0].argument?{parameter:s.params[0],returnExpression:s.body.body[0].argument}:void 0;if(l&&(r=l.returnExpression,n=l.parameter,tL(r=rP(r),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&ae(rP(r.callee.object),n)&&DN(r.arguments[0],"=")&&(1===r.arguments.length||2===(o=r.arguments[1],a=t,rH(o,a)?.value))))return{node:e,query:i.callee.object}},DO=(e,t)=>`new URLSearchParams(${D$(e,t)})`,Dq=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=ta(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},DU=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=ta(t,r);return[[n,a],[i,o]]},DV=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=eD(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>DP(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return DR.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||r7(n,e,r)))return[{messageId:DB,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:DF,suggest:a}},DW="no-unsafe-promise-all-settled-values",D_=new i(["PromiseSettledResult","PromiseRejectedResult"]),Dz=new i(["PromiseFulfilledResult"]),DK=new i(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),DG=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",DJ=e=>{for(;e&&DK.has(e.type);)e=e.expression;return e},DX=e=>tL(DJ(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),DY=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,DH=e=>tL(DJ(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function DQ(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?DQ(e.right):void 0}function DZ(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function D0(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DQ(t.typeName);return D_.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(DZ(e))}function D1(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DQ(t.typeName);return Dz.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(DZ(e))}function D2(e){if(e.isUnion())return e.types.every(e=>D2(e));let t=e.aliasSymbol??e.getSymbol();return Dz.has(t?.getName())}function D3(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>D3(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function D8(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let D6=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function D9(e,t,r=new i){var n;let o;return!!(D6(o=e)&&D0(o.typeAnnotation))||!!(e=DJ(e))&&(n=DJ(n=e),!!(n?.type==="AwaitExpression"&&DX(n.argument)||D0(e.typeAnnotation)||function(e,t){let r=D8(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D3(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return D_.has(r?.getName())}(a))}(e,t))||(DH(e)?D9(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=eD(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(D0(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&D9(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let D5=e=>(e=DJ(e),e?.type==="Identifier"?e.name:void 0),D4=e=>{if(e=DJ(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===eG(t)&&"Identifier"===t.value.type)return t.value}},D7=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function Te(e,t){return e=DJ(e),!!(t.statusVariable&&Tp(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&Tp(e.object,t.entryVariable,t.context)&&"status"===eG(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&D5(e.object)===t.entryName&&"status"===eG(e))}function Tt(e,t){if(e=DJ(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=Te(e.left,t)?D7(e.right):Te(e.right,t)?D7(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function Tr(e,t){return"fulfilled"===Tt(e=DJ(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(Tr(e.left,t)||Tr(e.right,t))}function Tn(e,t){return"unfulfilled"===Tt(e=DJ(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(Tn(e.left,t)||Tn(e.right,t))}let To=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&Tr(e.test,r)||e.alternate===t&&Tn(e.test,r)),Ta=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&Tr(e.left,r)||"||"===e.operator&&e.right===t&&Tn(e.left,r)),Ti=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&Tr(e.test,r)||e.alternate===t&&Tn(e.test,r)),Ts=e=>{let t;if(!DG(e)||0===e.params.length)return!1;let r={entryName:D5(e.params[0]),statusName:(t=e.params[0],D4(t)?.name)},n=DJ(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&Tr(e.argument,r)}return Tr(n,r)};function Tl(e){if(e=DJ(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===eG(t))return t}}let Tu=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function Tp(e,t,r){return e=DJ(e),e?.type==="Identifier"&&t&&eD(r.sourceCode.getScope(e),e)===t}function Tc(e){for(e=DJ(e);DH(e);){if(Ts(e.arguments[0]))return!0;e=DJ(e.callee.object)}return!1}function Td(e,t,{knownPromiseSettledResultArray:r=!1,branchAlwaysExits:n}={}){let o,a;if(!tL(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!D9(e.callee.object,t)||function e(t,r,n=new i){return!!(D6(t)&&D1(t.typeAnnotation)||function(e,t){let r=D8(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=D3(n,o);return!!(a&&D2(a))}(t=DJ(t),r))||("Identifier"===t.type?function(t,r,n){let o=eD(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(D1(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):DH(t)&&Tc(t)&&D9(t,r))}(e.callee.object,t))return;let[s]=e.arguments;if(!DG(s)||0===s.params.length)return;let[l]=s.params;if(function(e,t){let r=D8(e,t);if(!r)return!1;let{type:n}=r;return D2(n)}(l,t))return;let u=Tl(l);if(u&&"Identifier"!==u.value.type)return{node:u.key,messageId:DW};let p=D5(l),c=p&&eD(t.sourceCode.getScope(l),l),d=(o=Tl(l),a=o?.value,a?.type==="Identifier"?a:a?.type==="AssignmentPattern"&&"Identifier"===a.left.type?a.left:void 0),m=d&&eD(t.sourceCode.getScope(d),d),f=D4(l),g=f?.name,y=f&&eD(t.sourceCode.getScope(f),f),h=function e(t,r){var n;if(n=t=DJ(t),n=DJ(n),(n?.type==="MemberExpression"&&Tp(n.object,r.entryVariable,r.context)&&"value"===eG(n)||n?.type==="Identifier"&&Tp(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;n&&"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(To(n,r,t)||Ta(n,r,t)||Ti(n,r,t)||function(e,t,r,n){let o,a=e.parent?.body;if(!Array.isArray(a))return!1;let i=a.indexOf(e),s=a[i-1];return s?.type==="IfStatement"&&!s.alternate&&Tn(s.test,t)&&(o=s.consequent,ie(o,r,e=>{var t;return t=DJ(t=e),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||n(e)})||aQ(o,r))}(n,t,t.context,t.branchAlwaysExits))return!0;if(DY(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||Tu(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||DG(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(s.body,{entryName:p,entryVariable:c,statusName:g,statusVariable:y,valueVariable:m,context:t,branchAlwaysExits:n});if(h)return{node:h,messageId:DW}}let Tm="prefer-abort-signal-any",Tf="prefer-abort-signal-any/suggestion",Tg=new i(["reason","throwIfAborted"]),Ty=new i(["capture","once","passive"]),Th=new i(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),Tx=e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]},Tb=(e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})},TE=e=>{let t=e,{parent:r}=e;for(;rR(r);)t=r,r=r.parent;return{expression:t,parent:r}},Tv=(e,t)=>{let{parent:r}=e;if(!(!tR(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||nl(r)||("ForInStatement"===r.parent.type||"ForOfStatement"===r.parent.type)&&r.parent.left===r||((e,t)=>{let{expression:r,parent:n}=TE(e);return tR(n)&&n.object===r&&Tg.has(eG(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=TE(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||nt(t,t.sourceCode.getRange(r))))return r},TS=(e,t,r)=>{if(nN.has(e.intrinsicName))return;if(n$.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!n$.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>TS(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>TS(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return TS(n,t,r);let o=nM(e);if(o&&nO(o,r))return"AbortSignal"===o.getName();let a=nq(e,t).map(e=>TS(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},TC=(e,t)=>tv(e,{optional:!1},tx)&&tR(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),TD=e=>TC(e,["any","timeout"]),TT=e=>TC(e,["any"]),TA=(e,t)=>{if("Identifier"!==(e=rP(e)).type)return;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},Tw=(e,t)=>{if("Identifier"!==(e=rP(e)).type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},Tk=(e,t,r)=>tv(e,{optional:!1},tx)&&tR(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&rF(e.callee.object,r),TI=(e,t)=>(tv(e,{name:"Array",optional:!1},tx)||tS(e,{name:"Array"}))&&rF(e.callee,t),Tj=(e,t,r=new i)=>{if(e=rP(e),r.has(e))return!1;if(r.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Tj(e,t,r));if(Tk(e,"of",t)||TI(e,t))return e.arguments.some(e=>Tj(e,t,r));if(Tk(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=TA(n,t);if(o)return!!(!oa(o,t)||Tw(n,t))||Tj(o,t,r);let a=rP(n);return"ArrayExpression"!==a.type||Tj(a,t,r)}if(TT(e))return e.arguments[0]&&Tj(e.arguments[0],t,r);let n=TA(e,t);return n?!!(oa(n,t)&&Tw(e,t))||Tj(n,t,r):TC(rP(e),["abort"])},TF=(e,t,r,n=new i)=>{var o;if(e=rP(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&TF(e,t,r,n));if(Tk(e,"of",r)||TI(e,r))return e.arguments.some(e=>TF(e,t,r,n));if(Tk(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=TA(o,r);if(a)return!!(!oa(a,r)||Tw(o,r))||TF(a,t,r,n);let i=rP(o);return"ArrayExpression"!==i.type||TF(i,t,r,n)}if(TT(e))return e.arguments[0]&&TF(e.arguments[0],t,r,n);let a=TA(e,r);return a?!!(oa(a,r)&&Tw(e,r))||TF(a,t,r,n):tR(o=rP(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},TB=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return TS(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rP(e),t);if(!0===r)return!0;if(!1===r||t.sourceCode.parserServices?.program)return!1;if("Identifier"===e.type){let t;return"signal"===(t=e.name)||t.endsWith("Signal")}return TD(e)},TR=(e,t)=>"Identifier"===(e=rP(e)).type?TB(e,t):TD(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!eZ(e,t.sourceCode)),TP=(e,t)=>{if(!Tk(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rP(r);if("ArrayExpression"===n.type)return n;let o=TA(r,t);if(o&&oa(o,t)&&!Tw(r,t))return o},TL=(e,t,r=new i)=>{if(e=rP(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(e=>e&&"SpreadElement"!==e.type)?e.elements:void 0;if(Tk(e,"of",t)||TI(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=TP(e,t);if(n)return TL(n,t,r);let o=TA(e,t);if(o&&oa(o,t)&&!Tw(e,t))return TL(o,t,r)},TN=(e,t,r=new i)=>{if(e=rP(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||Tk(e,"of",t)||TI(e,t))return!0;let n=TP(e,t);return!!n&&TN(n,t,r)},T$=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?T$(e.right):void 0,TM=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return TM(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=T$(n.typeName);if("AbortSignal"===o)return!0;if(!o||"Identifier"!==n.typeName.type||r.has(n.typeName.name))return!1;r.add(n.typeName.name);let a=eD(t.sourceCode.getScope(n),n.typeName),s=a?.defs[0],l=s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&TM(s.node.typeAnnotation,t,r);return r.delete(n.typeName.name),l},TO=(e,t,r=new i)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?TO(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?TO(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?TM(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>TM("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=T$(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return TM(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=eD(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=TO(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,Tq=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Tq(e.typeAnnotation,t,r);if(e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===T$(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=eD(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&Tq(o.node.typeAnnotation,t,r)},TU=(e,t,r,n=new i)=>{if(!e||nN.has(e.intrinsicName)||n$.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>TU(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return TU(o,t,r,n);let a=nM(e);if(a&&nO(a,r)&&"ReadonlyArray"===a.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||nq(e,t).some(e=>TU(e,t,r,n))},TV=(e,t)=>{if(Th.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===T$(r.typeName)||Tq(e.typeAnnotation,t)||TV(e.expression,t)}if("Identifier"!==(e=rP(e)).type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&Tq(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&TV(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return TU(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},TW=(e,t,r=new i)=>{if(r.has(e))return!1;if(r.add(e),Th.has(e.type))return TO(e.typeAnnotation,t)??TW(e.expression,t,r);if("Identifier"===(e=rP(e)).type){let n=eD(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=TO(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&TW(o.node.init,t,r))return!0}return oa(e,t)},T_=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(tv(s,{optional:!1},tx)&&tR(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tR(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rP(o),a=rP(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&eD(n.sourceCode.getScope(o),o)===eD(n.sourceCode.getScope(a),a)))))return s.callee.object},Tz=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tv(r,{minimumArguments:2,maximumArguments:3,optional:!1},tx)&&tR(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===tc(rP(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rP(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return Ty.has(t)})))return{call:r,sourceSignal:r.callee.object}},TK=(e,t)=>!nt(t,t.sourceCode.getRange(e))&&!ne(t,e),TG=(e,t,r,n)=>{let o=eD(n.sourceCode.getScope(r),e);return o&&o!==t},TJ="prefer-block-statement-over-iife",TX=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,TY=(e,t)=>e!==t&&tI(e),TH=(e,t)=>TY(e,t)&&"ArrowFunctionExpression"!==e.type;function TQ(e,t,r,n=TY){return function o(a){if(r(a))return!0;if(n(a,e))return!1;for(let e of t[a.type]??[]){let t=a[e];for(let e of Array.isArray(t)?t:[t])if(e?.type&&o(e))return!0}return!1}(e)}let TZ=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,ek(o)?t.getRange(o)[1]:n]},T0="no-multiple-promise-resolver-calls",T1=e=>rR(e)||e?.type==="TSInstantiationExpression",T2=e=>"ReturnStatement"===e.type||"ThrowStatement"===e.type;function T3(e){for(;T1(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function T8(e){for(;T1(e);)e=e.expression;return e}let T6=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=T3(e);return tS(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&rF(r.parent.callee,t)},T9=e=>e.references.some(e=>e.isWrite()),T5=(e,t)=>{if("CallExpression"!==e.type)return;let r=T8(e.callee);return"Identifier"===r.type?t.get(r):void 0},T4=(e,t)=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&0===e.expression.arguments.length&&!!T5(e.expression,t);function T7(e){let t=[];return e.traverseSegments(e=>{e.reachable&&t.push(e)}),t}let Ae=({isTerminated:e=!1,resolverUncalled:t=!1,resolverCalled:r=!1,catchClausesAfterResolverCall:n=new i,pendingFinallyBlocksByCatchClause:a=new o}={})=>({isTerminated:e,resolverUncalled:t,resolverCalled:r,catchClausesAfterResolverCall:n,pendingFinallyBlocksByCatchClause:a}),At=e=>Ae({isTerminated:e.isTerminated,resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new i(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new o;for(let[r,n]of e)t.set(r,new i(n));return t}(e.pendingFinallyBlocksByCatchClause)}),Ar=(e,t,r)=>{if(e.isTerminated)return e;if(t.executor===r){let r=At(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=At(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new i,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function An(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let Ao=(e,t)=>void 0!==t&&e.isTerminated===t.isTerminated&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&An(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!An(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function Aa(e){let t=[],r=e,{parent:n}=e;for(;n&&!tI(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}function Ai(e,t,r){let n=Ae({isTerminated:e!==r.codePath.initialSegment,resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.terminatedSegments.has(t)||e.isTerminated||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return Ae({isTerminated:!0});let o=n.catchClausesBySegment.get(r);return o?Ae({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??Ae(),o,e,r);if(!a.isTerminated){for(let e of(n.isTerminated=!1,n.resolverUncalled||=a.resolverUncalled,n.resolverCalled||=a.resolverCalled,a.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of a.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let o of(r||(r=new i,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(o)}}}return n}let As=e=>{let t=T8(e.test);return t?.type==="Literal"&&!t.value},Al=e=>{let t=T3(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t};function Au(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&T6(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}let Ap=(e,t,r)=>"SequenceExpression"===e.type&&e.expressions.includes(t)||"LogicalExpression"===e.type&&e.left===t||"BinaryExpression"===e.type&&(e.left===t||e.right===t)||"UnaryExpression"===e.type&&e.argument===t||"AwaitExpression"===e.type&&e.argument===t||"ConditionalExpression"===e.type&&ie(e,r,T2)||T1(e)&&e.expression===t||"CallExpression"===e.type&&(e.callee===t||e.arguments.includes(t)&&!e.optional&&!aw(e.callee))||"NewExpression"===e.type&&(e.callee===t||e.arguments.includes(t))||"MemberExpression"===e.type&&(e.object===t||e.computed&&e.property===t&&!e.optional&&!aw(e.object)),Ac=(e,t)=>aQ(e,t),Ad=(e,t)=>"class-static-block"===e.origin||"class-field-initializer"===e.origin&&t.parent?.type==="PropertyDefinition"&&t.parent.value===t&&t.parent.static,Am="no-unnecessary-string-trim",Af=["startsWith","endsWith"],Ag=new i(["bigint","boolean","number","string","undefined"]),Ay=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),Ah=(e,t)=>rH(e=rP(e),t),Ax="no-useless-re-export",Ab=e=>"Identifier"===e.type?e.name:e.value;function AE(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let Av="preferGuard",AS="preferFallback",AC="guard",AD="fallback",AT=["keys","values","entries"],AA=e=>{if("ForInStatement"===e.type)return;let t=rP(e.right);if(tL(t,{object:"Object",methods:AT,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return t},Aw=e=>AA(e)?.arguments[0]??e.right,Ak=e=>"ForInStatement"===e.type||!!AA(e),AI={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return AI}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},recommended:{...c.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return AI}},rules:Object.assign({"sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended),{"sukka/prefer-single-boolean-return":"off"})},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return AI}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-array-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"error","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"warn","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":["warn",{preferThis:!1,preferSuper:!1}],"sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"error","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"error","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"error","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"error","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"error","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn","sukka/unicorn/no-invalid-well-known-symbol-methods":"error","sukka/unicorn/no-late-event-control":"error","sukka/unicorn/prefer-abort-signal-timeout":"warn","sukka/unicorn/prefer-aggregate-error":"warn","sukka/unicorn/prefer-observer-apis":"warn","sukka/unicorn/prefer-set-methods":"warn","sukka/unicorn/prefer-toggle-attribute":"warn","sukka/unicorn/prefer-url-search-parameters":"warn","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"error","sukka/unicorn/no-useless-re-export":"warn","sukka/unicorn/iteration-fallback-style":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return AI}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn"}},recommended_extra_with_typed_lint:{...c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return AI}},rules:Object.assign({"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/require-project-reference":"off","sukka/no-default-error":"off","sukka/unicorn/consistent-tuple-labels":"warn"},d.collectRules(c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint))},recommended_react:{...c.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return AI}}}},rules:Object.assign(c.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":N,"browser/prefer-location-assign":M,"jsx/no-template-literal":q,"jsx/no-unneeded-nested":U,"string/no-locale-case":W,"string/no-simple-template-literal":_,"unicode/no-bidi":H,"unicode/no-invisible":Z,"no-redundant-variable":ee,"no-single-return":er,"prefer-early-return":eo,"prefer-fetch":ea,"prefer-timer-id":el,"string/no-unneeded-to-string":eu,"type/no-force-cast-via-top-type":ep,"type/no-wrapper-type-reference":ed,"no-default-error":em,"require-project-reference":eh},Object.fromEntries(Object.entries({"unicorn/catch-error-name":{create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>v.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(i0(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(tL(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tL(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(o(n)||o(n.replaceAll(/_+$/g,"")))return;let a=eD(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=rD(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:mA,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>sk(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:mw,defaultOptions:[{name:"error",ignore:[]}],messages:{[mA]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>mQ(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return mQ(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name)return(e=>{let t=e.right;if("ClassExpression"!==t.type||!mO(t)||!t.id)return;let r=t.id.name,n=e.left.computed,o=e.left.property,a=rP(o),i=n?tc(a):o.name;if(void 0===i||i===r)return;let s=n?a:o,l=n?`'${r}'`:r;return{node:o,messageId:mk,fix:e=>e.replaceText(s,l)}})(e)})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[mk]:"Exported error name should match error class",[mI]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[mj]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[mF]:"Error constructors should accept `options` as the second parameter.",[mB]:"Error constructors should use `options` as the second parameter.",[mR]:"Pass the error message to `super()` as the first argument.",[mP]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||ts(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:i2}:void 0:{node:t,messageId:i3,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[i2]:"Do not nest ternary expressions.",[i3]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(i6.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&i9(e.parent.parent)&&i5(e.parent.parent.parent.init))||!!(i9(e)&&tR(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&i5(e.parent.init.object))}(eD(r,t)?.defs[0]?.name))return{node:t,messageId:i8}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[i8]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(st.has(t.name)){for(let r of si(e,t))if(r.references?.some(e=>sa(t,e.identifier)))return ss(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&st.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of si(e,t))if(su(t.key,r))return ss(t.key,r);for(let r of si(e,t))if(sl(t.key,r))return ss(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[i7]:"Use `.key` instead of `.{{name}}`.",[se]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tR(t,{property:"innerText"})||oE(t.object,e))return;let r=t.property;return{node:r,messageId:sp,suggest:[{messageId:sc,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(oE(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&oE(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&oE(r.right,t)})(t.parent.parent,e))return{node:t,messageId:sp,suggest:[{messageId:sc,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[sp]:"Prefer `.textContent` over `.innerText`.",[sc]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tL(t,{method:"join",argumentsLength:0,optionalCall:!1})||tL(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tW(t.callee.object,{property:"join"}))||0===t.arguments.length&&op(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:sF,fix:r=>sm(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[sF]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{e.on("ObjectExpression",function*(t){for(let r of t.properties)"Property"===r.type&&s$(r,e)&&(yield{node:r.key,messageId:sB})}),e.on(["PropertyDefinition","MethodDefinition"],t=>{if(s$(t,e))return{node:t.key,messageId:sP}}),e.on("MemberExpression",t=>{if("AssignmentExpression"===t.parent.type&&t.parent.left===t&&s$(t,e))return{node:t.property,messageId:sB}}),e.on("CallExpression",function*(t){if(tL(t,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})&&"SpreadElement"!==t.arguments[0].type){let[,r]=t.arguments;sN(r,e)&&(yield{node:r,messageId:sB})}if(tL(t,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0])||"SpreadElement"===r.elements[0].type)continue;let[t]=r.elements;sN(t,e)&&(yield{node:t,messageId:sB})}}),e.on("Identifier",e=>{if("then"===e.name&&("ExportSpecifier"===e.parent.type&&e.parent.exported===e||("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent))return{node:e,messageId:sR}}),e.on("VariableDeclaration",function*(t){if("ExportNamedDeclaration"===t.parent.type&&t.parent.declaration===t){for(let r of e.sourceCode.getDeclaredVariables(t))if("then"===r.name)for(let e of r.identifiers)yield{node:e,messageId:sR}}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[sB]:"Do not add `then` to an object.",[sR]:"Do not export `then`.",[sP]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tL(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tL(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eL(r,e.sourceCode),messageId:sM}:{node:r.callee.property,messageId:sM}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[sM]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":sK,"unicorn/no-new-buffer":{create:e=>{e.on("NewExpression",t=>{if(!tS(t,{name:"Buffer"}))return;let r=((e,t)=>{if(1!==e.length)return"from";let[r]=e;if("SpreadElement"===r.type)return;if("ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";if(oN(r,t))return"alloc";let n=rQ(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(t.arguments,e);return r?{node:t,messageId:sG,data:{method:r},fix:sY(t,e,r)}:{node:t,messageId:sJ,suggest:["from","alloc"].map(r=>({messageId:sX,data:{replacement:r},fix:sY(t,e,r)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[sG]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[sJ]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[sX]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:iY(l,e),messageId:sH,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tL(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!tu(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&sQ(o)&&(yield r(i,n,"leading")),e!==a-1&&sZ(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[sH]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":s1,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tA(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:s2,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=ts(i,e),[,l]=s?ta(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield sd(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[s2]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new i,n=new i,o=(t,r,n)=>tL(t,{method:r,optionalCall:!1,optionalMember:!1})&&rj(n.left.object,t.callee.object)&&!os(t.callee.object,e);e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tR(e.left,{property:"length",optional:!1})&&t_(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("LogicalExpression",e=>{t_(e)&&t.push(e)}),e.on("Program:exit",function*(){let a=new i(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,a,i)=>(function({node:e,operator:t,siblings:a}){return"||"===t&&r.has(e)&&a.some(t=>o(t,"every",e))||"&&"===t&&n.has(e)&&a.some(t=>o(t,"some",e))})({node:e,operator:t,siblings:[i[a-1],i[a+1]].filter(Boolean)}))})(e))),{sourceCode:s}=e;for(let t of a)yield{loc:{start:s.getLoc(t.left.property).start,end:s.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=ta(n,e),i=ta(o,e),s=[];return n===t?(s[0]=a[0],s[1]=i[0]):(s[0]=a[1],s[1]=i[1]),r.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{let{expression:r,parent:n}=s3(t);if(!(tL(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tI(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=s3(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=s3(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?ta(e,a):o&&"YieldExpression"===t.type?ta(t,a):"ArrowFunctionExpression"===t.type?o?ta(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!r7(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=s8(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(ta(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(ta(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(ta(e,r),(n=s8(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>i$(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{e.on("Literal",t=>{if(!td(t))return;let{raw:r}=t,n=r.match(/^(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!n)return;let{before:o,dotAndFractions:a,after:i}=n.groups,s=(o+a.replaceAll(/[.0_]+$/g,"")||"0")+i;if(s===r)return;let l="."===a,{sourceCode:u}=e,p=u.getRange(t)[0]+o.length+a.length;return{loc:iY([p-(r.length-s.length),p],e),messageId:l?s9:s6,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&iO.test(s)&&!ts(t,e)&&(n=`(${n})`,ip(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield sv(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[s6]:"Don't use a zero fraction in the number.",[s9]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":la,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tk,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){if(("ArrowFunctionExpression"===e.type&&"Identifier"===e.body.type&&e.body.name===e.params[0].name||"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&e.body.body[0].argument?.type==="Identifier"&&e.body.body[0].argument.name===e.params[0].name)&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&ll.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e){let t,r=(t=e.params[0].name,"ArrowFunctionExpression"===e.type&&lu(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&lu(e.body.body[0].argument,t)?e.body.body[0].argument:void 0);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=t=>{let r=n;return"Property"===e.parent.type&&e.parent.method&&e.parent.value===e?r=`: ${r}`:"MethodDefinition"===e.parent.type&&(r=` = ${r};`),t.replaceText(e,r)}),o}(t);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eL(t,n),messageId:li,data:{functionNameWithKind:eJ(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||(r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",messages:{[li]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){lf.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[lm]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":lx,"unicorn/prefer-array-index-of":lT,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tL(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:lA,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[lA]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tL(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&lj(e.callee.object)){let t=e.callee.property;return lF(e,{node:t,messageId:lk,data:{method:t.name}})}if(tv(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},tx)&&lj(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?lF(e,{messageId:lI}):lF(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&lj(t.argument))return lF("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&lj(e.right))return lF(e.right)}),e.on("BinaryExpression",function*(e){if("-"===e.operator||"*"===e.operator||"/"===e.operator||"%"===e.operator||"**"===e.operator)for(let t of[e.left,e.right])lj(t)&&(yield lF(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[lw]:"Prefer `Date.now()` over `new Date()`.",[lk]:"Prefer `Date.now()` over `Date#{{method}}()`.",[lI]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":lU,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tL(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=lJ(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rj(e.left,e.right)||"**"===e.operator&&tl(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new i(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:lV,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(a){let{sourceCode:i}=e;for(let r of(yield a.replaceText(t.callee.property,n),o)){let t=i.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield sj(t,",",a,e),yield sd(r,a,e)}for(let t of r)yield a.removeRange([ta(t.left,e)[1],i.getRange(t)[1]])}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of lG){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[lV]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":lH,"unicorn/prefer-number-properties":l3,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let{sourceCode:r}=e,n=((e,t)=>{if("apply"===eG(e.callee)&&2===e.arguments.length&&l6(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,l9(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eG(e.callee)&&"apply"===eG(e.callee.object)&&"prototype"===eG(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&l6(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,l9(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:l8,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[l8]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tR(t,{property:"length",optional:!1}))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:tL(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&og(n,e))return{node:t.property,messageId:l5,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);iU(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield sv(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[l5]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,o=((e,t)=>{let r;if(!tL(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tL(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(ow(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=tc(o);if("string"==typeof i){if(0===i.length)return;r=t0(i)}else if(!(r=(e=>{if(!tm(e)||e.regex.flags.includes("y"))return;let t=ud(e);if(!t||ug(t)||0===uf(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=tc(a);if("string"==typeof s)return`${ti(n.callee.object,t)}.replaceAll(${r}, ${t0(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:ua,fix:e=>e.replaceText(t,o)};if(!tL(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tL(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&tm(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new i,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!ut.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&tu(n=t.arguments[1])&&n.value===ue)return;let{arguments:a,callee:{property:s}}=t;if(ow(t.callee.object,e))return;let[l]=a;if(!rW(l,e)?.global)return;let u=s.name,p=function(e){if(!tm(e))return;let t=ud(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(ui.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?uc(t.body):up(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:uo,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:un,*fix(e){yield e.insertTextAfter(s,"All"),p&&(yield e.replaceText(l,p))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[un]:"Prefer `String#replaceAll()` over `String#replace()`.",[uo]:"This pattern can be replaced with {{replacement}}.",[ua]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["substr","substring"]})||ow(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tL(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(uy(t)&&uy(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&tl(e.right,1))return e.left})(t);return uh(r,t)??(uh(t,r)?r:void 0)??(n&&rj(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let{sourceCode:s}=r,l=rH(a,r),u=ta(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(td(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!ub(e.left)||!("Identifier"===t.type||tu(t))||!rj(e.left.object,t)||(o=((e,t)=>{let[r,n]=ta(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r),a.getAllComments().some(e=>{let t=a.getRange(e);return t[0]>=o[0]&&t[1]<=o[1]}))))return`-${e.right.raw}`})(i,e.callee.object,r);if(n)return void(yield sg(t,i,n,r));if(td(i)||ub(i))return;let o=ux(i);return"number"==typeof o?void(yield sg(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>td(e))){let e;return void(yield(e=String(a.value+i.value),sg(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?ux(o):void 0;if(!a){if(ub(o))return;if(void 0!==i)return void(yield sg(t,o,String(Math.max(0,i)),r));let e=ta(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=ux(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield sg(t,o,String(e[0]),r)),e[1]!==s&&(yield sg(t,a,String(e[1]),r));return}if(0===i||0===s){let e=ti(o,r),n=ti(a,r);yield sg(t,o,"0",r),yield sg(t,a,`Math.max(0, ${0===i?n:e})`,r);return}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||ow(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:uE,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[uE]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!ts(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:iY(ta(r,e),e),messageId:uv};return!function(e,t){let{sourceCode:r}=t,[n,o]=ta(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:uS,fix:t=>t.replaceTextRange(ta(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uv]:"IIFE with parenthesized arrow function body is considered unreadable.",[uS]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type)return;let{callee:r}=t;if(!(t.optional||nu(r))&&("Identifier"===r.type&&uD.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&uD.test(r.property.name))&&!tR(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:uC,fix:r=>sS(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[uC]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("Literal",e=>{if(tu(e))return uI({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(tm(e))return uI({node:e,original:e.raw,regex:uk,lowercase:t})}),e.on("TemplateElement",r=>{if(!tU(r.parent))return uI({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>sI(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[uT]:"Use uppercase characters for the value of the escape sequence.",[uA]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>tu(e)?u_(e,e.raw):tm(e)?function(e){let t,{raw:r}=e,{pattern:n,flags:o}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:i,hasReplacement:s}=uW(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),l=o.includes("u")||o.includes("v"),u=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(uB,t))return;let n=t+uB.length;for(;r=e[n],uR.test(r);)n++;if(n===t+uB.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+uB.length,n),16);if(!(o>1114111))return o}(e,t)&&u$(e,t))return!0;return!1}(n);if(!s&&(l||!u))return;let p=`/${s?i:n}/${uz(o)}`;return l?{node:e,messageId:uj,fix:t=>t.replaceText(e,p)}:!function(e,t){try{return new a(e,t),!0}catch{return!1}}(s?i:n,uz(o))?{node:e,messageId:uj}:{node:e,messageId:uj,suggest:[{messageId:uF,fix:t=>t.replaceText(e,p)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tU(t.parent))return u_(t,t.value.raw,(r,n)=>sI(t,n,e,r))})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[uj]:"Prefer Unicode code point escapes.",[uF]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new s;for(let{node:e,path:r}of new e7(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(uK.map(e=>[e,{[e7.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tL(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tL(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tR(e,{optional:!1}))return;let n=e.object;if(tT(n)||tA(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eG(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r){if(o)return void(yield r.replaceText(n,`${a}.prototype.${i}`));if(tR(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield sv(r,e,t))}}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tv(t,{names:uG,optional:!1},tE)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=uH.has(r)?uH.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:uJ,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:uY};let i=((e,t)=>{let r=rP(e),n=rO(r);if(n||rX(r,t))return((e,t)=>{if("Identifier"===e.type){let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;e=n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init?n.node.init:e}return"MemberExpression"===e.type&&"CallExpression"===e.object.type&&"MemberExpression"===e.object.callee.type&&!e.object.callee.computed&&"Identifier"===e.object.callee.object.type&&"Object"===e.object.callee.object.name&&"Identifier"===e.object.callee.property.type&&"freeze"===e.object.callee.property.name&&((e,t)=>{if(!e)return!1;if("ObjectExpression"===e.type)return!rX(e,t);if("Identifier"!==e.type)return!1;let r=eD(t.sourceCode.getScope(e),e),n=r?.defs.length===1?r.defs[0]:void 0;return n?.type==="Variable"&&n.parent?.kind==="const"&&n.node.id===n.name&&n.node.init?.type==="ObjectExpression"&&!rX(n.node.init,t)&&r.references.every(t=>t.init||t.identifier===e)})(e.object.arguments[0],t)})(r,t)?ez(r,t.sourceCode.getScope(e)):n?rQ(r,t):rH(r,t);return ez(r,t.sourceCode.getScope(e))})(a,e);if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:uY}:""===s?{node:a,messageId:uX}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[uJ]:"Pass a message to the `{{constructorName}}` constructor.",[uX]:"Error message should not be an empty string.",[uY]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":u9,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tS(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&po(t.test)))return;let r=e.argument.callee;return{node:r,messageId:u5,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[u5]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,r=new o,n=[],a=[],i=e=>{let r=rP(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);a.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?eD(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?pl(r):void 0,start:t.getRange(e)[0],scope:n})},s=e=>{switch(e.type){case"MemberExpression":i(e);break;case"AssignmentPattern":s(e.left);break;case"RestElement":s(e.argument);break;case"ObjectPattern":for(let t of e.properties)s("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&s(t)}};e.on("AssignmentExpression",e=>{s(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&s(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("VariableDeclarator",e=>{let n;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(n=e.init).type||"ThisExpression"===n.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&eD(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?pl(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let l=e=>{let n,o;if((o=e).computed||tv(o.parent,void 0,tE)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||nl(o))return;let i=rP(e.object),s=r.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&eD(l,u),c="ThisExpression"===i.type?pl(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(pc({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})&&(n=pp(r.objectPattern.properties.filter(e=>pu(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!pf(n);){if(pm(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type)return{node:e,messageId:pa};let m=t.getText(e),f=n.value.name;return{node:e,messageId:pa,suggest:[{messageId:pi,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=l(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[pa]:"Use destructured variables over properties.",[pi]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{pE.listen({context:e}),pv.listen({context:e}),pS.listen({context:e}),pC.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[ph]:"Use `String(new Date())` instead of `Date()`.",[px]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":pI,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tL(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tM(e)&&pF(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&pF(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tL(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:pj}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[pj]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,accessibility:a,decorators:i,key:s}=e;return(!!pU(e)||"MethodDefinition"===e.type)&&!!r&&!t&&"PrivateIdentifier"!==s.type&&!(n||o||void 0!==a||Array.isArray(i)&&i.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:pO,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body)if(pU(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tH(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r)if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,""),yield sx(a,t,n);else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);tH(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield sx(o,t,r);let a=pU(e)?n.getLastToken(e):n.getTokenAfter(e),i=ek(a);if(pU(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,pq);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[pO]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":p_,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tv(r.parent.parent,void 0,tE)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:pz,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:p3[a]}};return"NewExpression"===a&&p2(r)&&tS(n.parent,{names:pZ,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield sd(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),ew(u)&&(yield i.remove(u)),tT(r)||tA(r)){let e=t.getTokenAfter(n);ew(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return ew(e)?e:void 0}let a=t.getTokenAfter(e||s,ew);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!tL(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:pY};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:pQ,fix:t=>t.replaceText(r,r.properties.map(t=>ti(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tS(e,{names:pZ,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:pX,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!p2(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tS(r,{names:pZ,argumentsLength:1})||tS(r,{names:nL,minimumArguments:1})||tL(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tL(r,{objects:["Array",...nL],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tL(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=pK;switch(r.type){case"ForOfStatement":o=pG;break;case"YieldExpression":o=pJ;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>p8(r,t,e)}}),e.on("ArrayExpression",t=>{if(!p2(t))return;let r=t.elements[0].argument,n=!!tL(r,{methods:p1,optionalCall:!1,optionalMember:!1})&&oa(r.callee.object,e)&&oa(r,e);if(!n&&!(!oi(r,e)&&(tL(r,{methods:p0,optionalCall:!1,optionalMember:!1})?!p6(r,e):tL(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||p6(r,e)):tL(r,{method:"split",optionalCall:!1,optionalMember:!1})||tL(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tL(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tL(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tS(r,{name:"Array"}))))return;let o={node:t,messageId:pH};return tS(r,{name:"Array"})||tL(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>p8(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[pz]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[pK]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[pG]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[pJ]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[pX]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[pY]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[pH]:"Unnecessarily cloning an array.",[pQ]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=nI(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!p4(o))break;t&&p7(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,eI);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:p9,suggest:[{messageId:p5,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[p9]:"Useless case in switch statement.",[p5]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":cb,"unicorn/numeric-separators-style":cC,"unicorn/prefer-array-find":c_,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tL(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&tL(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tq(r.callee.object,cJ)||op(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=r7(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield sT(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:cz,fix:a}}),e.on("CallExpression",t=>{let r;if(!tL(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tL(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||nu(n.callee.object)||os(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!cY(a)||!cY(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!ae(s,l))return;let u=function(e,t){if(ts(e,t))return ti(e,t);let r=t.sourceCode.getText(e);return iU(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(ts(e,t))return ti(e,t);let r=t.sourceCode.getText(e);return cX.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:cK,suggest:[{messageId:cG,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cz]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[cK]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[cG]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":c6,"unicorn/prefer-array-some":c7,"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=(e,n,o,a)=>{let i=r.at(-1),s=((e,t,r="=")=>{if(e&&t&&"Identifier"===e.type){if("="===r&&"LogicalExpression"===t.type&&("||"===t.operator||"??"===t.operator)&&"Identifier"===t.left.type&&"Literal"===t.right.type)return{assignedIdentifier:e,parameterIdentifier:t.left,defaultValue:t.right};if(("||="===r||"??="===r)&&"Literal"===t.type)return{assignedIdentifier:e,parameterIdentifier:e,defaultValue:t}}})(n,o,a);if(!i||!s||e.parent!==i.body||i.body.body.some(e=>"use strict"===e.directive))return;let{assignedIdentifier:l,parameterIdentifier:{name:u},defaultValue:{raw:p}}=s,{name:c}=l,d="ExpressionStatement"===e.type;if(d&&c!==u)return;let m=t.getScope(e),f=eD(m,u);if(!f)return;let{references:g}=f,{params:y}=i,h=y.at(-1);if(h?.type!=="Identifier"||h.name!==u)return;let x=c===u?f:eD(m,c),b=x?.defs.some(e=>"Parameter"===e.type&&e.name!==h)??!1;if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(dn(e,n))return!0}return!1})(t,i,e)||d&&g[0].identifier!==n||!d&&g.length>1||b)return;let E=d?h.typeAnnotation:l.typeAnnotation,v=E?`${c}${t.getText(E)}`:c,S=((e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r),o=e.getTokenAfter(r);return!o||!n||"("!==n.value||")"!==o.value})(t,i)?`(${v} = ${p})`:`${v} = ${p}`;return{node:e,messageId:de,suggest:[{messageId:dt,*fix(r,{abort:n}){if(t.getCommentsInside(e).length>0||t.getCommentsInside(h).length>0)return n();yield r.replaceText(h,S),yield((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)}}]}};e.on(tk,e=>{r.push(e)}),e.onExit(tk,()=>{r.pop()}),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return n(e.parent,e.left,e.right,e.operator)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&1===e.parent.declarations.length)return n(e.parent,e.id,e.init)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters over reassignment.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[de]:"Prefer default parameters over reassignment.",[dt]:"Replace reassignment with default parameter."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r,i=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=df(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=df(e.left),o=df(e.right);if(n&&o&&dc(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&dg(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&dg(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||t.sourceCode.getCommentsInside(e).length>0)return;let{reference:i}=a;if(a.isTrueWhenNullish&&dc(i,o,t.sourceCode))return dd({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&dc(i,n,t.sourceCode))return dd({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tV(s)||!tR(l)||l.optional||!rj(rP(i),rP(l.object))||function(e){let t=e,{parent:r}=t;for(;rR(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=ns(e,t);if(nt(t,n))return;let[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);if(u)return{node:e,messageId:di,suggest:[{messageId:dl,fix(r){let n=u;return ip(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(dc(n,o,t)?dd({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&dc(n.argument,a,t)?dd({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[da]:"Prefer using a logical operator over a ternary.",[di]:"Prefer using optional chaining over a ternary.",[ds]:"Switch to `{{operator}}` operator.",[dl]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?dy:dh,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tH(t,{test:ej,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tH(o,{test:eF,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[dy]:"Remove unused catch binding `{{name}}`.",[dh]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":dz,"unicorn/prefer-set-has":d6,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!tu(t)||function(e){let{parent:t}=e,{type:r}=t;return tC(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||d9(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=d7(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:d5,*fix(r){yield sv(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||d7(t)!==e)||d9(t)))return{node:t,messageId:d5,*fix(r){for(let n of(yield sv(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield sI(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tR(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/\r?\n/.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:d4,*fix(r){let n=a.getTokenBefore(t);ip(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||o5(n,t.quasi,e)||ts(t,e)||(yield sh(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||o5(n,t.quasi,e)||ts(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield sd(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[d5]:"`String.raw` should be used to avoid escaping `\\`.",[d4]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":mi,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:ms,fix:r=>sm(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[ms]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new i,r=[e.ast];for(;r.length>0;){let n=r.pop();if(n){if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}for(let t of e.visitorKeys[n.type]??[]){let e=n[t];Array.isArray(e)?r.push(...e):r.push(e)}}}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let o=new l,a=a=>{let i;if("TemplateLiteral"!==a.type||o.has(a))return;o.add(a);let s="__PLACEHOLDER__"+Math.random(),l=a.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(a),d=t.lines[c.start.line-1].match(/^(\s*)\S/),m=d?d[1]:"";i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return mm(mg(e.lines,t)).indent||mm(ml(r=mg(n.split(/\r?\n/)))).indent||mm(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=ml(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+mu(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:mf,fix:t=>g.split(s).map((r,n)=>sI(a.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(d9(e)||r.tags.length>0&&tU(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tq(e.parent.callee,r.functions))})(e))return a(e)}),e.on(r.selectors,e=>a(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:my,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[mf]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tL(t,{object:"Promise",methods:pL,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:pB,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tw(t.parent.parent)))return n.fix=r=>r.replaceText(t,pN(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(p$(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&pM(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&pM(t.left)&&tw(t.parent)?t.left:void 0})(n);if(o){if(p$(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,pN(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&tl(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!p$(r,a))return r=>r.replaceText(a,`await ${pN(e,t)}`)})(t,e),n):(n.suggest=[{messageId:pR,fix:r=>{let[n]=t.arguments[0].elements,o=ti(n,e);return ts(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),ip(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:pP,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),ew(i)&&(yield e.remove(i))}}],n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[pB]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[pR]:"Use the value directly.",[pP]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tL(t,{object:"Promise",methods:mb,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements)r?.type==="AwaitExpression"&&(yield{node:r,messageId:mh,data:{method:t.callee.property.name},suggest:[{messageId:mx,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield sx(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[mh]:"Promise in `Promise.{{method}}()` should not be awaited.",[mx]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&mS.has(t.operator)&&mC(n))||mC(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:mE,suggest:[{messageId:mv,data:{operator:i},*fix(s){yield sv(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!ts(t,e)&&(o5(o.getFirstToken(u),l,e)||(yield sh(s,u,e))),yield s.remove(a),ip(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[mE]:"Negated expression is not allowed in equality check.",[mv]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){mD(e,{methods:["slice"],messageId:mT})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[mT]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(m0(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&m0(t.parent.parent)&&t.parent.parent.consequent===t.parent||m0(t.parent)&&t.parent.consequent===t))return{node:t,messageId:mZ,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...m1(i,r)},l={...e,...m1(e,r)},u=m6(s,r),p=m9(s,t,r),c=m8(m3(m6(l,r)),m9(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(eP(a)){let t=n.getTokenAfter(e);t&&ip(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?m3(m2(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?m3(m2(s.openingBraceToken,l.ifToken,r)):m3(m2(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?m3(m2(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:m3(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:m3(m8(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=m2(t.closingParenthesisToken,t.openingBraceToken,n),r=m2(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=m2(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[mZ]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!td(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rA(t,e);if(!(n.commentsExistBetween(o,a)||op(t.callee.object,e)))return{node:r,messageId:m5}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[m5]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:m4,*fix(n){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield sd(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r){let n="IfStatement"===t.type,[o,a]=[t.consequent,t.alternate].map(e=>{let t=ta(e,r),o=r.sourceCode.text.slice(...t);return n&&"BlockStatement"!==e.type&&(o=`{${o}}`),{range:t,text:o}});if(o.text===a.text)return;let{sourceCode:i}=r;yield e.replaceTextRange(i.getRange(o),a.text),yield e.replaceTextRange(i.getRange(a),o.text)}(n,t,e),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield sv(n,t,e);let{sourceCode:o}=e,{parent:a}=t,[i,s]=o.getFirstTokens(r,2);"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type||a.argument!==t||o5(i,s,e)||ts(t,e)||ts(r,e)?ip(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield sh(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[m4]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{if(!("ObjectExpression"===e.right.type&&e.right.properties.length>0&&tI(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:m7,data:{parameter:t.name}}:{node:r,messageId:fe}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[m7]:"Do not use an object literal as default for parameter `{{parameter}}`.",[fe]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{e.on("CallExpression",t=>{if("MemberExpression"!==t.callee.type)return;let r=function(e){let{callee:t,arguments:r}=e,n=t.property.name,o=t.object,a=r;if(fr.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=fn(t.object),!fr.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=fr.get(n),l=t.object.object;if(tT(l)||"slice"===n&&tl(l,"")||"prototype"===fn(l)&&"Identifier"===l.object.type&&s.has(l.object.name)){if([o]=r,i){let[,e]=r;if(!e||"ArrayExpression"!==e.type)return;a=e.elements}else a=r.slice(1);return{method:n,target:o,argumentsNodes:a}}}(t);if(!r)return;let{method:n,target:o,argumentsNodes:a}=r,{argumentsIndexes:i}=fr.get(n),s=i.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=rP(t);if("BinaryExpression"===o&&"-"===a&&td(n=rP(s))&&n.value>0)return ca(i,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:ft,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=ta(e,r);return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[ft]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(tL(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tM(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(fs)&&fa(r)&&fa(`${fs}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:fi,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],fs)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[fi]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tS(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tL(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e;return{node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:fl,fix:t=>sT(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[fl]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&fp(n.key)&&("get"===n.kind&&(fd(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&fc(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!fd(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)})(e,n)))return{node:e.parent,messageId:fu,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[fu]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tR(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(fy(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tS(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&fy(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&(o=e.arguments[0],o?.type==="Literal"&&("."===o.value||"./"===o.value))&&e.arguments[1]===r&&fy(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(fh(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"!==n.type||n.init!==e||"Identifier"!==n.id.type||"VariableDeclaration"!==n.parent.type||"const"!==n.parent.kind)return;let o=eD(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;fh(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?fm:ff,fix:r=>r.replaceText(e,`import.meta.${t}`)}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[fm]:"Do not construct dirname.",[ff]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tL(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&tl(t.arguments[0],1))||op(t.callee.object,e))return;let[r]=t.arguments;return{node:r,messageId:fx,fix:t=>sf(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[fx]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){mD(e,{methods:["splice","toSpliced"],messageId:fb,checkArrayReceiver:!0})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[fb]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&uG.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&tL(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tR(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=eD(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:fE},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[fE]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=r.body.find(e=>"PropertyDefinition"===e.type&&!e.computed&&!e.static&&e.key.type===s&&e.key.name===a),u={node:o,messageId:fv};function*p(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),l){if(l.value)return void(yield s.replaceText(l.value,i));let e=` = ${i}`,r=t.getLastToken(l);return ek(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=r8(n,e),c=`${p}${a} = ${i};
48
46
  `;"\n"!==t.getText()[t.getRange(u)[0]-1]&&(c=`
49
- ${c}`);let d=r.body.at(-1);"PropertyDefinition"===d.type&&";"!==t.getLastToken(d).value&&(c=`;${c}`),yield s.insertTextBefore(u,c)}return l?.value?u.suggest=[{messageId:mG,fix:p}]:u.fix=p,u})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mK]:"Prefer class field declaration over `this` assignment in constructor for static values.",[mG]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!tb(t,{name:"BigInt",argumentsLength:1,optional:!1},ty))return;let[r]=t.arguments,n=function(e){let t,r;if(ts(e)){let t,r=e.raw.slice(1,-1);try{t=BigInt(r)}catch{return}let n=0n===t?"0":r.trim();return n.startsWith("+")&&(n=n.slice(1).trim()),{shouldUseSuggestion:r.includes("+"),text:`${n}n`,bigint:t}}let n=!1,o=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)n=!0,e=e.argument;else{if("-"!==e.operator)return;o=!o,e=e.argument}let{value:a,raw:i}=e;if(Number.isInteger(a)){try{t=BigInt(a)}catch{return}return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;for(let{prefix:e,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(t.startsWith(e))return t.slice(2)===r.toString(n);return!t.includes("e")&&t===String(r)})(e)?r=`${i}n`:(r=`${t}n`,n=!0),o&&0n!==t&&(r=`-${r}`,t=-t),{shouldUseSuggestion:n,text:r,bigint:t}}}(r);if(!n)return;let o={node:t,messageId:mJ},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!ta(t,e)&&s<0n&&(n=`(${n})`,aL(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:mX,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mJ]:"Prefer using bigint literal over `BigInt(…)`.",[mX]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!m1(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&m2(o,a))return mZ(r,function*(n){let i=to(o.callee.object.object,e),s=to(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=m3(p,u,o),d=c?"":m0(p,e,u),m=o.callee.object.optional||a.callee.object.optional||c?.callee.object.optional,f=`${i}${m?"?":""}.classList.toggle(${s}${d?`, ${d}`:""})`;l||(f+=";"),aL(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield iG(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>ts(e)&&("add"===e.value||"remove"===e.value))&&r[0].value!==r[1].value&&"MemberExpression"===t.parent.type&&t.parent.computed&&!t.parent.optional&&t.parent.property===t&&mQ(t.parent.object)&&tb(t.parent.parent,{optional:!1,argumentsLength:1},ty)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return mZ(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=m3(i,a,o)?"":m0(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield iX(r,n,e,".toggle")},t)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mY]:"Prefer using `Element#classList.toggle()` to toggle class names.",[mH]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:m8,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&tD(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:m8,data:{type:"import expression"},fix:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(eT(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,eT),...t.getTokens(a),...tr(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[m8]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of fi)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,{testValue:r,getProblematicNode:n,getProblem:o,getFix:a}){let i,s="AssignmentExpression"===t.type,[l,u]=(s?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===l.type&&r(u)))return;let p=t.parent;if(!(s&&"="===t.operator&&"ExpressionStatement"===p.type&&p.expression===t||!s&&"VariableDeclaration"===(i=t.parent).type&&i.declarations.at(-1)===t))return;let c=ig(p,e);if(c?.type!=="ExpressionStatement")return;let d="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):eS(e.sourceCode.getScope(t),t.left.name);if(!d)return;let m={context:e,variable:d,variableNode:l,valueNode:u,statement:p,nextExpressionStatement:c,assignType:s?"assignment":"declaration",getFix:a},f=n(m);if(f)return o(f,m)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[m6]:"Immediate mutation on {{objectType}} is not allowed.",[m9]:"{{operation}} the elements to the {{assignType}}.",[m5]:"Move this property to the {{assignType}}.",[m4]:"{{description}} the {{assignType}}.",[m7]:"Move the element to the {{assignType}}.",[fe]:"Move the entry to the {{assignType}}."},languages:["js/js"]}},"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;let n;if(!tE(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[o]=t.arguments,a="LogicalExpression"===o.type&&"??"===o.operator,i=a?o.right:o,s=tC(r=i)?"empty array":ti(r,"")?"empty string":td(r)?"`null`":tq(r)?"`undefined`":void 0;if(!s)return;let l=!1;if(a)n=function*(t){let{sourceCode:r}=e,n=i.parent,{left:o}=n,a=ta(o,e),[,s]=a?tn(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield iM(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>iq(t,i,e);let u={node:i,messageId:fs,data:{description:s}};return l?u.suggest=[{messageId:fl,fix:n}]:u.fix=n,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fs]:"The {{description}} is useless.",[fl]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tE(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tR(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:fu,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield iz(t,e,n);let[o]=r.arguments,a=tn(r,e),i=tn(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!ta(t,e)&&ta(t.callee,e)&&aL(e.sourceCode.getTokenBefore(t),e,"(")&&(yield n.insertTextBefore(t,";"))}}})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[fu]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{let t=e.physicalFilename;if("<input>"===t||"<text>"===t)return;let r=e.options[0]||{},n=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),o=(r.ignore||[]).map(e=>v.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>fL[e].fn);e.on(rZ,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=S.relative(r,S.resolve(r,t)))||".."===l||l.startsWith(`..${S.sep}`)||S.isAbsolute(l)?[S.basename(t)]:l.split(S.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=S.extname(e),n=S.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".",1);Object.assign(o,{filename:e,middle:n.slice(e.length)})}return o}(p.at(-1),{multipleFileExtensions:a});if(p.some(e=>o.some(t=>t.test(e))))return;if(i)for(let e of p.slice(0,-1)){let t=function(e,t,r){let n,{leading:o,words:a}=fO(e);if(e.startsWith("$")||fN(a,r))return;let i=f$(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:fT,data:{directory:e,chosenCases:fq(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),fI.format(n))}}}(e,n,s);if(t)return t}if(fk.has(c))return;let{leading:g,words:y}=fO(d);if(d.startsWith("$")||fN(y,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:fA,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let h=f$(y,s,{leading:g,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:fD,data:{chosenCases:fq(n),renamedFilenames:(u=h.map(e=>`\`${e}\``),fI.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:fU,defaultOptions:[],messages:{[fD]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[fT]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[fA]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tO(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:fW,fix:r=>i1(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[fW]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tE(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tE(t,{names:r9,minimumArguments:1}))||!f8(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?f6(r,e):void 0,o=t.arguments.length>1?f9(r,e,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{objects:["Array",...r9],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?f6(r,t):void 0,o=e.arguments.length>1?f9(r,t,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tR(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?f6(r,t):void 0,o=e.arguments.length>1?f9(r,t,f0):void 0;return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tR(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!f8(e.arguments[0]))return;let r=e.arguments[0],n=f9(r,t,f0);return{node:r.callee.property,messageId:fX,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tR(e,{methods:f2,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tR(e,{method:f3,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!f8(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===f3;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=fJ(r)).type||"FunctionExpression"===r.type)&&(r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=f9(s,t,f1,{method:a});return{node:s.callee.property,messageId:fZ,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!f8(t.right))return;let r=f6(t.right,e);return{node:t.right.callee.property,messageId:fY,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!f8(t.argument))return;let r=f6(t.argument,e);return{node:t.argument.callee.property,messageId:fH,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!f8(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=f6(t.argument,e);return{node:t.argument.callee.property,messageId:fQ,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fX]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[fY]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[fH]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[fQ]:"Spread works on iterables, `.toArray()` is unnecessary.",[fZ]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[f0]:"Remove `.toArray()`.",[f1]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||function(e){let{operator:t}=e,{parent:r}=e;for(;rL(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tG(t,r)||tJ(t))return!0;let{parent:n}=t;return rL(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rN(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:gt(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>e&&t>a);if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||gt(n=e)||function e(t){let r=rN(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>gt(t)||ge(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rL(t)){let e=rN(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=tn(o,r),[,s]=tn(a,r),l={range:[i,s]};return eF(n.getTokenBefore(l,{includeComments:!0}))||eF(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=ta(e,t),a=o?to(e,t):t.sourceCode.getText(e);return!o&&ii(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?f5:f4,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[f5]:"Prefer this simple condition first in the `{{operator}}` expression.",[f4]:"Consider moving this simple condition first after verifying short-circuit behavior."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!gn.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:gr,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eF(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||rW(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rR(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
50
- ${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[gr]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(gf(e)){if(gm(e.object,"childNodes"))return"childNodes";if(gm(e.object,"children"))return"children"}})(t);if(!n||oh(t.object.object)||"children"===n&&gm(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tF(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&gm(t.parent,"children")&&gf(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:go,suggest:gy(t,"firstChild",gu,e)}:"children"===n&&0===o?{node:t,messageId:ga,suggest:gy(t,"firstElementChild",gp,e)}:"children"===n?{node:t,messageId:gi}:void 0}),e.on("MemberExpression",e=>{if(!(!gh(e)||!gh(e.object)||!(!gh(e.parent)||e.parent.object!==e)||oh((e=>{for(;gh(e);)e=e.object;return e})(e))))return{node:e,messageId:gs}}),e.on("CallExpression",t=>{if(!gb(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&gb(t.parent.parent)&&gx(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;gb(e);){let[r]=e.arguments;if(!gx(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||oh(e))return;let r=[];for(let e of t)r.unshift(tu(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:gl,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(gg(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=to(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.object.type&&["globalThis","window"].includes(n.object.name)&&"Identifier"===n.property.type&&"document"===n.property.name?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${tQ(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:gc,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[go]:"Prefer `.firstChild` over `.childNodes[0]`.",[ga]:"Prefer `.firstElementChild` over `.children[0]`.",[gi]:"Consider `.querySelector()` over positional child traversal.",[gs]:"Consider `.closest()` over chaining `.parentElement`.",[gl]:"Consider merging chained `.querySelector()` calls.",[gu]:"Switch to `.firstChild`.",[gp]:"Switch to `.firstElementChild`.",[gc]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=(({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:r="internal",checkShorthandImports:n="internal",checkShorthandProperties:a=!1,extendDefaultReplacements:s=!0,replacements:l={},allowList:u={}}={})=>{let p=new o(Object.entries(s?{...gT,...l}:l).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:a,replacements:p,replacementRegExp:p.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(gw(n)),r.push(gw(iy(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${gk}`,"gv")})(p):void 0,allowList:new i(Object.keys(u))}})(e.options[0]),r=new s,n=new s,a=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),l=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,n=r.get(t.name);return n?u({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):u(e)}let[t]=e.defs;return void r.set(t.name,e)}return u(e)},u=r=>{var o;if(0===r.defs.length)return;let s=gI(r.name,t);if(!s)return;let[l]=r.defs;if(!(!("ImportDefaultSpecifier"===(o=l.name).parent.type&&o.parent.local===o||"ImportNamespaceSpecifier"===o.parent.type&&o.parent.local===o||"ImportSpecifier"===o.parent.type&&o.parent.local===o&&"Identifier"===o.parent.imported.type&&"default"===o.parent.imported.name||"VariableDeclarator"===o.parent.type&&o.parent.id===o&&tN(o.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||gS(l)))||!(!ak(l.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||gS(l)))||!t.checkShorthandProperties&&aF(l.name))return;let u=[...r.references.map(e=>e.from),r.scope],p=r$(s)?rS(s,u,a):void 0,c=gj(l.name,p??s);if(p&&r1(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!gE.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of u)n.has(e)||n.set(e,new i),n.get(e).add(p);c.suggest=[{messageId:gD,data:{replacement:p},fix:t=>i0(r,p,e,t)}]}e.report(c)},p=e=>{for(let t of e.variables)l(t)},c=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=gI(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||gv.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=gj(r,n);e.report(o)};e.on("Identifier",c),e.on("PrivateIdentifier",c),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of ry(e.sourceCode.getScope(r)))p(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:gF,defaultOptions:[{}],messages:{[gC]:"Prefer `{{replacement}}` over `{{name}}`.",[gD]:"Rename to `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!tE(e,{name:"File",minimumArguments:2,maximumArguments:2})||!gP(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===tu(n))return;let[o]=r.elements;if(function(e,t,r){let n=gL(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tE(o,{name:"Blob",maximumArguments:1})||tE(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&gP(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=eS(r.getScope(n),n);if(!i)return;let s=r1(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tR(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&gP(n.callee.object,t)?{call:n,kind:"blobArgument"}:tR(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=gL(n.callee.object,t)?.init,tE(r,{name:"FormData",argumentsLength:0})&&gP(r.callee,t))?{call:n,kind:"formData"}:void 0}(l,t);if(!u)return;let p=function(e){let[,t]=e.arguments;return t}(o);if(!(!function(e,t,r){if("Identifier"!==e.type)return!0;let{sourceCode:n}=r;return eS(n.getScope(e),e)===eS(n.getScope(t),e)}(a,l,t)||function(e,t){let{sourceCode:r}=t;return r.getCommentsInside(e).length>0||r.getCommentsBefore(e).some(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1)||rW(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:gB,suggest:[{messageId:gR,*fix(n){yield iQ(e.parent,t,n),yield n.replaceText(l,r.getText(a)),"formData"===u.kind&&2===u.call.arguments.length&&(yield n.insertTextAfter(l,`, ${r.getText(p)}`))}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[gB]:"Use the original `Blob` instead of converting it to a `File`.",[gR]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!tR(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=gM(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tR(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?gO(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&gO(o.property.name))))return{node:a,messageId:gN}}),e.on("CallExpression",e=>{if(!tR(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tR(gM(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:gN}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[gN]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=ie(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?gq:-1===Math.trunc(ie(e))&&0===r?gU:void 0}(t.arguments);if(!r||nL(t.callee.object,e))return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=to(o,r),p=n.getText(i),c=n.getText(s);if(t===gq){if(gz(e,n))return;if("toSpliced"===l){if(0>Math.trunc(ie(i))||pF(i,o))return;return{messageId:gW,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&g_(o)&&(ie(i)??0)>=0?{messageId:gW,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===gU&&g_(o)&&!gz(i,n))return{messageId:gV,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[gq]:"Prefer a direct element replacement instead of `{{method}}()`.",[gU]:"Avoid using `{{method}}()` to insert at `-1`.",[gW]:"Use direct element replacement.",[gV]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tE(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return rB(n.elements,e).map(e=>({node:e??n,messageId:gK,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[gK]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!g0(r)||g2(r))return;let n=r.object;if(!g3(r,n,t,e))return g9(r,n,e)}),e.on("CallExpression",r=>{let n;if(g1(r)){if(g2(r))return;let n=r.callee.object;if(g3(r,n,t,e))return;return g9(r,n,e)}let o=g6(r,e);if(o)return o;if(gZ(r)&&!(g0(n=r.parent)||g1(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&g1(r.parent.parent))){let e;if(e=tu(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:gJ}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(g4(e,gZ,r))return{node:e,messageId:gY}})(r,e)??((e,t)=>{let r=g4(e,gQ,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tq(r.value))return{node:e,messageId:gH}})(r,t)),e.on("Identifier",t=>g6(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[gG]:"Prefer `.querySelector()` when only the first match is used.",[gJ]:"Prefer `.querySelector()` for a simple ID selector.",[gX]:"Check `.length` instead of the `NodeList` object itself.",[gY]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[gH]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==ys(t.name))return;let r=((e,t)=>{if(t?.value){if(ts(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return yu(e,t.value.expression)}})(e,yl(t,"type"));if(r?.toLowerCase()!=="file")return;let n=yl(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(ts(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=yu(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return yy({valueInfo:o,fix:t=>r=>{let n;return n=o.node,r.replaceTextRange([e.sourceCode.getRange(n)[0]+1,e.sourceCode.getRange(n)[1]-1],t)}})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase())return;let r=yg(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=yg(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:yo.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return yy({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[g7]:"Invalid file input `accept` value: {{reason}}",[ye]:"The file input `accept` value must be static.",[yt]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=yE(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tF(e,{property:"currentTarget"})||!yh.test(e.object.name))return;let n=eS(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=yx(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?yS:yv,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[yv]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[yS]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&yD(o.alternate,a,t)?yw(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&yD(o,a.consequent,t)?yw(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[yC]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?ez(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!yI.has(r)||!(e=>{for(;;){if(aB(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&"TSAsExpression"!==t.type&&"TSTypeAssertion"!==t.type&&"TSNonNullExpression"!==t.type&&"TSSatisfiesExpression"!==t.type)return!1;e=t}})(t)||((e,t,r)=>{let n,o=function e(t,r,n=new i){if(!t||t===yF||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=eS(t.sourceCode.getScope(e),e);if(!r||0===r.defs.length)return;if(1!==r.defs.length||function(e,t,r){let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(r,e,t))return yF;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!nj(n.name.typeAnnotation,t)?yF:void 0;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&"VariableDeclaration"===n.parent.type){let{typeAnnotation:e}=n.node.id;return e?nj(e,t)?void 0:yF:n.node.init??yF}return yF}(t,r);return o===yF?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?yF:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?nj(t,r)?t:yF:t}(e,r);return!!(tb(n=o,"expect",ty)||tR(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===yF||!nj(o,r):o===yF||((e,t)=>{let r,n;return yR(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!yR(e.callee,"Array",t)||(r=e,n=t,tb(r,yB,ty)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&yj.test(o.name)&&!nj(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:yk,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[yk]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tR(r,{methods:yN.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tR(n,{methods:y$,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=yN.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:yP,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:yL,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield iH(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[yP]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[yL]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!yO.has(e.operator)||yz(e.left,t)||yz(e.right,t))){if(ti(e.right,0))return{value:e.left,operator:e.operator};if(ti(e.left,0))return{value:e.right,operator:yq[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&yK(a,n)&&rk(i,n)||(">"===o||">="===o)&&rk(a,n)&&yK(i,n))return n}(t,e);if(!r)return;let n=yH(r)?function*(n){yield iG(n,t,e),yield n.replaceText(t,`Math.abs(${yX(r,e)})`)}:void 0;return yY(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=yG(e.left,t),n=yJ(e.right,t);if(r&&n&&rk(r.value,n.value)&&yU[r.operator]===n.operator&&yK(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=yG(e.right,t),a=yJ(e.left,t);if(o&&a&&rk(o.value,a.value)&&yU[o.operator]===a.operator&&yK(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=yH(n)&&yH(o)?function*(r){yield iG(r,t,e),yield r.replaceText(t,`Math.abs(${yX(n,e)}) ${a} ${to(o,e)}`)}:void 0;return yY(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},fixable:"code",messages:{[yM]:"Prefer `Math.abs()` to simplify this expression."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!r.computed||nG(r))return;let n=y0(r.object);if(!n)return;let o=yZ(r.property,t);if(void 0!==o)return y1(r,n,o+1,e)}),e.on("CallExpression",r=>{if(!tR(r,{method:"at",argumentsLength:1}))return;let n=y0(r.callee.object);if(!n)return;let o=yZ(r.arguments[0],t);if(void 0!==o)return y1(r,n,o+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return y2(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&aB(t))return y2(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[yQ]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":y8,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=hn(e.left,t);if(r&&rk(e.right,r.targetNode)&&!y4(e.right,t)){let n=ht({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return ha({node:e,method:"padStart",replacement:n&&ho({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=hn(e.right,t);if(n&&rk(e.left,n.targetNode)&&!y4(e.left,t)){let r=ht({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return ha({node:e,method:"padEnd",replacement:r&&ho({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=hr(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&tp(a.widthNode)&&rk(a.widthNode,i)&&"Identifier"===r.right.type&&!y4(r.right,t)){let n=he(a.paddingNode);return hi({node:e,method:"padStart",replacement:ho({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=hr(r.right,t);if(2===e.arguments.length&&s&&tp(n)&&0===n.value&&tp(s.widthNode)&&rk(s.widthNode,o)&&"Identifier"===r.left.type&&!y4(r.left,t)){let n=he(s.paddingNode);return hi({node:e,method:"padEnd",replacement:ho({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[y6]:"Prefer `String#{{method}}()` over manual string padding.",[y9]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":hm,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!ts(r)||!hg.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&ry(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;let o=t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n);if(!o)return!1;for(let{identifier:e}of o.references)if(hh(e)||!hx(e))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(tn(r,e),", {passive: true}"))}}if(tl(r,!0)||tl(r,!1))return{fix:e=>e.replaceText(r,tl(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===(e=>{if(!e.computed){if("Identifier"===e.key.type)return e.key.name;if(ts(e.key))return e.key.value}})(e));if(!n)return{fix:((e,t)=>{let r=e.properties.at(-1);if(!r)return!1;let n=t.getLastToken(e);return t.getTokensBetween(r,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)})(r,e.sourceCode)?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=rR(o,e);return","===a.value?t.insertTextAfter(a,`
47
+ ${c}`);let d=r.body.at(-1);"PropertyDefinition"===d.type&&";"!==t.getLastToken(d).value&&(c=`;${c}`),yield s.insertTextBefore(u,c)}return l?.value?u.suggest=[{messageId:fS,fix:p}]:u.fix=p,u})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fv]:"Prefer class field declaration over `this` assignment in constructor for static values.",[fS]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!tv(t,{name:"BigInt",argumentsLength:1,optional:!1},tx))return;let[r]=t.arguments,n=function(e){let t,r;if(tu(e)){let t,r=e.raw.slice(1,-1);try{t=BigInt(r)}catch{return}let n=0n===t?"0":r.trim();return n.startsWith("+")&&(n=n.slice(1).trim()),{shouldUseSuggestion:r.includes("+"),text:`${n}n`,bigint:t}}let n=!1,o=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)n=!0,e=e.argument;else{if("-"!==e.operator)return;o=!o,e=e.argument}let{value:a,raw:i}=e;if(Number.isInteger(a)){try{t=BigInt(a)}catch{return}return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;for(let{prefix:e,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(t.startsWith(e))return t.slice(2)===r.toString(n);return!t.includes("e")&&t===String(r)})(e)?r=`${i}n`:(r=`${t}n`,n=!0),o&&0n!==t&&(r=`-${r}`,t=-t),{shouldUseSuggestion:n,text:r,bigint:t}}}(r);if(!n)return;let o={node:t,messageId:fC},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!ts(t,e)&&s<0n&&(n=`(${n})`,ip(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:fD,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fC]:"Prefer using bigint literal over `BigInt(…)`.",[fD]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!fj(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&fF(o,a))return fk(r,function*(n){let i=ti(o.callee.object.object,e),s=ti(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=fB(p,u,o),d=c?"":fI(p,e,u),m=o.callee.object.optional||a.callee.object.optional||c?.callee.object.optional,f=`${i}${m?"?":""}.classList.toggle(${s}${d?`, ${d}`:""})`;l||(f+=";"),ip(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield sv(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>tu(e)&&("add"===e.value||"remove"===e.value))&&r[0].value!==r[1].value&&"MemberExpression"===t.parent.type&&t.parent.computed&&!t.parent.optional&&t.parent.property===t&&fw(t.parent.object)&&tv(t.parent.parent,{optional:!1,argumentsLength:1},tx)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return fk(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=fB(i,a,o)?"":fI(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield sC(r,n,e,".toggle")},t)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fT]:"Prefer using `Element#classList.toggle()` to toggle class names.",[fA]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:fR,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&tA(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:fR,data:{type:"import expression"},fix:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(ew(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,ew),...t.getTokens(a),...to(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[fR]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of fz)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,{testValue:r,getProblematicNode:n,getProblem:o,getFix:a}){let i,s="AssignmentExpression"===t.type,[l,u]=(s?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===l.type&&r(u)))return;let p=t.parent;if(!(s&&"="===t.operator&&"ExpressionStatement"===p.type&&p.expression===t||!s&&"VariableDeclaration"===(i=t.parent).type&&i.declarations.at(-1)===t))return;let c=iZ(p,e);if(c?.type!=="ExpressionStatement")return;let d="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):eD(e.sourceCode.getScope(t),t.left.name);if(!d)return;let m={context:e,variable:d,variableNode:l,valueNode:u,statement:p,nextExpressionStatement:c,assignType:s?"assignment":"declaration",getFix:a},f=n(m);if(f)return o(f,m)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[fP]:"Immediate mutation on {{objectType}} is not allowed.",[fL]:"{{operation}} the elements to the {{assignType}}.",[fN]:"Move this property to the {{assignType}}.",[f$]:"{{description}} the {{assignType}}.",[fM]:"Move the element to the {{assignType}}.",[fO]:"Move the entry to the {{assignType}}."},languages:["js/js"]}},"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;let n;if(!tS(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[o]=t.arguments,a="LogicalExpression"===o.type&&"??"===o.operator,i=a?o.right:o,s=tT(r=i)?"empty array":tl(r,"")?"empty string":tf(r)?"`null`":tV(r)?"`undefined`":void 0;if(!s)return;let l=!1;if(a)n=function*(t){let{sourceCode:r}=e,n=i.parent,{left:o}=n,a=ts(o,e),[,s]=a?ta(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield sd(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>sf(t,i,e);let u={node:i,messageId:fK,data:{description:s}};return l?u.suggest=[{messageId:fG,fix:n}]:u.fix=n,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fK]:"The {{description}} is useless.",[fG]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tS(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tL(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:fJ,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield sb(t,e,n);let[o]=r.arguments,a=ta(r,e),i=ta(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!ts(t,e)&&ts(t.callee,e)&&ip(e.sourceCode.getTokenBefore(t),e,"(")&&(yield n.insertTextBefore(t,";"))}}})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[fJ]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{let t=e.physicalFilename;if("<input>"===t||"<text>"===t)return;let r=e.options[0]||{},n=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),o=(r.ignore||[]).map(e=>v.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>gp[e].fn);e.on(nj,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=S.relative(r,S.resolve(r,t)))||".."===l||l.startsWith(`..${S.sep}`)||S.isAbsolute(l)?[S.basename(t)]:l.split(S.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=S.extname(e),n=S.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".",1);Object.assign(o,{filename:e,middle:n.slice(e.length)})}return o}(p.at(-1),{multipleFileExtensions:a});if(p.some(e=>o.some(t=>t.test(e))))return;if(i)for(let e of p.slice(0,-1)){let t=function(e,t,r){let n,{leading:o,words:a}=gf(e);if(e.startsWith("$")||gc(a,r))return;let i=gd(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:ge,data:{directory:e,chosenCases:gg(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),go.format(n))}}}(e,n,s);if(t)return t}if(gn.has(c))return;let{leading:g,words:y}=gf(d);if(d.startsWith("$")||gc(y,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:gt,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let h=gd(y,s,{leading:g,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:f7,data:{chosenCases:gg(n),renamedFilenames:(u=h.map(e=>`\`${e}\``),go.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:gy,defaultOptions:[],messages:{[f7]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[ge]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[gt]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tU(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:gh,fix:r=>sI(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[gh]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tS(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tS(t,{names:nL,minimumArguments:1}))||!gR(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?gP(r,e):void 0,o=t.arguments.length>1?gL(r,e,gI):void 0;return{node:r.callee.property,messageId:gD,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tL(e,{objects:["Array",...nL],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!gR(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?gP(r,t):void 0,o=e.arguments.length>1?gL(r,t,gI):void 0;return{node:r.callee.property,messageId:gD,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tL(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!gR(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?gP(r,t):void 0,o=e.arguments.length>1?gL(r,t,gI):void 0;return{node:r.callee.property,messageId:gD,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tL(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!gR(e.arguments[0]))return;let r=e.arguments[0],n=gL(r,t,gI);return{node:r.callee.property,messageId:gD,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tL(e,{methods:gF,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tL(e,{method:gB,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!gR(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===gB;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=gC(r)).type||"FunctionExpression"===r.type)&&(r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=gL(s,t,gj,{method:a});return{node:s.callee.property,messageId:gk,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!gR(t.right))return;let r=gP(t.right,e);return{node:t.right.callee.property,messageId:gT,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!gR(t.argument))return;let r=gP(t.argument,e);return{node:t.argument.callee.property,messageId:gA,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!gR(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=gP(t.argument,e);return{node:t.argument.callee.property,messageId:gw,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gD]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[gT]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[gA]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[gw]:"Spread works on iterables, `.toArray()` is unnecessary.",[gk]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[gI]:"Remove `.toArray()`.",[gj]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||function(e){let{operator:t}=e,{parent:r}=e;for(;rR(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tX(t,r)||tY(t))return!0;let{parent:n}=t;return rR(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rP(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:gq(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>e&&t>a);if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||gq(n=e)||function e(t){let r=rP(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>gq(t)||gO(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rR(t)){let e=rP(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=ta(o,r),[,s]=ta(a,r),l={range:[i,s]};return eR(n.getTokenBefore(l,{includeComments:!0}))||eR(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=ts(e,t),a=o?ti(e,t):t.sourceCode.getText(e);return!o&&iz(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?gN:g$,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[gN]:"Prefer this simple condition first in the `{{operator}}` expression.",[g$]:"Consider moving this simple condition first after verifying short-circuit behavior."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!gV.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:gU,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eR(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||ne(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=r8(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
48
+ ${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[gU]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(gZ(e)){if(gQ(e.object,"childNodes"))return"childNodes";if(gQ(e.object,"children"))return"children"}})(t);if(!n||o2(t.object.object)||"children"===n&&gQ(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tR(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&gQ(t.parent,"children")&&gZ(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:gW,suggest:g1(t,"firstChild",gJ,e)}:"children"===n&&0===o?{node:t,messageId:g_,suggest:g1(t,"firstElementChild",gX,e)}:"children"===n?{node:t,messageId:gz}:void 0}),e.on("MemberExpression",e=>{if(!(!g2(e)||!g2(e.object)||!(!g2(e.parent)||e.parent.object!==e)||o2((e=>{for(;g2(e);)e=e.object;return e})(e))))return{node:e,messageId:gK}}),e.on("CallExpression",t=>{if(!g8(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&g8(t.parent.parent)&&g3(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;g8(e);){let[r]=e.arguments;if(!g3(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||o2(e))return;let r=[];for(let e of t)r.unshift(tc(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:gG,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(g0(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=ti(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.object.type&&["globalThis","window"].includes(n.object.name)&&"Identifier"===n.property.type&&"document"===n.property.name?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${t0(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:gY,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[gW]:"Prefer `.firstChild` over `.childNodes[0]`.",[g_]:"Prefer `.firstElementChild` over `.children[0]`.",[gz]:"Consider `.querySelector()` over positional child traversal.",[gK]:"Consider `.closest()` over chaining `.parentElement`.",[gG]:"Consider merging chained `.querySelector()` calls.",[gJ]:"Switch to `.firstChild`.",[gX]:"Switch to `.firstElementChild`.",[gY]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=0===Object.keys(e.options[0]).length?ya:yo(e.options[0]),r=new s,n=new s,o=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),a=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,n=r.get(t.name);return n?l({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):l(e)}let[t]=e.defs;return void r.set(t.name,e)}return l(e)},l=r=>{var a;if(0===r.defs.length)return;let s=yi(r.name,t);if(!s)return;let[l]=r.defs;if(!(!("ImportDefaultSpecifier"===(a=l.name).parent.type&&a.parent.local===a||"ImportNamespaceSpecifier"===a.parent.type&&a.parent.local===a||"ImportSpecifier"===a.parent.type&&a.parent.local===a&&"Identifier"===a.parent.imported.type&&"default"===a.parent.imported.name||"VariableDeclarator"===a.parent.type&&a.parent.id===a&&tM(a.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||g5(l)))||!(!ir(l.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||g5(l)))||!t.checkShorthandProperties&&ii(l.name))return;let u=[...r.references.map(e=>e.from),r.scope],p=r6(s)?rD(s,u,o):void 0,c=ys(l.name,p??s);if(p&&nB(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!g6.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of u)n.has(e)||n.set(e,new i),n.get(e).add(p);c.suggest=[{messageId:g7,data:{replacement:p},fix:t=>sk(r,p,e,t)}]}e.report(c)},u=e=>{for(let t of e.variables)a(t)},p=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=yi(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||g9.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=ys(r,n);e.report(o)};e.on("Identifier",p),e.on("PrivateIdentifier",p),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of rx(e.sourceCode.getScope(r)))u(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:yl,defaultOptions:[{}],messages:{[g4]:"Prefer `{{replacement}}` over `{{name}}`.",[g7]:"Rename to `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!tS(e,{name:"File",minimumArguments:2,maximumArguments:2})||!yc(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===tc(n))return;let[o]=r.elements;if(function(e,t,r){let n=yd(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tS(o,{name:"Blob",maximumArguments:1})||tS(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&yc(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=eD(r.getScope(n),n);if(!i)return;let s=nB(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tL(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&yc(n.callee.object,t)?{call:n,kind:"blobArgument"}:tL(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=yd(n.callee.object,t)?.init,tS(r,{name:"FormData",argumentsLength:0})&&yc(r.callee,t))?{call:n,kind:"formData"}:void 0}(l,t);if(!u)return;let p=function(e){let[,t]=e.arguments;return t}(o);if(!(!function(e,t,r){if("Identifier"!==e.type)return!0;let{sourceCode:n}=r;return eD(n.getScope(e),e)===eD(n.getScope(t),e)}(a,l,t)||function(e,t){let{sourceCode:r}=t;return r.getCommentsInside(e).length>0||r.getCommentsBefore(e).some(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1)||ne(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:yu,suggest:[{messageId:yp,*fix(n){yield sA(e.parent,t,n),yield n.replaceText(l,r.getText(a)),"formData"===u.kind&&2===u.call.arguments.length&&(yield n.insertTextAfter(l,`, ${r.getText(p)}`))}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[yu]:"Use the original `Blob` instead of converting it to a `File`.",[yp]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!tL(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=yg(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tL(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?yy(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&yy(o.property.name))))return{node:a,messageId:ym}}),e.on("CallExpression",e=>{if(!tL(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tL(yg(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:ym}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[ym]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=iq(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?yh:-1===Math.trunc(iq(e))&&0===r?yx:void 0}(t.arguments);if(!r||op(t.callee.object,e))return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=ti(o,r),p=n.getText(i),c=n.getText(s);if(t===yh){if(yS(e,n))return;if("toSpliced"===l){if(0>Math.trunc(iq(i))||ca(i,o))return;return{messageId:yb,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&yv(o)&&(iq(i)??0)>=0?{messageId:yb,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===yx&&yv(o)&&!yS(i,n))return{messageId:yE,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[yh]:"Prefer a direct element replacement instead of `{{method}}()`.",[yx]:"Avoid using `{{method}}()` to insert at `-1`.",[yb]:"Use direct element replacement.",[yE]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tS(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return r3(n.elements,e).map(e=>({node:e??n,messageId:yC,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[yC]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!yF(r)||yR(r))return;let n=r.object;if(!yP(r,n,t,e))return y$(r,n,e)}),e.on("CallExpression",r=>{let n;if(yB(r)){if(yR(r))return;let n=r.callee.object;if(yP(r,n,t,e))return;return y$(r,n,e)}let o=yN(r,e);if(o)return o;if(yj(r)&&!(yF(n=r.parent)||yB(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&yB(r.parent.parent))){let e;if(e=tc(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:yT}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(yO(e,yj,r))return{node:e,messageId:yw}})(r,e)??((e,t)=>{let r=yO(e,yI,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tV(r.value))return{node:e,messageId:yk}})(r,t)),e.on("Identifier",t=>yN(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[yD]:"Prefer `.querySelector()` when only the first match is used.",[yT]:"Prefer `.querySelector()` for a simple ID selector.",[yA]:"Check `.length` instead of the `NodeList` object itself.",[yw]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[yk]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==yJ(t.name))return;let r=((e,t)=>{if(t?.value){if(tu(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return yY(e,t.value.expression)}})(e,yX(t,"type"));if(r?.toLowerCase()!=="file")return;let n=yX(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(tu(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=yY(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return y3({valueInfo:o,fix:t=>r=>{let n;return n=o.node,r.replaceTextRange([e.sourceCode.getRange(n)[0]+1,e.sourceCode.getRange(n)[1]-1],t)}})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase())return;let r=y2(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=y2(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:yz.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return y3({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[yq]:"Invalid file input `accept` value: {{reason}}",[yU]:"The file input `accept` value must be static.",[yV]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=y5(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tR(e,{property:"currentTarget"})||!y8.test(e.object.name))return;let n=eD(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=y6(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?y7:y4,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[y4]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[y7]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&ht(o.alternate,a,t)?ho(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&ht(o,a.consequent,t)?ho(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[he]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?eG(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!hi.has(r)||!(e=>{for(;;){if(is(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&"TSAsExpression"!==t.type&&"TSTypeAssertion"!==t.type&&"TSNonNullExpression"!==t.type&&"TSSatisfiesExpression"!==t.type)return!1;e=t}})(t)||((e,t,r)=>{let n,o=function e(t,r,n=new i){if(!t||t===hl||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=eD(t.sourceCode.getScope(e),e);if(!r||0===r.defs.length)return;if(1!==r.defs.length||function(e,t,r){let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(r,e,t))return hl;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!oa(n.name.typeAnnotation,t)?hl:void 0;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&"VariableDeclaration"===n.parent.type){let{typeAnnotation:e}=n.node.id;return e?oa(e,t)?void 0:hl:n.node.init??hl}return hl}(t,r);return o===hl?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?hl:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?oa(t,r)?t:hl:t}(e,r);return!!(tv(n=o,"expect",tx)||tL(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===hl||!oa(o,r):o===hl||((e,t)=>{let r,n;return hp(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!hp(e.callee,"Array",t)||(r=e,n=t,tv(r,hu,tx)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&hs.test(o.name)&&!oa(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:ha,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[ha]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tL(r,{methods:hm.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tL(n,{methods:hf,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=hm.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:hc,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:hd,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield sT(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hc]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[hd]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!hy.has(e.operator)||hS(e.left,t)||hS(e.right,t))){if(tl(e.right,0))return{value:e.left,operator:e.operator};if(tl(e.left,0))return{value:e.right,operator:hh[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&hC(a,n)&&rj(i,n)||(">"===o||">="===o)&&rj(a,n)&&hC(i,n))return n}(t,e);if(!r)return;let n=hk(r)?function*(n){yield sv(n,t,e),yield n.replaceText(t,`Math.abs(${hA(r,e)})`)}:void 0;return hw(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=hD(e.left,t),n=hT(e.right,t);if(r&&n&&rj(r.value,n.value)&&hx[r.operator]===n.operator&&hC(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=hD(e.right,t),a=hT(e.left,t);if(o&&a&&rj(o.value,a.value)&&hx[o.operator]===a.operator&&hC(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=hk(n)&&hk(o)?function*(r){yield sv(r,t,e),yield r.replaceText(t,`Math.abs(${hA(n,e)}) ${a} ${ti(o,e)}`)}:void 0;return hw(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},fixable:"code",messages:{[hg]:"Prefer `Math.abs()` to simplify this expression."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",t=>{if(!t.computed||nl(t))return;let r=hF(t.object);if(!r)return;let n=hj(t.property,e);if(void 0!==n)return hB(t,r,n+1,e)}),e.on("CallExpression",t=>{if(!tL(t,{method:"at",argumentsLength:1}))return;let r=hF(t.callee.object);if(!r)return;let n=hj(t.arguments[0],e);if(void 0!==n)return hB(t,r,n+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return hR(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&is(t))return hR(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[hI]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":hL,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=hK(e.left,t);if(r&&rj(e.right,r.targetNode)&&!hU(e.right,t)){let n=h_({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return hJ({node:e,method:"padStart",replacement:n&&hG({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=hK(e.right,t);if(n&&rj(e.left,n.targetNode)&&!hU(e.left,t)){let r=h_({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return hJ({node:e,method:"padEnd",replacement:r&&hG({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tL(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=hz(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&td(a.widthNode)&&rj(a.widthNode,i)&&"Identifier"===r.right.type&&!hU(r.right,t)){let n=hW(a.paddingNode);return hX({node:e,method:"padStart",replacement:hG({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=hz(r.right,t);if(2===e.arguments.length&&s&&td(n)&&0===n.value&&td(s.widthNode)&&rj(s.widthNode,o)&&"Identifier"===r.left.type&&!hU(r.left,t)){let n=hW(s.paddingNode);return hX({node:e,method:"padEnd",replacement:hG({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[hN]:"Prefer `String#{{method}}()` over manual string padding.",[h$]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":h2,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!tu(r)||!h8.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&rx(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;let o=t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n);if(!o)return!1;for(let{identifier:e}of o.references)if(h9(e)||!h5(e))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(ta(r,e),", {passive: true}"))}}if(tp(r,!0)||tp(r,!1))return{fix:e=>e.replaceText(r,tp(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===(e=>{if(!e.computed){if("Identifier"===e.key.type)return e.key.name;if(tu(e.key))return e.key.value}})(e));if(!n)return{fix:((e,t)=>{let r=e.properties.at(-1);if(!r)return!1;let n=t.getLastToken(e);return t.getTokensBetween(r,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)})(r,e.sourceCode)?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=r8(o,e);return","===a.value?t.insertTextAfter(a,`
51
49
  ${i}passive: true,`):t.insertTextAfter(o,`,
52
- ${i}passive: true`)}};if(tl(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:hf,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[hf]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":hK,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=hZ(r),i=hZ(o);if(!a||!i)return;let s=hQ(a.object),l=hQ(i.object);if(h0(s)&&h0(l)&&rk(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:hG,...h1(i,t)&&{suggest:[{messageId:hX,fix:e=>h3(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:hG,...h1(i,t)&&{suggest:[{messageId:hX,fix:e=>h3(i,t,e)}]}}:{node:i,messageId:hJ,...h1(i,t)&&{suggest:[{messageId:hY,fix:e=>h2({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hG]:"Remove unnecessary optional chaining.",[hJ]:"Use optional chaining consistently.",[hX]:"Remove optional chaining.",[hY]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&h4.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&h4.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&h7.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===h8&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:h9,data:{name:a},fix:r=>r.insertTextAfterRange(tn(t,e),", 0")}}if(t===h6&&2===i.length){let t=i[1];if(xe(t))return{node:t,messageId:h5,data:{name:a},fix(r){let[n]=i,[,o]=tn(n,e),[,a]=tn(t,e);return r.removeRange([o,a])}}}})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[h8,h6],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[h8],messages:{[h9]:"`{{name}}` should have an explicit delay argument.",[h5]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",t=>{var r,n;if(!tR(t,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:o}=t.callee,[a]=t.arguments,i=(r=a,n=o,0>Math.trunc(ie(r))?xt:pF(r,n)?xr:void 0);if(!(!i||nL(o,e)))return{node:t.callee.property,messageId:i}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[xt]:"Avoid using a negative index with `Array#with()`.",[xr]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=fJ(t.right);if(tR(r,{methods:xo,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=fJ(t),tR(n,{methods:fz,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=fJ(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=fJ(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tR(o=t,{methods:fV,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tR(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tR(a=t,{methods:f_,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)||!((e,t)=>{for(let r=t.sourceCode.getScope(e);r;r=r.upper)for(let e of fK)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!nj(i,r)&&fG(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:xn,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[xn]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=id(e,t=>aA(t,e,r));e.onExit("Program",e=>xp(t,e.body,r)),e.onExit("BlockStatement",e=>xp(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xa]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new l;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=xm(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression);if(!r)return;let n=function(e){for(e=xm(e);"MemberExpression"===e.type;)e=xm(e.object);return"Identifier"===e.type?e:void 0}(r);if(n&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!xd(e))))return!1;r=r.upper}return!0}(n,t))return n}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:xc,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[xc]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let r,{callee:n}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==n.type||n.optional||n.computed||"Identifier"!==n.object.type||"Object"!==n.object.name||!oA(n.object,t)||"Identifier"!==n.property.type||!xy.has(n.property.name))return;let[o]=e.arguments,a=aY(o,t);if(!a)return;let i=n.property.name,s=`${(r=to(o,t),it(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:xf,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:xg,data:{replacement:s},fix:t=>t.replaceText(e,`Array.from(${s})`)}]),l})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[xf]:"`Object.{{method}}()` does not return {{type}} contents.",[xg]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!xE.has(r.operator))return;if(ti(r.right,0)&&xS(r.left))n=r.left,o=r.operator;else{if(!(ti(r.left,0)&&xS(r.right)))return;n=r.right,o=xb[r.operator]}let a={node:r,messageId:xh};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${to(i,e)} ${o} ${to(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(xv.has(o)?n2(i,p)&&n2(s,p):xC(i,p)&&xC(s,p))?a.fix=u:a.suggest=[{messageId:xx,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[xh]:"Prefer comparing the values directly over comparing the difference with `0`.",[xx]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o,a;let i,s,l=xA(t.object),u=xw(t);if("Identifier"!==l.type||"globalThis"!==l.name||!oA(l,e)||nG(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||r3(n=t)||("MemberExpression"===(n=xw(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=xw(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!xj.has(t.operator))return!1;let r=xA(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tJ(o)||tG(o,e))return;let p=t.computed?ts(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof p||!(r$(p)&&(!xk.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&xI(t)||(s=eS(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:xD,data:{name:p}};return xI(t)||"TaggedTemplateExpression"===(a=xw(a=t)).parent.type&&a.parent.tag===a||0!==e.sourceCode.getCommentsInside(t).length||(c.fix=e=>e.replaceText(t,p)),c})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xD]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",t=>{if("ObjectPattern"===t.parent.type&&t.computed&&!(null===eV(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:xF}}),e.on("ArrayPattern",e=>{if(0!==xN(e))return{node:e,messageId:xB}}),e.on("ObjectPattern",e=>{if(3===xN(e))return{node:e,messageId:xR}}),e.on("MemberExpression",e=>{if(xL(e)?.type==="ObjectPattern")return{node:e,messageId:xP}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[xF]:"Do not use computed keys in object destructuring.",[xB]:"Do not use array destructuring inside object destructuring.",[xR]:"Do not use object destructuring deeper than two levels.",[xP]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=id(e,t=>aA(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&xM.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:x$,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rK(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>("JSXText"!==e.type||"JSXText"!==r.getNodeByRangeIndex(r.getRange(e)[0]).type)&&r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n);if(!a)return!0;let i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(aL(i,t,a.value)||xU(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(aL(s,t,l.value)||xU(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!rV(e,[i[0],r.getRange(o)[0]]))return t.replaceTextRange(i,((e,t)=>{let{alternate:r}=e;if("BlockStatement"===r.type)return((e,t,r)=>{let n=r.getFirstToken(e),o=r.getLastToken(e),a=r.text.slice(r.getRange(n)[1],r.getRange(o)[0]);if(!a.includes("\n")){let e=a.trim();return e?`
53
- ${xq(r,r.getRange(t)[0])}${e}`:""}let i=a.split("\n");if(i[0]?.trim()===""&&i.shift(),i.at(-1)?.trim()===""&&i.pop(),0===i.length)return"";let s=r.getTokenAfter(n,{includeComments:!0}),l=xq(r,r.getRange(t)[0]),u=s&&s!==o?xq(r,r.getRange(s)[0]):l;return`
54
- ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=xq(t,t.getRange(e)[0]);return`
55
- ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[x$]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tw(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(xz(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>x_(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=eS(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:xW}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[xW]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!tR(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tl(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:xK,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[xK]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return x2.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tE(t,{names:x0,argumentsLength:1})||tE(t,{names:r9,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tR(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||x8(t,["from"])||tR(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tR(t,{object:"Promise",methods:x1,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=xZ.get(r);if(!t?.includes(e))return!1}return!0})(r,x7(t.callee.object,e)))return{node:t.callee.property,messageId:xG,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>iH(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[xG]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:br};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:bn,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(tR(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:be,suggest:[{messageId:bt,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tR(e,{objects:bo,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&bi(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(ti(e.right,0))return bs(e.left);if(ti(e.left,0))return bs(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=bl(e.left,t);if(r&&rk(r,e.right))return r;let n=bl(e.right,t);if(n&&rk(n,e.left))return n})(e,t);if(n&&bi(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[be]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[bt]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[br]:"Prefer `Number.isSafeInteger()` over this integer check.",[bn]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=bp(r);if(!n)return;let o=bp(im(r,e,-1));if(o&&rk(o.arguments[0],n.arguments[0]))return;let a=[r],s=[n],l=ig(r,e);for(;;){let t=bp(l);if(!t||!rk(n.arguments[0],t.arguments[0]))break;a.push(l),s.push(t),l=ig(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:bu},p=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new i,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=eV(e,t.getScope(e));if(r)return"symbol"==typeof r.value?r.value:String(r.value)}(e,t);if(void 0===a){if(n.some(t=>rk(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(s,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=p[0]&&n<=p[1]})||(u.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=rR(o,r),s=`${i} `,l=n.getText(t[0].arguments[0]),u=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:r$(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=n.getText(e.arguments[2]).replaceAll("\n","\n ");return`${s}${t}: ${r},`}).join("\n");return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${l}, {
50
+ ${i}passive: true`)}};if(tp(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:h3,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[h3]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":xT,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=xB(r),i=xB(o);if(!a||!i)return;let s=xF(a.object),l=xF(i.object);if(xR(s)&&xR(l)&&rj(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:xA,...xP(i,t)&&{suggest:[{messageId:xk,fix:e=>xN(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:xA,...xP(i,t)&&{suggest:[{messageId:xk,fix:e=>xN(i,t,e)}]}}:{node:i,messageId:xw,...xP(i,t)&&{suggest:[{messageId:xI,fix:e=>xL({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[xA]:"Remove unnecessary optional chaining.",[xw]:"Use optional chaining consistently.",[xk]:"Remove optional chaining.",[xI]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&xU.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&xU.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&xV.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===x$&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:xO,data:{name:a},fix:r=>r.insertTextAfterRange(ta(t,e),", 0")}}if(t===xM&&2===i.length){let t=i[1];if(xW(t))return{node:t,messageId:xq,data:{name:a},fix(r){let[n]=i,[,o]=ta(n,e),[,a]=ta(t,e);return r.removeRange([o,a])}}}})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[x$,xM],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[x$],messages:{[xO]:"`{{name}}` should have an explicit delay argument.",[xq]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",t=>{var r,n;if(!tL(t,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:o}=t.callee,[a]=t.arguments,i=(r=a,n=o,0>Math.trunc(iq(r))?x_:ca(r,n)?xz:void 0);if(!(!i||op(o,e)))return{node:t.callee.property,messageId:i}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[x_]:"Avoid using a negative index with `Array#with()`.",[xz]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=gC(t.right);if(tL(r,{methods:xG,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=gC(t),tL(n,{methods:gE,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=gC(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=gC(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tL(o=t,{methods:gx,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tL(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tL(a=t,{methods:gb,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)||!((e,t)=>{for(let r=t.sourceCode.getScope(e);r;r=r.upper)for(let e of gv)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!oa(i,r)&&gS(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:xK,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[xK]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=iH(e,t=>ie(t,e,r));e.onExit("Program",e=>xZ(t,e.body,r)),e.onExit("BlockStatement",e=>xZ(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xJ]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new l;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=x2(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression);if(!r)return;let n=function(e){for(e=x2(e);"MemberExpression"===e.type;)e=x2(e.object);return"Identifier"===e.type?e:void 0}(r);if(n&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!x1(e))))return!1;r=r.upper}return!0}(n,t))return n}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:x0,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[x0]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let r,{callee:n}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==n.type||n.optional||n.computed||"Identifier"!==n.object.type||"Object"!==n.object.name||!rF(n.object,t)||"Identifier"!==n.property.type||!x6.has(n.property.name))return;let[o]=e.arguments,a=iA(o,t);if(!a)return;let i=n.property.name,s=`${(r=ti(o,t),iU(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:x3,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:x8,data:{replacement:s},fix:t=>t.replaceText(e,`Array.from(${s})`)}]),l})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[x3]:"`Object.{{method}}()` does not return {{type}} contents.",[x8]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!x7.has(r.operator))return;if(tl(r.right,0)&&bt(r.left))n=r.left,o=r.operator;else{if(!(tl(r.left,0)&&bt(r.right)))return;n=r.right,o=x4[r.operator]}let a={node:r,messageId:x9};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${ti(i,e)} ${o} ${ti(s,e)}`,u=e=>e.replaceText(r,l);return(be.has(o)?oN(i,e)&&oN(s,e):br(i,e)&&br(s,e))?a.fix=u:a.suggest=[{messageId:x5,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[x9]:"Prefer comparing the values directly over comparing the difference with `0`.",[x5]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o,a;let i,s,l=ba(t.object),u=bi(t);if("Identifier"!==l.type||"globalThis"!==l.name||!rF(l,e)||nl(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||nu(n=t)||("MemberExpression"===(n=bi(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=bi(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!bu.has(t.operator))return!1;let r=ba(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tY(o)||tX(o,e))return;let p=t.computed?tu(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof p||!(r6(p)&&(!bs.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&bl(t)||(s=eD(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:bn,data:{name:p}};return bl(t)||"TaggedTemplateExpression"===(a=bi(a=t)).parent.type&&a.parent.tag===a||0!==e.sourceCode.getCommentsInside(t).length||(c.fix=e=>e.replaceText(t,p)),c})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[bn]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",t=>{if("ObjectPattern"===t.parent.type&&t.computed&&!(!function(e,t){let r;return!(rK(e,t)||"MemberExpression"===e.type&&!rF(e.object,t)&&rX(e,t))&&(void 0!==rH(e,t)||!!("MemberExpression"===(r="TaggedTemplateExpression"===e.type?e.tag:e).type&&!r.computed&&"Identifier"===r.object.type&&rF(r.object,t)&&"Identifier"===r.property.type&&bf.get(r.object.name)?.has(r.property.name))&&null!==ez(e,t.sourceCode.getScope(e)))}(t.key,e)&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:bp}}),e.on("ArrayPattern",e=>{if(0!==by(e))return{node:e,messageId:bc}}),e.on("ObjectPattern",e=>{if(3===by(e))return{node:e,messageId:bd}}),e.on("MemberExpression",e=>{if(bg(e)?.type==="ObjectPattern")return{node:e,messageId:bm}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[bp]:"Do not use computed keys in object destructuring.",[bc]:"Do not use array destructuring inside object destructuring.",[bd]:"Do not use object destructuring deeper than two levels.",[bm]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=iH(e,t=>ie(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&bx.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:bh,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(no(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>("JSXText"!==e.type||"JSXText"!==r.getNodeByRangeIndex(r.getRange(e)[0]).type)&&r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n);if(!a)return!0;let i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(ip(i,t,a.value)||bv(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(ip(s,t,l.value)||bv(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!nt(e,[i[0],r.getRange(o)[0]]))return t.replaceTextRange(i,((e,t)=>{let{alternate:r}=e;if("BlockStatement"===r.type)return((e,t,r)=>{let n=r.getFirstToken(e),o=r.getLastToken(e),a=r.text.slice(r.getRange(n)[1],r.getRange(o)[0]);if(!a.includes("\n")){let e=a.trim();return e?`
51
+ ${bE(r,r.getRange(t)[0])}${e}`:""}let i=a.split("\n");if(i[0]?.trim()===""&&i.shift(),i.at(-1)?.trim()===""&&i.pop(),0===i.length)return"";let s=r.getTokenAfter(n,{includeComments:!0}),l=bE(r,r.getRange(t)[0]),u=s&&s!==o?bE(r,r.getRange(s)[0]):l;return`
52
+ ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=bE(t,t.getRange(e)[0]);return`
53
+ ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[bh]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tI(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(bT(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>bD(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=eD(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:bS}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[bS]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!tL(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tp(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:bA,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[bA]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return bN.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tS(t,{names:bP,argumentsLength:1})||tS(t,{names:nL,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tL(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||bM(t,["from"])||tL(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tL(t,{object:"Promise",methods:bL,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=bR.get(r);if(!t?.includes(e))return!1}return!0})(r,bW(t.callee.object,e)))return{node:t.callee.property,messageId:bw,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>sT(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[bw]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:bK};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:bG,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(tL(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:b_,suggest:[{messageId:bz,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tL(e,{objects:bJ,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&bY(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(tl(e.right,0))return bH(e.left);if(tl(e.left,0))return bH(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=bQ(e.left,t);if(r&&rj(r,e.right))return r;let n=bQ(e.right,t);if(n&&rj(n,e.left))return n})(e,t);if(n&&bY(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[b_]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[bz]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[bK]:"Prefer `Number.isSafeInteger()` over this integer check.",[bG]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=b0(r);if(!n)return;let o=b0(iQ(r,e,-1));if(o&&rj(o.arguments[0],n.arguments[0]))return;let a=[r],s=[n],l=iZ(r,e);for(;;){let t=b0(l);if(!t||!rj(n.arguments[0],t.arguments[0]))break;a.push(l),s.push(t),l=iZ(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:bZ},p=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new i,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=rH(e,{sourceCode:t});if(!(!r||rX(e,{sourceCode:t})))return"symbol"==typeof r.value?r.value:String(r.value)}(e,t);if(void 0===a){if(n.some(t=>rj(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(s,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=p[0]&&n<=p[1]})||(u.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=r8(o,r),s=`${i} `,l=n.getText(t[0].arguments[0]),u=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:r6(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=n.getText(e.arguments[2]).replaceAll("\n","\n ");return`${s}${t}: ${r},`}).join("\n");return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${l}, {
56
54
  ${u}
57
- ${i}});`)}(a,s,e)),u})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[bu]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:r,init:n}=t;if("ObjectPattern"!==r.type||n?.type!=="ObjectExpression"||0!==e.sourceCode.getCommentsInside(t).length)return;let a=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(bg(n)&&"Identifier"===n.value.type))return;let e=ez(n,t.sourceCode.getScope(n));if(null===e||bm.has(e))return;r.push({node:n,name:e})}return r})(r,e),s=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||eH(n.argument,t.sourceCode,bf))return;let a=new o;for(let e of r.slice(0,-1)){if(!bg(e)||eH(e.value,t.sourceCode,bf))return;let r=ez(e,t.sourceCode.getScope(e));if(null===r||a.has(r))return;a.set(r,e)}return{defaultProperties:a,spreadElement:n}})(n,e);if(!a||0===a.length||!s)return;let{defaultProperties:l,spreadElement:u}=s;if(a.length!==l.size)return;let p=new i(a.map(e=>e.node.value.name)),c=[];for(let t of a){let r=l.get(t.name);if(!r||by(r.value,p,e))return;c.push(bh(t,r,e))}return{node:t,messageId:bc,suggest:[{messageId:bd,fix:r=>r.replaceText(t,`{${c.join(", ")}} = {${e.sourceCode.getText(u)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[bc]:"Prefer object destructuring defaults over default object literals with spread.",[bd]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>bv(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>bv(t,e.body)),e.on("SwitchCase",e=>bv(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[bx]:"Prefer a single object destructuring declaration from `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&"let"===e.kind&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type&&!e.declarations[0].init))return;let[r]=e.declarations,[n]=t.getDeclaredVariables(r),o=n.references.filter(e=>!e.init),a=o.filter(e=>e.isWrite());if(1!==a.length||o.every(e=>!e.isRead()))return;let i=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(a[0]);if(!i)return;let{assignmentExpression:s,assignmentStatement:l,block:u}=i,[,p]=t.getRange(e),[c,d]=t.getRange(l);if(!bD(u,e.parent)||function e(t,r){if("WithStatement"===t.type||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"eval"===t.callee.name)return!0;for(let n of r[t.type]??[]){let o=t[n];if(Array.isArray(o)){if(o.some(t=>t&&e(t,r)))return!0}else if(o&&e(o,r))return!0}return!1}(e.parent,t.visitorKeys)||c<p||o.some(e=>!bD(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:bS,data:{name:r.id.name}};return r.id.typeAnnotation||bA(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||bT(t,e,"before")||bT(t,e,"after")||bT(t,l,"before")||bT(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield iQ(t,{sourceCode:e},a);let i=`const ${o} = `;if(bA(e,r))return void(yield a.replaceText(n,`${i}${e.getText(r.right)};`));let[s]=e.getRange(r),[l]=e.getRange(r.right);yield a.replaceTextRange([s,l],i)}}({sourceCode:t,declaration:e,assignmentExpression:s,assignmentStatement:l,name:r.id.name})),m})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[bS]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=bI.get(t.operator);if(!r||e.sourceCode.getCommentsInside(t).length>0)return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!tR(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let n=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(!n)return;let{object:o}=e.callee;if(!nB(o,r)){var a;let t;return{node:e,object:o,callback:{...n,parameterText:(a=n.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!rk(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:bw,data:{method:r},suggest:[{messageId:bk,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(ta(e,r))return to(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):bj.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]}})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bw]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[bk]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tR(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===bX(t.callee.object,e)){let r={node:t.callee.property,messageId:bF};return bH(t,e)&&!ta(t.callee,e)&&bY(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tb(t,{name:"String",argumentsLength:1,optional:!1},ty)&&oA(t.callee,e)))return;let[r]=t.arguments;if("url"!==bX(r,e))return;let n={node:t.callee,messageId:bF};return bH(t,e)&&bY(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=to(r,e),a=!ta(r,e)&&it(r,e)?`(${o})`:o,i=`${a}.href`,(aL(e.sourceCode.getTokenBefore(r.parent),e,i)?";":"")+i))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[bF]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new s,n=[];function*o(e){let n;if(!(tE(n=e,{name:"Proxy",argumentsLength:2})||tR(n,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1})))return;let o=e.arguments[1];if("ObjectExpression"===o.type)for(let e of o.properties){let n=b5(e,t);if(!n)continue;let o=b4(n,t,r);o&&(yield o)}}e.on("onCodePathStart",()=>{n.push(new i)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.onExit("BlockStatement",t=>{if(!(b0.has(t.parent?.type)&&t.parent.body===t))return;let o=[...n.at(-1)].every(e=>!e.reachable),a=aA(t,e,b1)||af(t,e);r.set(t.parent,o||a)}),e.onExit("CallExpression",o),e.onExit("NewExpression",o)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[bQ]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":Eo,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:Ea,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield iW(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=Ei.get(n);if(!o||!oA(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",e=>{if("+"===e.operator&&n2(e.argument,t.getScope(e.argument)))return r(e,e.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(ti(a,"")&&og(o,e))n=o;else{if(!(ti(o,"")&&og(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&og(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[Ea]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tR(r,{methods:El,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tw(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tK(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&oT(n.params[0],a))&&!(function e(t){return(t=rN(t),t?.type==="ChainExpression")?r3(t):t?.type==="LogicalExpression"?"&&"===t.operator&&e(t.left)||e(t.right):t?.type==="ConditionalExpression"?e(t.consequent)||e(t.alternate):t?.type==="SequenceExpression"&&e(t.expressions.at(-1))}(a)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.getTypeAtLocation(e);return(t.isUnion()?t.types:[t]).some(e=>"void"===e.intrinsicName||r4.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:Es,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[Es]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tI(e)&&e.body===t}})(t))return{node:t,messageId:Eu,fix:r=>iQ(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[Eu]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=ez(e,l);if("string"==typeof u&&ez(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&ez(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=Ed(i,e))||!0!==oC(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=Ed(i,e))&&Ec(t.type)))return}return{node:r.key,messageId:Ep,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield i2(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[Ep]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tR(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;EA.has(e.parent?.type)&&e.parent.expression===e;)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(t.sourceCode.getCommentsInside(e).length>0)return;let a=((e,t,r)=>{let n=EU(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&ER(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(ER(t.value,r)&&EJ(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(td(t.value)&&o&&EJ(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!ER(n,t):!td(n)))return;return{node:e.callee.property,messageId:Em,fix:((e,t,r)=>{var n;let o;if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let a=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${(o=to(n=e.callee.object,r),!ta(n,r)&&it(n,r)?`(${o})`:o)}.has(${((e,t)=>{let[r]=e.arguments;return t.sourceCode.getText(r)})(e,r)})`;return e=>e.replaceText(t.node,a)})(e,r,t)}}if((tG(e,t)||tJ(e))&&EU(e.callee.object,t)?.kind==="map"&&EJ(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:Em,fix:t=>t.replaceText(e.callee.property,"has")}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[Em]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===EY?e.on("LogicalExpression",t=>{if(E1(t)){if("&&"!==t.operator||E0(t.right)||E2(t.left,t.right,e.sourceCode))return;let r=E9(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&E2(r.reference,t.right,e.sourceCode))return;let n=E4(t.left,e),o=E4(t.right,e);return{node:t,messageId:EH,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):e.on("ConditionalExpression",t=>{if(E1(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=E0(o);if(a===E0(n))return;let i=a?n:o,s=E9(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?E2(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&E2(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&E2(s.reference,i,t.sourceCode))return;let u=a?E5(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return E5(e.argument,"left",t);let r=to(e,t);return!ta(e,t)&&ia(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=E5(i,"right",t);return{node:e,messageId:EH,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)})},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[EX,EY]}],defaultOptions:[EX],messages:{[EH]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":vD,"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=vT(e.right);if(!n||!tR(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=vT(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=vA(n,t);if(!a||!i||i!==vA(a,t)||!function(e){let[t]=e?.defs??[];if(!t||1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&vT(t.node.init);return!!(r&&tC(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tw(r))return;if(tI(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:vw}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[vw]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!tR(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tM(t.callee,vI)||nL(r,e)))return{node:n,messageId:vk,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[vk]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!vB(t.property)||nG(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=vR(t.object,e);if(r)return vP(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tR(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(vB(n)?r="first":tP(n)&&(r="last"),!r||nG(t))return;let o=vR(t.callee.object,e);if(o)return vP(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vj]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[vF]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(tb(r,{minimumArguments:1},ty)&&"MemberExpression"===r.callee.type&&v$.has(ez(r.callee,n.sourceCode.getScope(r.callee)))))return;let[o]=t.arguments;if("SpreadElement"===o.type)return;let a=((e,t)=>{let r=rN(e);if(tw(r)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(r);if(!oo(r,t)&&!vq(e,t))return;return{node:e,messageId:vL,suggest:e===r?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=rN(n=t)).type&&vM.has(n.operator)?n:void 0;if(!i||rL(i.left)||rL(i.right)||!vO(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:vN,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(r,n,t):void 0}}if(oa(r,t)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||n6.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=n9.get(e.object.name),n=ez(e,t.sourceCode.getScope(e));return!!r?.has(n)}(r,t)||vq(e,t))return{node:e,messageId:vL}})(o,e);if(!(!a||nB(t.callee.object,e)))return a})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vL]:"Do not return a boolean from a sort comparator.",[vN]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!vz.has(r.operator))return;let n=vK(r.left)?r.left:r.right;if(!vK(n))return;let o=n===r.left,a=o?r.right:r.left;if(v_.has(r.operator)&&os(a,e))return;let i={node:r,messageId:vU},s=vV.has(n.operator)===vV.has(r.operator)&&!tl(r.right);if(o&&s&&!vK(r.right)&&!vK(n.left)&&((e,t)=>{if(ta(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eH(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${to(n.right,e)} ${r.operator} ${to(r.right,e)}`;i.suggest=[{messageId:vW,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vU]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[vW]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",e=>{if(!(e=>{switch(e.operator){case"*":case"&":return ti(e.left,0)||ti(e.right,0);case"/":return ti(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:vG},n=eV(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:vJ,fix:t=>t.replaceText(e,"0")}]),r})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vG]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[vJ]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!vZ(o)||!vZ(t.right)||!pI(o,t.right))return;let a={node:t.right,messageId:vX};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=tn(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=to(t.left,e),s=e=>e.replaceText(t,i);return vQ.has(o.type)&&(n=t.right,vQ.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:vY,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[vX]:"This operand duplicates the left operand.",[vY]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o,a;if(!Object.hasOwn(v1,t.operator))return;let i=(r=rN(t.left),n=rN(t.right),rH(r)?{memberExpression:r,operator:t.operator,value:eV(n,e.sourceCode.getScope(n))?.value}:rH(n)?{memberExpression:n,operator:v1[t.operator],value:eV(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rN(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rN(t)).type||r3(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=eV(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tW(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tF(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&rY.has(r.property.name)&&rk(r.object,t.object))}({node:t,lengthOrSizeNode:s}))return;let l=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(i);if(void 0!==l)return{node:t,messageId:v0,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[v0]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(v3.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=tu(n);if(void 0!==o&&o.length>1&&v8(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:v2,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[v2]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new l,r=id(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=Si(n.right,e);if(o)return function* e(t,r,n,o){if(St.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=Si(t.right,o);e&&Sp(e.reference,r.iterable,o)&&(a=Sl(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=ez(e.callee,n.sourceCode.getScope(e.callee));if(!(!v7[t.collectionKind??"unknown"].has(c)||!Sp(u,i,n)||"delete"===c&&Sc(e,a,n)||Sd(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=rN(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===ez(o.callee,n.sourceCode.getScope(o.callee))&&Sp(o.callee.object,r.iterable,n)&&Sc(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type&&(!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&Sd(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:v6,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of o.sourceCode.visitorKeys[t.type]??[]){let i=t[n];if(Array.isArray(i)){for(let t of i)t&&(yield*e(t,r,a,o));continue}i&&(yield*e(i,r,a,o))}}(n.body,{branchAlwaysExits:r,...Sl(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[v6]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(tR(e,{methods:Sf})&&tF(e.callee.object,{property:"classList",computed:!1})&&!oh(rN(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?SE(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:SE(e.arguments.slice(0,2),"."):SE(e.arguments.slice(0,1),".")}if(tR(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!oh(rN(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return SE(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rN(r),o=Sx(e);Sh(o)&&(yield Sb(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[Sm]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!SD.has(r.operator)||!tp(r.right)||r.right.value!==SD.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:Sv,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:Sv,data:n,suggest:[{messageId:SS,fix:t=>iQ(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:Sv,data:n,suggest:[{messageId:SC,data:{left:a},fix:e=>e.replaceText(r,a)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Sv]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[SS]:"Remove the useless assignment.",[SC]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&rk(o.right,a.object)&&SN(o.right,r)&&S$(o.left,r)&&S$(o.right,r)&&(!a.computed||S$(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rk(e,t))return!((e,t)=>{var r;let n;if(SN(e,t)||SP(rN(e),t))return!0;let o=rJ(rN(e),t);if(!o)return!1;let a=rN(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===SL(r,t)})(e,r);let n=SL(e,r),o=SL(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=ez(a,r.sourceCode.getScope(a));n=null!==e&&e===SL(o.left,r)}return n?{suggest:[{messageId:SA,fix:SO(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(SM(n,"has")&&SM(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rN(e)).type)return!1;let n=rJ(e,t);if(!n)return!1;let o=rN(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&Sk.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&rk(n.callee.object,t.callee.object)&&rk(n.arguments[0],t.arguments[0])&&S$(n.arguments[0],r))return{fix:SO(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:ST,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[ST]:"The existence check before deletion is unnecessary.",[SA]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!SU.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=SW.get(o),tl(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=SU.get(o),a.filter((e,r)=>tl(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tG(n=e[t].parent,r)||tJ(n)||o.every(e=>os(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&ts(rN(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tw(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:Sq,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>iW(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=ta(t,e),a=to(t,e),!o&&ii(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&SV.has(rN(t).type)&&(a=`(${a})`),a}).join(` ${n} `),aL(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sq]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=SG(o),u=SG(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:S_},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||rW(e,a),m=!c&&!SJ(n.test,e)&&!!(s=eS(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=to(t,e);if(r)return ia(t,"!")?`!(${n})`:`!${n}`;if(SJ(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){var o,a;let i,s=ig(n,e);if(!s||"ReturnStatement"!==s.type)return;let l=SK(n.consequent),u=SG(l);if(void 0!==u&&(o=n,a=u,i=im(o,e,-1),i?.type==="IfStatement"&&!i.alternate&&SG(SK(i.consequent))===a))return;let p=r(n,l,s,[t.getRange(n)[0],t.getRange(s)[1]]);return p?.fix&&t.getTokensBetween(n,s,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:S_}:p}return r(n,SK(n.consequent),SK(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[S_]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{let r=(e=>{for(let t of SY)if(SH(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>SH(e,r))||((e,t)=>{let{parent:r}=e;return SH(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:SX,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=SQ(e,r).map(e=>t.getText(e)).join(", ");yield n.replaceText(e,`${a}(${i})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[SX]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>S6(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>S6(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield S5({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield S5({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[SZ]:"These branches start with the same code. Move it before the `if` statement.",[S0]:"These branches end with the same code. Move it after the `if` statement.",[S1]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===Cr(r))return;let n=r.arguments[1];if(!ts(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==Cr(e)&&ts(e.arguments[1])&&e.arguments[1].value===o,{parent:s}=r;if("MemberExpression"===s.type&&s.object===r&&"CallExpression"===s.parent.type&&s.parent.callee===s&&a(s.parent))return;let l=[],u=r;for(;a(u);)l.push(Cr(u)),u=u.callee.object;if(l.length<2)return;let p=u;l.reverse();let c=[...new i(l)];if(c.some(e=>o.includes(e)))return;let d={node:r,messageId:S7};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(Ct.has(e))return Ct.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===c.length-1)).join(""),o=to(p,e),a=to(n,e);d.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return d})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[S7]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}},"unicorn/consistent-tuple-labels":{create:e=>{e.on("TSTupleType",e=>{let t=e.elementTypes;if(t.length<2)return;let r=t.filter(e=>"TSNamedTupleMember"!==e.type&&("TSRestType"!==e.type||"TSNamedTupleMember"!==e.typeAnnotation.type));if(0!==r.length&&r.length!==t.length)return r.map(e=>({node:e,messageId:Cn}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[Cn]:"This tuple element should have a label, just like the other elements."},languages:["js/js"]}},"unicorn/no-invalid-well-known-symbol-methods":{create:e=>{e.on("MethodDefinition",t=>Cd(t,e)),e.on("Property",t=>Cd(t,e)),e.on("PropertyDefinition",t=>Cd(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[Co]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[Ca]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[Ci]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[Cs]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[Cl]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=yE(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tR(e,{methods:Cy,computed:!1}))return;let{callee:t}=e,r=rN(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=eS(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!nO(o=u.name,e)&&(yh.test(o.name)||nM(o,e))))return;let c=yx(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=Cm;return c?m=Cg:d&&(m=Cf),{node:n,messageId:m,data:{name:i.name,method:s}}})},meta:{type:"problem",docs:{description:"Disallow event-control method calls after the synchronous event dispatch has finished.",recommended:!0},schema:[],messages:{[Cm]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[Cf]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[Cg]:"`{{name}}.{{method}}()` may run after synchronous event dispatch has finished. Call it in the outer handler before deferring work."},languages:["js/js"]}},"unicorn/prefer-abort-signal-timeout":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,i=e.parent,{id:s,init:l}=e;if("VariableDeclaration"!==i.type||"const"!==i.kind||1!==i.declarations.length||"Identifier"!==s.type||!(tE(l,{name:"AbortController",argumentsLength:0})&&oA(l.callee,t))||(n=eS(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||rV(t,a.getRange(l))||s.typeAnnotation&&rV(t,a.getRange(s.typeAnnotation)))return;let u=(e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]})(i),p=((e,t)=>{if(e?.type==="ExpressionStatement"&&tb(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},ty)&&oA(e.expression.callee,t))return e.expression})(u,t);if(!p||((e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})})(t,i,u)||rV(t,a.getRange(u))||rW(t,u))return;let c=((e,t)=>{let[r]=e.arguments,n=!r||"ArrowFunctionExpression"!==r.type&&"FunctionExpression"!==r.type||r.async||r.generator||r.params.length>0?void 0:"BlockStatement"!==r.body.type?r.body:1===r.body.body.length&&"ExpressionStatement"===r.body.body[0].type?r.body.body[0].expression:void 0;if(tb(n,{argumentsLength:0,optional:!1},ty)&&tF(n.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===n.callee.object.type&&n.callee.object.name===t)return n.callee.object})(p,s.name);if(!c)return;let d=eS(a.getScope(s),s);if(!d||eS(a.getScope(c),c)!==d)return;let m=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(e===t||o.init)continue;if(o.isWrite())return;let a=CE(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(d,c,t);if(!m)return;let f=a.getRange(u),[,g]=p.arguments;if("SequenceExpression"===g.type||!((e,t)=>{let r=eV(e,t.sourceCode.getScope(e));if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(g,t)||m.some(e=>{let r;return(r=t.sourceCode.getRange(e))[0]>=f[0]&&r[1]<=f[1]}))return;let y=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Cv(o,d,d.identifiers[0],t)||m.some(e=>Cv(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:Ch,suggest:[{messageId:Cx,*fix(e){if(yield e.replaceText(l,h),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),y!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],y)}for(let t of m)yield e.replaceText(t,y);yield iQ(u,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[Ch]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[Cx]:"Replace with `AbortSignal.timeout()`."},languages:["js/js"]}},"unicorn/prefer-aggregate-error":{create:e=>{e.on("IfStatement",t=>{var r;let n,o="ThrowStatement"===(r=t.consequent).type?r:"BlockStatement"===r.type&&1===r.body.length&&"ThrowStatement"===r.body[0].type?r.body[0]:void 0;if(!o)return;let a=function(e,t){let r=e.argument;if(tE(r,{name:"Error",maximumArguments:2})&&oA(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=CF(e.test).map(e=>(function(e,t){let r=CI(e=CT(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=CI(e.left,t);if(n&&Cj(e.operator,e.right,!0))return n;let o=CI(e.right,t);if(o&&Cj(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=aM("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:CS,fix:e.sourceCode.getCommentsInside(a).length>0?void 0:e=>{let t=[s.getText(i),...a.arguments.map(e=>s.getText(e))].join(", ");return e.replaceText(a,`new AggregateError(${t})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer `AggregateError` when throwing collected errors.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[CS]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tR(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!Cz(r.callee.object,n):!(tb(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},ty)&&oA(r.callee,n)))return;let[a,i]=t.arguments,s=tu(o=rN(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!CR.has(s))return;let l=((e,t)=>{if(tw(e=rN(e)))return e;if("Identifier"!==e.type)return;let r=eS(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("FunctionName"===n.type)return n.node;let o=n.node.init&&rN(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tw(o))return o})(i,e);if(l&&CZ(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:CB,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!C6(e,t)||t.sourceCode.getCommentsInside(e).length>0)return;let[r]=e.arguments;if("ArrayExpression"===r.type&&r.elements.length>=2&&r.elements.every(e=>{let r;return De(e,t)&&(r=e.argument,tE(r,{name:"Set",argumentsLength:0})&&oA(r.callee,t)||!eH(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:C0,fix:n=>n.replaceText(e,C5(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=C9(r,t);for(let e of n)o+=`.union(${to(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!C6(t,e))return;let[n]=t.arguments;return Dr((e=>{for(;e?.type==="ParenthesizedExpression"||rL(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=C7(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return Dr(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[C0]:"Use `Set#union()` instead of spreading Sets into a new Set.",[C1]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[C2]:"Use `Set#intersection()`.",[C3]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[C8]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=Dl(r.consequent),o=Dl(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&Du(e,t)&&!r3(e.receiver)&&!r3(t.receiver)&&!Dp(e,r)&&!Dp(t,r)))(n,o,e))return;let a="setAttribute"===n.method?n:o,i=n===a,s=function e(t,r,n,o=!1){if("ChainExpression"===t.type)return e(t.expression,r,n,o);if("UnaryExpression"===t.type&&"!"===t.operator&&t.prefix)return e(t.argument,r,n,!o);let a=Ds(t);if(a?.method==="hasAttribute"&&Du(a,r)&&!r3(a.receiver))return{isNegative:o,isKnownNonDom:Dp(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":Da(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==tu(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||rU(e,r,c)?void 0:function*(n){var o;let i,s=(i=to(o=a.receiver,e),!ta(o,e.sourceCode)&&it(o,e)?`(${i})`:i),u=to(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),aL(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield iG(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:Dn};if(!t)return n;let o="IfStatement"!==e.type&&!(tT(e)||tT(e.parent));return r||o?n.suggest=[{messageId:Do,fix:t}]:n.fix=t,n})(r,d,{forceSuggestion:!!l||!a.hasEmptyAttributeValue})})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#toggleAttribute()` to toggle attributes.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[Dn]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[Do]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tR(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&Dg("Object",e,t)))return;let[r]=e.arguments,n=Dx(r,t);if(!n)return;let o=DE(e,r,Db(n.query,t),t);return DS({node:e,query:n.query,replacement:o,preservedNodes:[...Dv(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rL(r)&&r.expression===t;)t=r,r=r.parent;return r?.arguments?.[0]===t?r:void 0})(t))&&("CallExpression"===r.type&&1===r.arguments.length&&"MemberExpression"===r.callee.type&&"Identifier"===r.callee.object.type&&"Object"===r.callee.object.name&&((e,t,{computed:r})=>r?tu(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tE(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=Dx(t,e);if(o)return DS({node:t,query:o.query,replacement:Db(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tE(e,{name:"Map",argumentsLength:1})&&Dg("Map",e,t);if(!r&&!tE(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=Dx(n,t);if(!o)return;let a=Dh(o.query,t),i=Db(o.query,t),s=DE(e,n,r?i:a,t);return DS({node:e,query:o.query,replacement:s,preservedNodes:[...Dv(e,n,t),o.query]},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `URLSearchParams` over manually splitting query strings.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Dc]:"Prefer `URLSearchParams` over manually splitting query strings.",[Dd]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{let t=id(e,r=>aA(r,e,t));e.onExit("CallExpression",r=>(function(e,t,r){if(!tR(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!DI(e.callee.object))return;let[n]=e.arguments;if(!Dw(n)||0===n.params.length)return;let[o]=n.params,a=DU(o)&&eS(t.sourceCode.getScope(o),o);if(a)return function e(t,r,n,o){if(t=Dk(t),!(!t?.type||Dw(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tR(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!D0(t=Dk(t),r,n)||DF(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!D1(t.callee.object)){let e=D2(t,n,{knownPromiseSettledResultArray:!0,branchAlwaysExits:o});if(e)return e}for(let[a,i]of Object.entries(t))if(!("parent"===a||DZ(t,a))&&i&&"object"==typeof i)for(let t of Array.isArray(i)?i:[i]){let a=e(t,r,n,o);if(a)return a}}}(n.body,a,t,r)})(r,e,t)??D2(r,e,{branchAlwaysExits:t}))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[DC]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,s=e.parent,{id:l,init:u}=e;if("VariableDeclaration"!==s.type||"const"!==s.kind||1!==s.declarations.length||"Identifier"!==l.type||!(tE(u,{name:"AbortController",argumentsLength:0})&&oA(u.callee,t))||(n=eS(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||rV(t,a.getRange(u))||l.typeAnnotation&&rV(t,a.getRange(l.typeAnnotation)))return;let p=((e,t,r)=>{var n;let o,a=D4(e);if(a?.type!=="ForOfStatement"||a.await||!TA(a,r)||D7(r,e,a)||!Ty(a.right,r)||Ts(a.right,r)||Tc(a.right,t,r)||Tp(a.right,r)||!TC(a.right,r)||!(!(o=Tg(a.right,r))||o.length>1&&o.every(e=>Tm(e,r))))return;let s=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[t]=e.declarations;if("Identifier"===t.id.type&&!t.init)return t.id})(a.left);if(!s||!Td(s,r))return;let l=TT("ExpressionStatement"===(n=a.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!l||!rk(rN(l.sourceSignal),s))return;let u=TD(l.call.arguments[1],t,s,r);if(u)return{abortReferences:new i([u]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!TS(e,t))return r;let n=rN(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(a.right,r)})`,statements:[a]}})(s,l.name,t)??((e,t,r)=>{let n=[],o=[],a=new i,s=e,l=D4(e);for(;l;){let e=TT(l);if(!e||!TA(l,r)||D7(r,s,l)||Tc(e.sourceSignal,t,r)||Tp(e.sourceSignal,r)||!Tm(e.sourceSignal,r))break;let i=TD(e.call.arguments[1],t,e.sourceSignal,r);if(!i)break;n.push(l),o.push(e.sourceSignal),a.add(i),s=l,l=D4(l)}if(!(n.length<2))return{abortReferences:a,replacement:`AbortSignal.any([${o.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(s,l.name,t);if(!p)return;let c=eS(a.getScope(l),l);if(!c)return;for(let e of p.abortReferences)if(eS(a.getScope(e),e)!==c)return;let d=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=Tt(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(c,p.abortReferences,t);if(!d)return;let m=(r=l.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Tw(o,c,c.identifiers[0],t)||d.some(e=>Tw(o,c,e,t)))?r:o);return{node:l,messageId:D3,suggest:[{messageId:D8,*fix(e){if(yield e.replaceText(u,p.replacement),l.typeAnnotation&&(yield e.replaceText(l.typeAnnotation,": AbortSignal")),m!==l.name){let[t]=a.getRange(l);yield e.replaceTextRange([t,t+l.name.length],m)}for(let t of d)yield e.replaceText(t,m);yield((e,t,r)=>{if(1===e.length)return iQ(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,0===d?"\r"===c[m]&&"\n"===c[m+1]?m+=2:("\n"===c[m]||"\r"===c[m])&&m++:"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(p.statements,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[D3]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[D8]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tv(e))||TB(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&TB(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,rU(e,TR(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&TB(s.body,r,TI,TF))){let t;return{node:i,messageId:Tk,fix:(t=s.body,r=>r.replaceTextRange(TR(n,e.sourceCode),e.sourceCode.getText(t)))}}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Tk]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:r}=e,n=new s,a=(e,r)=>{var n;t.currentSegments.add(e),(t.terminatedFinallyBlocks.has(r)||e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||t.terminatedSegments.has(e)))&&t.terminatedSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)},u=e=>{t.currentSegments.delete(e)};e.on("onCodePathStart",(a,s)=>{let u=t,p=u&&T2(a,s)&&u.currentSegments.size>0&&[...u.currentSegments].every(e=>u.terminatedSegments.has(e));t={upper:u,codePath:a,node:s,currentSegments:new i,eventsBySegment:new o,executors:new i,catchClausesBySegment:new o,ignoredLoopEdges:[],terminatedSegments:new l,terminatedFinallyBlocks:new l,hasResolverReferences:u?.hasResolverReferences??!1},p&&t.terminatedSegments.add(a.initialSegment),TO(s,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){if("Identifier"!==o.type)continue;let a=eS(r.getScope(o),o);if(!(!a||Tq(a)))for(let r of a.references)t.set(r.identifier,e),n=!0}return n}(s,n,r)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{let r=t,n="StaticBlock"===r.node.type?r.node.body.at(-1):r.node,a="StaticBlock"===r.node.type?oQ(r.node,e):o5(r.node,e),i=T2(r.codePath,r.node)&&TX(r.node).catchClause&&n&&af(n,e)&&aA(n,e,TN)&&!a,s=n&&(aA(n,e,TN)&&!i||"TryStatement"===n.type&&T1(n,e)||"StaticBlock"===r.node.type&&!i&&a);if(!function(e,t){if(0===e.executors.size)return;let r=TV(e.codePath),n=new l;for(let a of e.executors){let i=function(e,t,r){let n,a=new o;do for(let o of(n=!1,r)){let r=function(e,t,r){for(let n of t)e=TK(e,n,r);return e}(TY(o,a,e),e.eventsBySegment.get(o)??[],t);TJ(r,a.get(o))||(a.set(o,r),n=!0)}while(n);return a}(e,a,r);for(let o of r){let r=TY(o,i,e);for(let i of e.eventsBySegment.get(o)??[])i.executor===a&&r.resolverCalled&&!n.has(i.node)&&(n.add(i.node),t.report({node:i.node,messageId:TP})),r=TK(r,i,a)}}}(r,e),r.upper&&T2(r.codePath,r.node)&&(TV(r.codePath).every(e=>r.terminatedSegments.has(e))||s))for(let e of r.upper.currentSegments)r.upper.terminatedSegments.add(e);t=r.upper}),e.onExit("IfStatement",n=>{let o,a=eV(n.test,r.getScope(n.test));if(null!==a&&oW(n.test,e)&&(o=a.value?n.consequent:n.alternate),o&&function e(t){return"ReturnStatement"===t.type?!t.argument:"BlockStatement"===t.type&&1===t.body.length&&e(t.body[0])}(o))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)}),e.on("onCodePathSegmentStart",a),e.on("onUnreachableCodePathSegmentStart",a),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{(TH(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tw(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tI(o))return r;n=o,{parent:o}=o}return!1}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(o0(r,e)){if(!TZ(r,e)&&!function(e,t,r){let n=e,{parent:o}=e,a=!1;for(;o&&!tw(o);){if("IfStatement"===o.type&&(o.consequent===n||o.alternate===n)?a||=!oV(o.test,t):("SequenceExpression"===o.type&&o.expressions[0]!==n||"LogicalExpression"===o.type&&o.right===n||"ConditionalExpression"===o.type&&o.test!==n)&&(a||=!o5(o,t)),"TryStatement"===o.type&&o.handler&&o.block===n)return a||!oQ(o.block,t,!0,{isAdditionalStatementDefinitelyNotThrowing:e=>TW(e,r)});n=o,{parent:o}=o}return!1}(r,e,n)){let n=function(e,t){let r=e,{parent:n}=e;for(;n;){if(tw(n))return;if("TryStatement"===n.type&&n.finalizer&&(n.block===r||n.handler===r)&&T1(n,t))return n;r=n,{parent:n}=n}}(r,e);for(let o of(n&&t.terminatedFinallyBlocks.add(n.finalizer),function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type)return n.right===r&&TO(n.parent,t)&&!n.parent.params.slice(0,2).includes(n);if(!T0(n,r,t))break;r=n,{parent:n}=n}return!1}(r,e)&&t.terminatedSegments.add(t.codePath.initialSegment),t.currentSegments))t.terminatedSegments.add(o)}return}if(!t.hasResolverReferences||"Identifier"===r.type&&(n.has(r)||!TQ(r))||"ImportExpression"===r.type&&!TQ(r))return;let o=TU(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tw(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:TX(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(TH(r)&&("WhileStatement"===r.type&&r.body===t||"ForStatement"===r.type&&(r.body===t||r.update===t)))return!0;t=r,{parent:r}=r}return!1}(r)||o&&TZ(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable||s.terminatedSegments.has(e))continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}}),e.onExit(["ArrayExpression","AssignmentExpression","ConditionalExpression","ImportExpression","LogicalExpression","ObjectExpression","SequenceExpression","TemplateLiteral","YieldExpression"],r=>{if(o5(r,e))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[TP]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(!tR(t,{methods:T8,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let a=t.callee.object;if(!tR(a,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||r3(t))return;let i=a.callee.object;if(((e,t)=>{if(e=rN(e),e=rN(rJ(e,t)??e),T9.has(e.type))return!0;let r=T5(e,t);return!!r&&"string"!=typeof r.value})(i,e)||of(i,e)||tR(r=rN(r=i),{method:"string",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===r.callee.object.type&&(n=r.callee.object,o=eS(e.sourceCode.getScope(n),n),o?.defs.some(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return!aN(t)&&r.source?.value==="zod"&&("ImportNamespaceSpecifier"===t.type||"ImportSpecifier"===t.type&&("z"===t.imported.name||"z"===t.imported.value))})))return;let{property:s}=t.callee,{property:l}=a.callee,u=s.name,[p]=t.arguments;if(p){let t=((e,t)=>{let r=T5(e,t);if(!r)return;let{value:n}=r;return null===n||T6.has(typeof n)?String(n):void 0})(p,e);if(void 0===t||("startsWith"===u?t!==t.trimEnd():t!==t.trimStart()))return}let c="startsWith"===u?"trimStart":"trimEnd";return{node:l,messageId:T3,data:{method:u,replacement:c},fix:e=>e.replaceText(l,c)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[T3]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:Ae(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=T7(n.exported);if("default"===o)return;let a=T7(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=Ae(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:T4}};e.on("Program:exit",function*(){if(1===new i(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=o(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[T4]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}},"unicorn/iteration-fallback-style":{create:e=>{e.options[0]===Ao?e.on("IfStatement",t=>((e,t)=>{let r=(e=>{let t=(e=>{if(e.alternate)return;let{consequent:t}=e;if("BlockStatement"===t.type){if(1!==t.body.length)return;return t.body[0]}return t})(e);if(!t||"ForInStatement"!==t.type&&"ForOfStatement"!==t.type)return;let r=rN(e.test),n="||";if(!pj(r)){if("BinaryExpression"!==r.type||"!="!==r.operator)return;let e=td(r.left),t=e?r.right:r.left;if(!td(e?r.left:r.right)||!pj(t))return;r=t,n="??"}let o=rN(As(t));if(!(pB(r)||pB(o))&&pj(o)&&rk(r,o))return{loop:t,source:o,sourceNode:As(t),operator:n}})(e);if(!r)return;let n=Al(r.loop)?"object":"array",o={node:e.test,messageId:Ar,data:{type:n}};return"ForOfStatement"===r.loop.type&&((e,t,r)=>{let{sourceCode:n}=r,{source:o}=t,{start:a}=n.getLoc(e);return!(n.getCommentsInside(e).length>0||rG(e,r)||!pj(o)||o!==t.sourceNode||eH(o,n)||t.loop.await||"LabeledStatement"===e.parent.type||rR(e,r).length!==a.column)})(e,r,t)&&(o.fix=n=>{let{sourceCode:o}=t,{loop:a,sourceNode:i,operator:s}=r,[l]=o.getRange(a),[u,p]=o.getRange(i),c=o.getText(a),d=o.getText(i),m=Al(a)?"{}":"[]",f=[c.slice(0,u-l),`${d} ${s} ${m}`,c.slice(p-l)].join(""),g=rR(e,t);return n.replaceText(e,((e,t,r)=>{let[n,...o]=dN(`${t}${e}`).split("\n");return[n,...o.map(e=>""===e?e:`${r}${e}`)].join("\n")})(f,rR(a,t),g))}),o})(t,e)):e.on(["ForInStatement","ForOfStatement"],t=>((e,t)=>{let r=((e,t)=>{let r=rN(e);if("LogicalExpression"!==r.type||"??"!==r.operator&&"||"!==r.operator)return;let n=rN(r.right);if(t(n))return{logicalExpression:r,fallback:n,source:r.left,operator:r.operator}})(As(e),Al(e)?tD:tC);if(!r)return;let{fallback:n}=r,o="ArrayExpression"===n.type?"array":"object",a={node:n,messageId:At,data:{type:o}};return"ForOfStatement"===e.type&&((e,t,r)=>{let{sourceCode:n}=r,{logicalExpression:o,source:a}=t;return!e.await&&!(n.getCommentsInside(o).length>0||rG(e,r)||rL(o.right)||!pj(a)||eH(a,n)||"LabeledStatement"===e.parent.type||"IfStatement"===e.parent.type)})(e,r,t)&&(a.fix=n=>{let{sourceCode:o}=t,{logicalExpression:a,source:i,operator:s}=r,[l]=o.getRange(e),[u,p]=o.getRange(a),c=o.getText(e),d=o.getText(i),m=[c.slice(0,u-l),d,c.slice(p-l)].join(""),f=rR(e,t),g=dN(`${f}${m}`),y="??"===s?`(${d}) != null`:d;return n.replaceText(e,`if (${y}) {
58
- ${d$(g,1,{indent:`${f} `})}
59
- ${f}}`)}),a})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce a consistent style for optional loop sources.",recommended:!1},fixable:"code",schema:[{enum:[An,Ao],description:"The preferred style for optional loop sources."}],defaultOptions:[An],messages:{[At]:"Prefer an `if` guard over the empty {{type}} fallback.",[Ar]:"Prefer an empty {{type}} fallback over the `if` guard."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=S.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v73.0.0/docs/rules/${r}.md`)}},create:a3(t.create)}]})))};module.exports=Au;
55
+ ${i}});`)}(a,s,e)),u})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[bZ]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:r,init:n}=t;if("ObjectPattern"!==r.type||n?.type!=="ObjectExpression"||0!==e.sourceCode.getCommentsInside(t).length)return;let a=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(b6(n)&&"Identifier"===n.value.type))return;let e=eG(n,t.sourceCode.getScope(n));if(null===e||b3.has(e))return;r.push({node:n,name:e})}return r})(r,e),s=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||eZ(n.argument,t.sourceCode,b8))return;let a=new o;for(let e of r.slice(0,-1)){if(!b6(e)||eZ(e.value,t.sourceCode,b8))return;let r=eG(e,t.sourceCode.getScope(e));if(null===r||a.has(r))return;a.set(r,e)}return{defaultProperties:a,spreadElement:n}})(n,e);if(!a||0===a.length||!s)return;let{defaultProperties:l,spreadElement:u}=s;if(a.length!==l.size)return;let p=new i(a.map(e=>e.node.value.name)),c=[];for(let t of a){let r=l.get(t.name);if(!r||b9(r.value,p,e))return;c.push(b5(t,r,e))}return{node:t,messageId:b1,suggest:[{messageId:b2,fix:r=>r.replaceText(t,`{${c.join(", ")}} = {${e.sourceCode.getText(u)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[b1]:"Prefer object destructuring defaults over default object literals with spread.",[b2]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>Et(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>Et(t,e.body)),e.on("SwitchCase",e=>Et(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[b4]:"Prefer a single object destructuring declaration from `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&"let"===e.kind&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type&&!e.declarations[0].init))return;let[r]=e.declarations,[n]=t.getDeclaredVariables(r),o=n.references.filter(e=>!e.init),a=o.filter(e=>e.isWrite());if(1!==a.length||o.every(e=>!e.isRead()))return;let i=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(a[0]);if(!i)return;let{assignmentExpression:s,assignmentStatement:l,block:u}=i,[,p]=t.getRange(e),[c,d]=t.getRange(l);if(!Eo(u,e.parent)||function e(t,r){if("WithStatement"===t.type||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"eval"===t.callee.name)return!0;for(let n of r[t.type]??[]){let o=t[n];if(Array.isArray(o)){if(o.some(t=>t&&e(t,r)))return!0}else if(o&&e(o,r))return!0}return!1}(e.parent,t.visitorKeys)||c<p||o.some(e=>!Eo(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:Er,data:{name:r.id.name}};return r.id.typeAnnotation||Ei(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||Ea(t,e,"before")||Ea(t,e,"after")||Ea(t,l,"before")||Ea(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield sA(t,{sourceCode:e},a);let i=`const ${o} = `;if(Ei(e,r))return void(yield a.replaceText(n,`${i}${e.getText(r.right)};`));let[s]=e.getRange(r),[l]=e.getRange(r.right);yield a.replaceTextRange([s,l],i)}}({sourceCode:t,declaration:e,assignmentExpression:s,assignmentStatement:l,name:r.id.name})),m})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[Er]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=Eu.get(t.operator);if(!r||e.sourceCode.getCommentsInside(t).length>0)return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!tL(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let n=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(!n)return;let{object:o}=e.callee;if(!os(o,r)){var a;let t;return{node:e,object:o,callback:{...n,parameterText:(a=n.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!rj(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:Es,data:{method:r},suggest:[{messageId:El,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(ts(e,r))return ti(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):Ep.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]}})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Es]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[El]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tL(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===EI(t.callee.object,e)){let r={node:t.callee.property,messageId:Ec};return EF(t,e)&&!ts(t.callee,e)&&Ej(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tv(t,{name:"String",argumentsLength:1,optional:!1},tx)&&rF(t.callee,e)))return;let[r]=t.arguments;if("url"!==EI(r,e))return;let n={node:t.callee,messageId:Ec};return EF(t,e)&&Ej(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=ti(r,e),a=!ts(r,e)&&iU(r,e)?`(${o})`:o,i=`${a}.href`,(ip(e.sourceCode.getTokenBefore(r.parent),e,i)?";":"")+i))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[Ec]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new s,n=[];function*o(e){if(!EN(e))return;let n=e.arguments[1];if("ObjectExpression"===n.type)for(let e of n.properties){let n=EV(e,t);if(!n)continue;let o=EW(n,t,r);o&&(yield o)}}e.on("onCodePathStart",(e,r)=>{let o,a,s;n.push((o=r.parent,a=o?.parent,s=a?.parent,o?.value===r&&a?.type==="ObjectExpression"&&s?.arguments?.[1]===a&&EN(s)&&EV(o,t))?new i:void 0)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1)?.add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1)?.delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1)?.add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1)?.delete(e)}),e.onExit("BlockStatement",t=>{let o=n.at(-1);if(!o||!(EP.has(t.parent?.type)&&t.parent.body===t))return;let a=[...o].every(e=>!e.reachable),i=ie(t,e,EL)||aQ(t,e);r.set(t.parent,a||i)}),e.onExit("CallExpression",o),e.onExit("NewExpression",o)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[EB]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":EX,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:EY,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield sy(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=EH.get(n);if(!o||!rF(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",t=>{if("+"===t.operator&&oN(t.argument,e))return r(t,t.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(tl(a,"")&&ok(o,e))n=o;else{if(!(tl(o,"")&&ok(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&ok(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[EY]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!tL(r,{methods:EZ,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tI(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tJ(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&ae(n.params[0],a))&&!(function e(t){return(t=rP(t),t?.type==="ChainExpression")?nu(t):t?.type==="LogicalExpression"?"&&"===t.operator&&e(t.left)||e(t.right):t?.type==="ConditionalExpression"?e(t.consequent)||e(t.alternate):t?.type==="SequenceExpression"&&e(t.expressions.at(-1))}(a)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.getTypeAtLocation(e);return(t.isUnion()?t.types:[t]).some(e=>"void"===e.intrinsicName||n$.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:EQ,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[EQ]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tF(e)&&e.body===t}})(t))return{node:t,messageId:E0,fix:r=>sA(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[E0]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=eG(e,l);if("string"==typeof u&&eG(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&eG(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=E3(i,e))||!0!==o4(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=E3(i,e))&&E2(t.type)))return}return{node:r.key,messageId:E1,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield sj(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[E1]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tL(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;vs.has(e.parent?.type)&&e.parent.expression===e;)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(t.sourceCode.getCommentsInside(e).length>0)return;let a=((e,t,r)=>{let n=vS(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&vf(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(vf(t.value,r)&&vI(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(tf(t.value)&&o&&vI(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!vf(n,t):!tf(n)))return;return{node:e.callee.property,messageId:E8,fix:((e,t,r)=>{var n;let o;if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let a=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${(o=ti(n=e.callee.object,r),!ts(n,r)&&iU(n,r)?`(${o})`:o)}.has(${((e,t)=>{let[r]=e.arguments;return t.sourceCode.getText(r)})(e,r)})`;return e=>e.replaceText(t.node,a)})(e,r,t)}}if((tX(e,t)||tY(e))&&vS(e.callee.object,t)?.kind==="map"&&vI(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:E8,fix:t=>t.replaceText(e.callee.property,"has")}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[E8]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===vF?e.on("LogicalExpression",t=>{if(vN(t)){if("&&"!==t.operator||vL(t.right)||v$(t.left,t.right,e.sourceCode))return;let r=vU(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&v$(r.reference,t.right,e.sourceCode))return;let n=vW(t.left,e),o=vW(t.right,e);return{node:t,messageId:vB,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):e.on("ConditionalExpression",t=>{if(vN(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=vL(o);if(a===vL(n))return;let i=a?n:o,s=vU(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?v$(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&v$(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&v$(s.reference,i,t.sourceCode))return;let u=a?vV(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return vV(e.argument,"left",t);let r=ti(e,t);return!ts(e,t)&&i_(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=vV(i,"right",t);return{node:e,messageId:vB,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)})},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[vj,vF]}],defaultOptions:[vj],messages:{[vB]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=v_(e.right);if(!n||!tL(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=v_(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=vz(n,t);if(!a||!i||i!==vz(a,t)||!function(e){let[t]=e?.defs??[];if(!t||1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&v_(t.node.init);return!!(r&&tT(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tI(r))return;if(tF(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:vK}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[vK]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!tL(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tq(t.callee,vJ)||op(r,e)))return{node:n,messageId:vG,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[vG]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!vH(t.property)||nl(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=vQ(t.object,e);if(r)return vZ(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tL(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(vH(n)?r="first":tN(n)&&(r="last"),!r||nl(t))return;let o=vQ(t.callee.object,e);if(o)return vZ(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[vX]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[vY]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(tv(r,{minimumArguments:1},tx)&&"MemberExpression"===r.callee.type&&v2.has(eG(r.callee,n.sourceCode.getScope(r.callee)))))return;let[o]=t.arguments;if("SpreadElement"===o.type)return;let a=((e,t)=>{let r=rP(e);if(tI(r)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(r);if(!oJ(r,t)&&!v6(e,t))return;return{node:e,messageId:v0,suggest:e===r?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=rP(n=t)).type&&v3.has(n.operator)?n:void 0;if(!i||rR(i.left)||rR(i.right)||!v8(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:v1,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(r,n,t):void 0}}if(oX(r,t)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||oO.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=oq.get(e.object.name),n=eG(e,t.sourceCode.getScope(e));return!!r?.has(n)}(r,t)||v6(e,t))return{node:e,messageId:v0}})(o,e);if(!(!a||os(t.callee.object,e)))return a})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[v0]:"Do not return a boolean from a sort comparator.",[v1]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!Se.has(r.operator))return;let n=St(r.left)?r.left:r.right;if(!St(n))return;let o=n===r.left,a=o?r.right:r.left;if(v7.has(r.operator)&&oH(a,e))return;let i={node:r,messageId:v9},s=v4.has(n.operator)===v4.has(r.operator)&&!tp(r.right);if(o&&s&&!St(r.right)&&!St(n.left)&&((e,t)=>{if(ts(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eZ(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${ti(n.right,e)} ${r.operator} ${ti(r.right,e)}`;i.suggest=[{messageId:v5,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[v9]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[v5]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!(e=>{switch(e.operator){case"*":case"&":return tl(e.left,0)||tl(e.right,0);case"/":return tl(e.left,0);default:return!1}})(r))return;let n={node:r,messageId:Sr},o=rQ(r,e);return o&&Object.is(o.value,0)&&0===t.getCommentsInside(r).length&&(n.suggest=[{messageId:Sn,fix:e=>e.replaceText(r,"0")}]),n})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Sr]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[Sn]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!Sl(o)||!Sl(t.right)||!cn(o,t.right))return;let a={node:t.right,messageId:So};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=ta(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=ti(t.left,e),s=e=>e.replaceText(t,i);return Ss.has(o.type)&&(n=t.right,Ss.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:Sa,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[So]:"This operand duplicates the left operand.",[Sa]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o;if(!Object.hasOwn(Sp,t.operator))return;let a=(r=rP(t.left),n=rP(t.right),nd(r)?{memberExpression:r,operator:t.operator,value:Sc(n,e)}:nd(n)?{memberExpression:n,operator:Sp[t.operator],value:Sc(r,e)}:void 0);if(!a)return;let{memberExpression:i}=a;if("ThisExpression"===(o=rP(i.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rP(t)).type||nu(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(i.object)||function(e,t){let{sourceCode:r}=t,n=rH(e,t);if(n)return!Number.isSafeInteger(n.value)||n.value<0;let{object:o}=e;if("Identifier"!==o.type)return!1;let a=eD(t.sourceCode.getScope(o),o),i=a?.defs.length===1?a.defs[0]:void 0;if(i?.type!=="Variable"||i.node.init?.type!=="ObjectExpression")return!1;let s=eG(e,t.sourceCode.getScope(e)),l=a.references.filter(e=>!e.init),u=nC(e),p=!1,c=!1,d=!1;for(let n of l){let o=nC(n.identifier)!==u||nD(n.identifier,t);if(o||!(r.getRange(n.identifier)[0]>r.getRange(e)[0])){if(nw(n,s,t)){p=!0;continue}if(nA(n,s,t)){!o&&nS(n,s,t)?c=!0:p=!0;continue}if(nE(n,s,t)){if(o){p=!0;continue}d=!0;continue}if(!nk(n,s,t)){if(o){p=!0;continue}return!1}}}if(p)return!0;if(c)return!1;if(d)return!0;let m=rH(i.node.init,t)?.value;return!!(m&&(!Number.isSafeInteger(m[s])||m[s]<0))}(i,e)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;t_(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tR(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&np.has(r.property.name)&&rj(r.object,t.object))}({node:t,lengthOrSizeNode:i}))return;let s=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(a);if(void 0!==s)return{node:t,messageId:Su,data:{property:i.property.name,result:String(s)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[Su]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(Sm.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=tc(n);if(void 0!==o&&o.length>1&&Sf(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:Sd,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[Sd]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new l,r=iH(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=SA(n.right,e);if(o)return function* e(t,r,n,o){if(Sv.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=SA(t.right,o);e&&Sj(e.reference,r.iterable,o)&&(a=Sk(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=eG(e.callee,n.sourceCode.getScope(e.callee));if(!(!Sb[t.collectionKind??"unknown"].has(c)||!Sj(u,i,n)||"delete"===c&&SF(e,a,n)||SB(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=rP(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eG(o.callee,n.sourceCode.getScope(o.callee))&&Sj(o.callee.object,r.iterable,n)&&SF(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type&&(!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&SB(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:Sg,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of o.sourceCode.visitorKeys[t.type]??[]){let i=t[n];if(Array.isArray(i)){for(let t of i)t&&(yield*e(t,r,a,o));continue}i&&(yield*e(i,r,a,o))}}(n.body,{branchAlwaysExits:r,...Sk(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[Sg]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(tL(e,{methods:SP})&&tR(e.callee.object,{property:"classList",computed:!1})&&!o2(rP(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?Sq(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:Sq(e.arguments.slice(0,2),"."):Sq(e.arguments.slice(0,1),".")}if(tL(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!o2(rP(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return Sq(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rP(r),o=SM(e);S$(o)&&(yield SO(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[SR]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!S_.has(r.operator)||!td(r.right)||r.right.value!==S_.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:SU,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:SU,data:n,suggest:[{messageId:SV,fix:t=>sA(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:SU,data:n,suggest:[{messageId:SW,data:{left:a},fix:e=>e.replaceText(r,a)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[SU]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[SV]:"Remove the useless assignment.",[SW]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&rj(o.right,a.object)&&S2(o.right,r)&&S3(o.left,r)&&S3(o.right,r)&&(!a.computed||S3(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rj(e,t))return!((e,t)=>{var r;let n;if(S2(e,t)||S0(rP(e),t))return!0;let o=ni(rP(e),t);if(!o)return!1;let a=rP(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===S1(r,t)})(e,r);let n=S1(e,r),o=S1(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eG(a,r.sourceCode.getScope(a));n=null!==e&&e===S1(o.left,r)}return n?{suggest:[{messageId:SK,fix:S6(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(S8(n,"has")&&S8(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rP(e)).type)return!1;let n=ni(e,t);if(!n)return!1;let o=rP(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&SJ.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&rj(n.callee.object,t.callee.object)&&rj(n.arguments[0],t.arguments[0])&&S3(n.arguments[0],r))return{fix:S6(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:Sz,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[Sz]:"The existence check before deletion is unnecessary.",[SK]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!S5.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=S4.get(o),tp(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=S5.get(o),a.filter((e,r)=>tp(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tX(n=e[t].parent,r)||tY(n)||o.every(e=>oH(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&tu(rP(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tI(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:S9,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>sy(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=ts(t,e),a=ti(t,e),!o&&iz(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&S7.has(rP(t).type)&&(a=`(${a})`),a}).join(` ${n} `),ip(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[S9]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=Cn(o),u=Cn(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:Ce},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||ne(e,a),m=!c&&!Co(n.test,e)&&!!(s=eD(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=ti(t,e);if(r)return i_(t,"!")?`!(${n})`:`!${n}`;if(Co(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){var o,a;let i,s=iZ(n,e);if(!s||"ReturnStatement"!==s.type)return;let l=Cr(n.consequent),u=Cn(l);if(void 0!==u&&(o=n,a=u,i=iQ(o,e,-1),i?.type==="IfStatement"&&!i.alternate&&Cn(Cr(i.consequent))===a))return;let p=r(n,l,s,[t.getRange(n)[0],t.getRange(s)[1]]);return p?.fix&&t.getTokensBetween(n,s,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:Ce}:p}return r(n,Cr(n.consequent),Cr(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Ce]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{let r=(e=>{for(let t of Ci)if(Cs(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>Cs(e,r))||((e,t)=>{let{parent:r}=e;return Cs(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:Ca,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=Cl(e,r).map(e=>t.getText(e)).join(", ");yield n.replaceText(e,`${a}(${i})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Ca]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>Cg(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>Cg(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield Ch({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield Ch({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[Cu]:"These branches start with the same code. Move it before the `if` statement.",[Cp]:"These branches end with the same code. Move it after the `if` statement.",[Cc]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===CS(r))return;let n=r.arguments[1];if(!tu(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==CS(e)&&tu(e.arguments[1])&&e.arguments[1].value===o,{parent:s}=r;if("MemberExpression"===s.type&&s.object===r&&"CallExpression"===s.parent.type&&s.parent.callee===s&&a(s.parent))return;let l=[],u=r;for(;a(u);)l.push(CS(u)),u=u.callee.object;if(l.length<2)return;let p=u;l.reverse();let c=[...new i(l)];if(c.some(e=>o.includes(e)))return;let d={node:r,messageId:Cb};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(Cv.has(e))return Cv.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===c.length-1)).join(""),o=ti(p,e),a=ti(n,e);d.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return d})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[Cb]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}},"unicorn/consistent-tuple-labels":{create:e=>{e.on("TSTupleType",e=>{let t=e.elementTypes;if(t.length<2)return;let r=t.filter(e=>"TSNamedTupleMember"!==e.type&&("TSRestType"!==e.type||"TSNamedTupleMember"!==e.typeAnnotation.type));if(0!==r.length&&r.length!==t.length)return r.map(e=>({node:e,messageId:CC}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[CC]:"This tuple element should have a label, just like the other elements."},languages:["js/js"]}},"unicorn/no-invalid-well-known-symbol-methods":{create:e=>{e.on("MethodDefinition",t=>CB(t,e)),e.on("Property",t=>CB(t,e)),e.on("PropertyDefinition",t=>CB(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[CD]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[CT]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[CA]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[Cw]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[Ck]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=y5(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tL(e,{methods:CN,computed:!1}))return;let{callee:t}=e,r=rP(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=eD(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!of(o=u.name,e)&&(y8.test(o.name)||om(o,e))))return;let c=y6(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=CR;return c?m=CL:d&&(m=CP),{node:n,messageId:m,data:{name:i.name,method:s}}})},meta:{type:"problem",docs:{description:"Disallow event-control method calls after the synchronous event dispatch has finished.",recommended:!0},schema:[],messages:{[CR]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[CP]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[CL]:"`{{name}}.{{method}}()` may run after synchronous event dispatch has finished. Call it in the outer handler before deferring work."},languages:["js/js"]}},"unicorn/prefer-abort-signal-timeout":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,i=e.parent,{id:s,init:l}=e;if("VariableDeclaration"!==i.type||"const"!==i.kind||1!==i.declarations.length||"Identifier"!==s.type||!(tS(l,{name:"AbortController",argumentsLength:0})&&rF(l.callee,t))||(n=eD(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||nt(t,a.getRange(l))||s.typeAnnotation&&nt(t,a.getRange(s.typeAnnotation)))return;let u=(e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]})(i),p=((e,t)=>{if(e?.type==="ExpressionStatement"&&tv(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},tx)&&rF(e.expression.callee,t))return e.expression})(u,t);if(!p||((e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})})(t,i,u)||nt(t,a.getRange(u))||ne(t,u))return;let c=((e,t)=>{let[r]=e.arguments,n=!r||"ArrowFunctionExpression"!==r.type&&"FunctionExpression"!==r.type||r.async||r.generator||r.params.length>0?void 0:"BlockStatement"!==r.body.type?r.body:1===r.body.body.length&&"ExpressionStatement"===r.body.body[0].type?r.body.body[0].expression:void 0;if(tv(n,{argumentsLength:0,optional:!1},tx)&&tR(n.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===n.callee.object.type&&n.callee.object.name===t)return n.callee.object})(p,s.name);if(!c)return;let d=eD(a.getScope(s),s);if(!d||eD(a.getScope(c),c)!==d)return;let m=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(e===t||o.init)continue;if(o.isWrite())return;let a=Cq(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(d,c,t);if(!m)return;let f=a.getRange(u),[,g]=p.arguments;if("SequenceExpression"===g.type||!((e,t)=>{let r=rH(e,t);if(!r&&rX(e,t)&&ez(e,t.sourceCode.getScope(e)))return!1;if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(g,t)||m.some(e=>{let r;return(r=t.sourceCode.getRange(e))[0]>=f[0]&&r[1]<=f[1]}))return;let y=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||CU(o,d,d.identifiers[0],t)||m.some(e=>CU(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:C$,suggest:[{messageId:CM,*fix(e){if(yield e.replaceText(l,h),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),y!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],y)}for(let t of m)yield e.replaceText(t,y);yield sA(u,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[C$]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[CM]:"Replace with `AbortSignal.timeout()`."},languages:["js/js"]}},"unicorn/prefer-aggregate-error":{create:e=>{e.on("IfStatement",t=>{var r;let n,o="ThrowStatement"===(r=t.consequent).type?r:"BlockStatement"===r.type&&1===r.body.length&&"ThrowStatement"===r.body[0].type?r.body[0]:void 0;if(!o)return;let a=function(e,t){let r=e.argument;if(tS(r,{name:"Error",maximumArguments:2})&&rF(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=CH(e.test).map(e=>(function(e,t){let r=CX(e=Cz(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=CX(e.left,t);if(n&&CY(e.operator,e.right,!0))return n;let o=CX(e.right,t);if(o&&CY(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=im("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:CV,fix:e.sourceCode.getCommentsInside(a).length>0?void 0:e=>{let t=[s.getText(i),...a.arguments.map(e=>s.getText(e))].join(", ");return e.replaceText(a,`new AggregateError(${t})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer `AggregateError` when throwing collected errors.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[CV]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tL(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!Dt(r.callee.object,n):!(tv(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},tx)&&rF(r.callee,n)))return;let[a,i]=t.arguments,s=tc(o=rP(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!CZ.has(s))return;let l=((e,t)=>{if(tI(e=rP(e)))return e;if("Identifier"!==e.type)return;let r=eD(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("FunctionName"===n.type)return n.node;let o=n.node.init&&rP(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tI(o))return o})(i,e);if(l&&Du(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:CQ,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!Dg(e,t)||t.sourceCode.getCommentsInside(e).length>0)return;let[r]=e.arguments;if("ArrayExpression"===r.type&&r.elements.length>=2&&r.elements.every(e=>{let r;return DE(e,t)&&(r=e.argument,tS(r,{name:"Set",argumentsLength:0})&&rF(r.callee,t)||!eZ(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:Dp,fix:n=>n.replaceText(e,Dh(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=Dy(r,t);for(let e of n)o+=`.union(${ti(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!Dg(t,e))return;let[n]=t.arguments;return DS((e=>{for(;e?.type==="ParenthesizedExpression"||rR(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=Db(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return DS(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[Dp]:"Use `Set#union()` instead of spreading Sets into a new Set.",[Dc]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[Dd]:"Use `Set#intersection()`.",[Dm]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[Df]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=Dk(r.consequent),o=Dk(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&DI(e,t)&&!nu(e.receiver)&&!nu(t.receiver)&&!Dj(e,r)&&!Dj(t,r)))(n,o,e))return;let a="setAttribute"===n.method?n:o,i=n===a,s=function e(t,r,n,o=!1){if("ChainExpression"===t.type)return e(t.expression,r,n,o);if("UnaryExpression"===t.type&&"!"===t.operator&&t.prefix)return e(t.argument,r,n,!o);let a=Dw(t);if(a?.method==="hasAttribute"&&DI(a,r)&&!nu(a.receiver))return{isNegative:o,isKnownNonDom:Dj(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":DT(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==tc(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||r7(e,r,c)?void 0:function*(n){var o;let i,s=(i=ti(o=a.receiver,e),!ts(o,e.sourceCode)&&iU(o,e)?`(${i})`:i),u=ti(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),ip(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield sv(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:DC};if(!t)return n;let o="IfStatement"!==e.type&&!(tw(e)||tw(e.parent));return r||o?n.suggest=[{messageId:DD,fix:t}]:n.fix=t,n})(r,d,{forceSuggestion:!!l||!a.hasEmptyAttributeValue})})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#toggleAttribute()` to toggle attributes.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[DC]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[DD]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tL(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&DL("Object",e,t)))return;let[r]=e.arguments,n=DM(r,t);if(!n)return;let o=Dq(e,r,DO(n.query,t),t);return DV({node:e,query:n.query,replacement:o,preservedNodes:[...DU(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rR(r)&&r.expression===t;)t=r,r=r.parent;return r?.arguments?.[0]===t?r:void 0})(t))&&("CallExpression"===r.type&&1===r.arguments.length&&"MemberExpression"===r.callee.type&&"Identifier"===r.callee.object.type&&"Object"===r.callee.object.name&&((e,t,{computed:r})=>r?tc(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tS(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=DM(t,e);if(o)return DV({node:t,query:o.query,replacement:DO(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tS(e,{name:"Map",argumentsLength:1})&&DL("Map",e,t);if(!r&&!tS(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=DM(n,t);if(!o)return;let a=D$(o.query,t),i=DO(o.query,t),s=Dq(e,n,r?i:a,t);return DV({node:e,query:o.query,replacement:s,preservedNodes:[...DU(e,n,t),o.query]},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `URLSearchParams` over manually splitting query strings.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[DF]:"Prefer `URLSearchParams` over manually splitting query strings.",[DB]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{let t=iH(e,r=>ie(r,e,t));e.onExit("CallExpression",r=>(function(e,t,r){if(!tL(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!DX(e.callee.object))return;let[n]=e.arguments;if(!DG(n)||0===n.params.length)return;let[o]=n.params,a=D5(o)&&eD(t.sourceCode.getScope(o),o);if(a)return function e(t,r,n,o){if(t=DJ(t),!(!t?.type||DG(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tL(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!Tp(t=DJ(t),r,n)||DH(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!Tc(t.callee.object)){let e=Td(t,n,{knownPromiseSettledResultArray:!0,branchAlwaysExits:o});if(e)return e}for(let[a,i]of Object.entries(t))if(!("parent"===a||Tu(t,a))&&i&&"object"==typeof i)for(let t of Array.isArray(i)?i:[i]){let a=e(t,r,n,o);if(a)return a}}}(n.body,a,t,r)})(r,e,t)??Td(r,e,{branchAlwaysExits:t}))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[DW]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,s=e.parent,{id:l,init:u}=e;if("VariableDeclaration"!==s.type||"const"!==s.kind||1!==s.declarations.length||"Identifier"!==l.type||!(tS(u,{name:"AbortController",argumentsLength:0})&&rF(u.callee,t))||(n=eD(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||nt(t,a.getRange(u))||l.typeAnnotation&&nt(t,a.getRange(l.typeAnnotation)))return;let p=((e,t,r)=>{var n;let o,a=Tx(e);if(a?.type!=="ForOfStatement"||a.await||!TK(a,r)||Tb(r,e,a)||!TN(a.right,r)||Tw(a.right,r)||TF(a.right,t,r)||Tj(a.right,r)||!TW(a.right,r)||!(!(o=TL(a.right,r))||o.length>1&&o.every(e=>TR(e,r))))return;let s=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[t]=e.declarations;if("Identifier"===t.id.type&&!t.init)return t.id})(a.left);if(!s||!TB(s,r))return;let l=Tz("ExpressionStatement"===(n=a.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!l||!rj(rP(l.sourceSignal),s))return;let u=T_(l.call.arguments[1],t,s,r);if(u)return{abortReferences:new i([u]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!TV(e,t))return r;let n=rP(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(a.right,r)})`,statements:[a]}})(s,l.name,t)??((e,t,r)=>{let n=[],o=[],a=new i,s=e,l=Tx(e);for(;l;){let e=Tz(l);if(!e||!TK(l,r)||Tb(r,s,l)||TF(e.sourceSignal,t,r)||Tj(e.sourceSignal,r)||!TR(e.sourceSignal,r))break;let i=T_(e.call.arguments[1],t,e.sourceSignal,r);if(!i)break;n.push(l),o.push(e.sourceSignal),a.add(i),s=l,l=Tx(l)}if(!(n.length<2))return{abortReferences:a,replacement:`AbortSignal.any([${o.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(s,l.name,t);if(!p)return;let c=eD(a.getScope(l),l);if(!c)return;for(let e of p.abortReferences)if(eD(a.getScope(e),e)!==c)return;let d=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=Tv(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(c,p.abortReferences,t);if(!d)return;let m=(r=l.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||TG(o,c,c.identifiers[0],t)||d.some(e=>TG(o,c,e,t)))?r:o);return{node:l,messageId:Tm,suggest:[{messageId:Tf,*fix(e){if(yield e.replaceText(u,p.replacement),l.typeAnnotation&&(yield e.replaceText(l.typeAnnotation,": AbortSignal")),m!==l.name){let[t]=a.getRange(l);yield e.replaceTextRange([t,t+l.name.length],m)}for(let t of d)yield e.replaceText(t,m);yield((e,t,r)=>{if(1===e.length)return sA(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,0===d?"\r"===c[m]&&"\n"===c[m+1]?m+=2:("\n"===c[m]||"\r"===c[m])&&m++:"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(p.statements,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[Tm]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[Tf]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tC(e))||TQ(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&TQ(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,r7(e,TZ(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&TQ(s.body,r,TX,TH))){let t;return{node:i,messageId:TJ,fix:(t=s.body,r=>r.replaceTextRange(TZ(n,e.sourceCode),e.sourceCode.getText(t)))}}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[TJ]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:r}=e,n=new s,a=(e,r)=>{if(t.hasResolverReferences){var n;t.currentSegments.add(e),(t.terminatedFinallyBlocks.has(r)||e.prevSegments.length>0&&e.prevSegments.every(e=>!e.reachable||t.terminatedSegments.has(e)))&&t.terminatedSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)}},u=e=>{t.hasResolverReferences&&t.currentSegments.delete(e)};e.on("onCodePathStart",(a,s)=>{let u=t,p=u&&Ad(a,s)&&u.currentSegments.size>0&&[...u.currentSegments].every(e=>u.terminatedSegments.has(e));t={upper:u,codePath:a,node:s,currentSegments:new i,eventsBySegment:new o,executors:new i,catchClausesBySegment:new o,ignoredLoopEdges:[],terminatedSegments:new l,terminatedFinallyBlocks:new l,hasResolverReferences:u?.hasResolverReferences??!1},p&&t.terminatedSegments.add(a.initialSegment),T6(s,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){if("Identifier"!==o.type)continue;let a=eD(r.getScope(o),o);if(!(!a||T9(a)))for(let r of a.references)t.set(r.identifier,e),n=!0}return n}(s,n,r)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{let r,n=t;if(!n.hasResolverReferences){t=n.upper;return}let a="StaticBlock"===(r=n.node).type?r.body.at(-1):r,i="StaticBlock"===n.node.type?aA(n.node,e):aL(n.node,e),s=Ad(n.codePath,n.node)&&Aa(n.node).catchClause&&a&&aQ(a,e)&&ie(a,e,T2)&&!i,u=a&&(ie(a,e,T2)&&!s||"TryStatement"===a.type&&Ac(a,e)||"StaticBlock"===n.node.type&&!s&&i);if(!function(e,t){if(0===e.executors.size)return;let r=T7(e.codePath),n=new l;for(let a of e.executors){let i=function(e,t,r){let n,a=new o;do for(let o of(n=!1,r)){let r=function(e,t,r){for(let n of t)e=Ar(e,n,r);return e}(Ai(o,a,e),e.eventsBySegment.get(o)??[],t);Ao(r,a.get(o))||(a.set(o,r),n=!0)}while(n);return a}(e,a,r);for(let o of r){let r=Ai(o,i,e);for(let i of e.eventsBySegment.get(o)??[])i.executor===a&&r.resolverCalled&&!n.has(i.node)&&(n.add(i.node),t.report({node:i.node,messageId:T0})),r=Ar(r,i,a)}}}(n,e),n.upper&&Ad(n.codePath,n.node)&&(T7(n.codePath).every(e=>n.terminatedSegments.has(e))||u))for(let e of n.upper.currentSegments)n.upper.terminatedSegments.add(e);t=n.upper}),e.onExit("IfStatement",r=>{let n;if(!t.hasResolverReferences)return;let o=rQ(r.test,e);if(void 0!==o&&ay(r.test,e)&&(n=o.value?r.consequent:r.alternate),n&&function e(t){return"ReturnStatement"===t.type?!t.argument:"BlockStatement"===t.type&&1===t.body.length&&e(t.body[0])}(n))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)}),e.on("onCodePathSegmentStart",a),e.on("onUnreachableCodePathSegmentStart",a),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{!t.hasResolverReferences||(As(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tI(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tF(o))return r;n=o,{parent:o}=o}return!1}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(!t.hasResolverReferences)return;if(ak(r,e)){if(!Au(r,e)&&!function(e,t,r){let n=e,{parent:o}=e,a=!1;for(;o&&!tI(o);){if("IfStatement"===o.type&&(o.consequent===n||o.alternate===n)?a||=!ah(o.test,t):("SequenceExpression"===o.type&&o.expressions[0]!==n||"LogicalExpression"===o.type&&o.right===n||"ConditionalExpression"===o.type&&o.test!==n)&&(a||=!aL(o,t)),"TryStatement"===o.type&&o.handler&&o.block===n)return a||!aA(o.block,t,!0,{isAdditionalStatementDefinitelyNotThrowing:e=>T4(e,r)});n=o,{parent:o}=o}return!1}(r,e,n)){let n=function(e,t){let r=e,{parent:n}=e;for(;n;){if(tI(n))return;if("TryStatement"===n.type&&n.finalizer&&(n.block===r||n.handler===r)&&Ac(n,t))return n;r=n,{parent:n}=n}}(r,e);for(let o of(n&&t.terminatedFinallyBlocks.add(n.finalizer),function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type)return n.right===r&&T6(n.parent,t)&&!n.parent.params.slice(0,2).includes(n);if(!Ap(n,r,t))break;r=n,{parent:n}=n}return!1}(r,e)&&t.terminatedSegments.add(t.codePath.initialSegment),t.currentSegments))t.terminatedSegments.add(o)}return}if("Identifier"===r.type&&(n.has(r)||!Al(r))||"ImportExpression"===r.type&&!Al(r))return;let o=T5(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tI(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:Aa(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(As(r)&&("WhileStatement"===r.type&&r.body===t||"ForStatement"===r.type&&(r.body===t||r.update===t)))return!0;t=r,{parent:r}=r}return!1}(r)||o&&Au(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable||s.terminatedSegments.has(e))continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}}),e.onExit(["ArrayExpression","AssignmentExpression","ConditionalExpression","ImportExpression","LogicalExpression","ObjectExpression","SequenceExpression","TemplateLiteral","YieldExpression"],r=>{if(t.hasResolverReferences&&aL(r,e))for(let e of t.currentSegments)e.reachable&&t.terminatedSegments.add(e)})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[T0]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(!tL(t,{methods:Af,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let a=t.callee.object;if(!tL(a,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||nu(t))return;let i=a.callee.object;if(((e,t)=>{if(e=rP(e),e=rP(ni(e,t)??e),Ay.has(e.type))return!0;let r=Ah(e,t);return!!r&&"string"!=typeof r.value})(i,e)||ow(i,e)||tL(r=rP(r=i),{method:"string",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===r.callee.object.type&&(n=r.callee.object,o=eD(e.sourceCode.getScope(n),n),o?.defs.some(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return!ic(t)&&r.source?.value==="zod"&&("ImportNamespaceSpecifier"===t.type||"ImportSpecifier"===t.type&&("z"===t.imported.name||"z"===t.imported.value))})))return;let{property:s}=t.callee,{property:l}=a.callee,u=s.name,[p]=t.arguments;if(p){let t=((e,t)=>{let r=Ah(e,t);if(!r)return;let{value:n}=r;return null===n||Ag.has(typeof n)?String(n):void 0})(p,e);if(void 0===t||("startsWith"===u?t!==t.trimEnd():t!==t.trimStart()))return}let c="startsWith"===u?"trimStart":"trimEnd";return{node:l,messageId:Am,data:{method:u,replacement:c},fix:e=>e.replaceText(l,c)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[Am]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:AE(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=Ab(n.exported);if("default"===o)return;let a=Ab(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=AE(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:Ax}};e.on("Program:exit",function*(){if(1===new i(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=o(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[Ax]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}},"unicorn/iteration-fallback-style":{create:e=>{e.options[0]===AD?e.on("IfStatement",t=>((e,t)=>{let r=(e=>{let t=(e=>{if(e.alternate)return;let{consequent:t}=e;if("BlockStatement"===t.type){if(1!==t.body.length)return;return t.body[0]}return t})(e);if(!t||"ForInStatement"!==t.type&&"ForOfStatement"!==t.type)return;let r=rP(e.test),n="||";if(!co(r)){if("BinaryExpression"!==r.type||"!="!==r.operator)return;let e=tf(r.left),t=e?r.right:r.left;if(!tf(e?r.left:r.right)||!co(t))return;r=t,n="??"}let o=rP(Aw(t));if(!(ci(r)||ci(o))&&co(o)&&rj(r,o))return{loop:t,source:o,sourceNode:Aw(t),operator:n}})(e);if(!r)return;let n=Ak(r.loop)?"object":"array",o={node:e.test,messageId:AS,data:{type:n}};return"ForOfStatement"===r.loop.type&&((e,t,r)=>{let{sourceCode:n}=r,{source:o}=t,{start:a}=n.getLoc(e);return!(n.getCommentsInside(e).length>0||na(e,r)||!co(o)||o!==t.sourceNode||eZ(o,n)||t.loop.await||"LabeledStatement"===e.parent.type||r8(e,r).length!==a.column)})(e,r,t)&&(o.fix=n=>{let{sourceCode:o}=t,{loop:a,sourceNode:i,operator:s}=r,[l]=o.getRange(a),[u,p]=o.getRange(i),c=o.getText(a),d=o.getText(i),m=Ak(a)?"{}":"[]",f=[c.slice(0,u-l),`${d} ${s} ${m}`,c.slice(p-l)].join(""),g=r8(e,t);return n.replaceText(e,((e,t,r)=>{let[n,...o]=ml(`${t}${e}`).split("\n");return[n,...o.map(e=>""===e?e:`${r}${e}`)].join("\n")})(f,r8(a,t),g))}),o})(t,e)):e.on(["ForInStatement","ForOfStatement"],t=>((e,t)=>{let r=((e,t)=>{let r=rP(e);if("LogicalExpression"!==r.type||"??"!==r.operator&&"||"!==r.operator)return;let n=rP(r.right);if(t(n))return{logicalExpression:r,fallback:n,source:r.left,operator:r.operator}})(Aw(e),Ak(e)?tA:tT);if(!r)return;let{fallback:n}=r,o="ArrayExpression"===n.type?"array":"object",a={node:n,messageId:Av,data:{type:o}};return"ForOfStatement"===e.type&&((e,t,r)=>{let{sourceCode:n}=r,{logicalExpression:o,source:a}=t;return!e.await&&!(n.getCommentsInside(o).length>0||na(e,r)||rR(o.right)||!co(a)||eZ(a,n)||"LabeledStatement"===e.parent.type||"IfStatement"===e.parent.type)})(e,r,t)&&(a.fix=n=>{let{sourceCode:o}=t,{logicalExpression:a,source:i,operator:s}=r,[l]=o.getRange(e),[u,p]=o.getRange(a),c=o.getText(e),d=o.getText(i),m=[c.slice(0,u-l),d,c.slice(p-l)].join(""),f=r8(e,t),g=ml(`${f}${m}`),y="??"===s?`(${d}) != null`:d;return n.replaceText(e,`if (${y}) {
56
+ ${mu(g,1,{indent:`${f} `})}
57
+ ${f}}`)}),a})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce a consistent style for optional loop sources.",recommended:!1},fixable:"code",schema:[{enum:[AC,AD],description:"The preferred style for optional loop sources."}],defaultOptions:[AC],messages:{[Av]:"Prefer an `if` guard over the empty {{type}} fallback.",[AS]:"Prefer an empty {{type}} fallback over the `if` guard."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=S.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v74.0.0/docs/rules/${r}.md`)}},create:iR(t.create)}]})))};module.exports=AI;