@eslint-sukka/eslint-plugin-sukka-full 8.14.2 → 9.0.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.
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:vm"),f=require("url"),g=require("path"),y=require("fs"),h=require("vm"),x=require("worker_threads"),b=require("node:assert/strict"),E=require("node:util/types"),v=require("node:path"),C=require("node:util"),D=require("eslint/use-at-your-own-risk"),S="u">typeof document?document.currentScript:null;function T(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 A(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function w(e){return e?.type==="MemberExpression"}function k(e){return e?.type==="AwaitExpression"}function I(e,t){return!!A(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function j(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 F(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function B(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function R({create:e,defaultOptions:t,meta:r,name:n}){return r.docs&&!r.docs.url&&(r.docs.url=new URL(n,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,s=(n=t,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 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]}))}(e,r)}}),a);return e(r,s)},defaultOptions:t,meta:r,name:n}}function P(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var L=R({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"}},defaultOptions:[],create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!I(t.callee.property,"flatMap")||!(F(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(B(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&B(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 N=new i(["href","pathname","search","hash","origin"]);var $=R({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}}`"}},defaultOptions:[],create:e=>({AssignmentExpression(t){let r=function(e,t){if(I(e,t))return e;for(;w(e);){if(I(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=M(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=M(t.parent);if(N.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function M(e){if(w(e)&&A(e.property))return e.property.name}var O=R({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"}},defaultOptions:[],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=R({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"}},defaultOptions:[],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 q=/^toLocale(?<name>Upper|Lower)Case$/g;var V=R({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()`"}},defaultOptions:[],create:e=>({CallExpression(t){if(t.arguments.length>0||!w(t.callee)||!A(t.callee.property))return;let{property:r}=t.callee,n=q.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),W=R({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"}},defaultOptions:[],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=T(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 _=/\P{ASCII}/u;function z(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 K(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=G(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${J(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(G(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function G(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${J(t)}}`:`\\u${J(t)}`})}function J(e){return e.toString(16).padStart(4,"0").toUpperCase()}R({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:_.source,flags:"u",only:void 0}],create(e,[{pattern:t,flags:r,only:n}]){let o=t?new a(t,r):_;return z(o,(t,r)=>{if(n&&n!==r)return;let a=K(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let X=/[\u061C\u202A-\u202E\u2066-\u2069]/;var Y=R({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}}."}},defaultOptions:[],create:e=>z(X,(t,r)=>{let n=RegExp(X.source,"gu"),o={kind:r,text:G(t.value,n)},a=K(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let H=(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 Q=R({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},defaultOptions:[],create:e=>z(H,t=>{let r=K(t,RegExp(H.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),Z=R({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},defaultOptions:[],create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(ee);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&&B(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=!k(t=r)||T(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${k(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function ee(e){return"ReturnStatement"===e.type&&A(e.argument)}var et=R({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},defaultOptions:[],create:e=>({BlockStatement({parent:t,body:r}){if(!F(t))return;let n=function(e,t){let r=t.find(er);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})=>B(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 er(e){return"ReturnStatement"===e.type&&A(e.argument)}var en=R({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(!F(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})}})}),eo=R({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},defaultOptions:[],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 I(e,"XMLHttpRequest")})(t)||I((r=t).callee,"ActiveXObject")&&j(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return I(e,t)||w(e)&&I(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return I(e,r)&&w(t)&&I(t.property,"load")||w(e)&&I(e.object,r)&&I(e.property,["ajax","get","post","getJSON","getScript"])}(t)||ea(t,"axios")||ea(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function ea(e,t){return I(e.callee,"require")&&j(e.arguments[0],t)}let ei=new i(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var es=R({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},defaultOptions:[],create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!ei.has(t.callee.name)||function(e){if(!I(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||j(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 = ")}]})}})}),el=R({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"}},defaultOptions:[],create(e){P(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;(I(a,"toString")||j(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))})}}}}),eu=R({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`"}},defaultOptions:[],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 ep=new i(["BigInt","Boolean","Number","String","Symbol"]);var ec=R({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"}},defaultOptions:[],create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ep.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)})}})}),ed=R({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"}},defaultOptions:[],create(e){P(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 em={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(em))Object.freeze(em[e]);Object.freeze(em);let ef=new i(["parent","leadingComments","trailingComments"]);function eg(e){return!ef.has(e)&&"_"!==e[0]}function ey(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 eh(e,t){return"Punctuator"===e.type&&e.value===t}function ex(e){return eh(e,"=>")}function eb(e){return eh(e,",")}function eE(e){return eh(e,";")}function ev(e){return eh(e,":")}function eC(e){return eh(e,"(")}function eD(e){return eh(e,")")}function eS(e){return eh(e,"{")}function eT(e){return["Block","Line","Shebang"].includes(e.type)}let eA=e=>!eE(e);function ew(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,ex);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,eC):i.getFirstToken(a,eC)).loc.start}return{start:{...n},end:{...o}}}let ek="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eI=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"])),ej=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)),eF=new i([Object.freeze,Object.preventExtensions,Object.seal]),eB=[[Map,new i(["size"])],[RegExp,new i(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new i(["size"])]];function eR(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=eL(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eL(o,t);if(null==e)return null;r.push(e.value)}}return r}let eP=Object.freeze({ArrayExpression(e,t){let r=eR(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eL(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eL(e.left,t),n=eL(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=eR(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eL(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eN(r,t);if(null!=a){let e=o.value,t=a.value;if(ej.has(e[t]))return{value:e[t](...n)};if(eF.has(e[t]))return{value:n[0]}}}}else{let o=eL(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(ej.has(t))return{value:t(...n)};if(eF.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eL(e.test,t);return null!=r?r.value?eL(e.consequent,t):eL(e.alternate,t):null},ExpressionStatement:(e,t)=>eL(e.expression,t),Identifier(e,t){if(null!=t){let r=ey(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eI.has(r.name)&&r.name in ek)return{value:ek[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=eL(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}(eN(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=eL(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=eL(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eL(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eN(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 eB)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eL(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eL(e.callee,t),n=eR(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(ej.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=eN(n,t),o=eL(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=eL(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eL(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eL(e.tag,t),n=eR(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=eR(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=eL(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)=>eL(e.expression,t),TSSatisfiesExpression:(e,t)=>eL(e.expression,t),TSTypeAssertion:(e,t)=>eL(e.expression,t),TSNonNullExpression:(e,t)=>eL(e.expression,t),TSInstantiationExpression:(e,t)=>eL(e.expression,t)});function eL(e,t){return null!=e&&Object.hasOwnProperty.call(eP,e.type)?eP[e.type](e,t):null}function eN(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eL(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function e$(e,t=null){try{return eL(e,t)}catch(e){return null}}function eM(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=e$(e,t);if(r)try{return String(r.value)}catch{}return null}function eO(e,t){switch(e.type){case"MemberExpression":if(e.computed)return eM(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return eM(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 eU(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=eO(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 eq=Object.freeze(new i(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eV=Object.freeze(new i(["-","+","!","~"]));function eW(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let e_=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(eg)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eW(e)&&this.$visit(e,t,r))return!0}else if(eW(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eq.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&&eV.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 e_.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||em)}function eK(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&&eC(i)&&eD(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,eC);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,eC);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 eG=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,eJ=Function.call.bind(Object.hasOwnProperty),eX=Symbol("read"),eY=Symbol("call"),eH=Symbol("construct"),eQ=Symbol("esm"),eZ={require:{[eY]:!0}};function e0(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class e1{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);e0(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e0(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(eZ)){let r=eM(t.arguments[0]);if(null==r||!eJ(e,r))continue;let n=e[r],o=[r];n[eX]&&(yield{node:t,path:o,type:eX,info:n[eX]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eG.test(t.type)||null==t.source)continue;let r=t.source.value;if(!eJ(e,r))continue;let n=e[r],o=[r];if(n[eX]&&(yield{node:t,path:o,type:eX,info:n[eX]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[eX]&&(yield{node:t,path:o.concat(e),type:eX,info:r[eX]})}else for(let e of t.specifiers){let t=eJ(n,eQ),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(e2),(e.path.length>=2||e.type!==eX)&&(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[eX]&&(yield{node:e,path:t,type:eX,info:r[eX]}),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=eO(o);if(null==e||!eJ(r,e))return;t=t.concat(e);let n=r[e];n[eX]&&(yield{node:o,path:t,type:eX,info:n[eX]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[eY]&&(yield{node:o,path:t,type:eY,info:r[eY]});return}if("NewExpression"===o.type){o.callee===n&&r[eH]&&(yield{node:o,path:t,type:eH,info:r[eH]});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=ey(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=eO(n);if(null==e||!eJ(r,e))continue;let o=t.concat(e),a=r[e];a[eX]&&(yield{node:n,path:o,type:eX,info:a[eX]}),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(!eJ(r,o))return;t=t.concat(o);let a=r[o];a[eX]&&(yield{node:e,path:t,type:eX,info:a[eX]}),yield*this._iterateVariableReferences(ey(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(ey(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!eJ(r,n))return;t=t.concat(n);let o=r[n];o[eX]&&(yield{node:e,path:t,type:eX,info:o[eX]})}}}function e2(e,t){return 1!==t||"default"!==e}e1.READ=eX,e1.CALL=eY,e1.CONSTRUCT=eH,e1.ESM=eQ;let e3=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*e8(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=e3,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!eC(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eD(o))return[n,o]}(n,t);){let[o]=n;if(r===e3&&(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,eC);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,eC);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 e6=new s;function e9(e,t){if(!e||!e6.has(e)){let r=[];for(let[n,o]of e8(e,t))r.unshift(n),r.push(o);e6.set(e,r)}return e6.get(e)}function e5(e,t){let r=e9(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function e4(e,t){let[r,n]=e5(e,t);return t.sourceCode.text.slice(r,n)}function e7(e,t){if(e6.has(e))return e6.get(e).length>0;let r=e8(e,t).next().done;return r&&e6.set(e,[]),!r}function te(e,t){return e?.type==="Literal"&&e.value===t}let tt=e=>e?.type==="Literal"&&"string"==typeof e.value,tr=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),tn=e=>tt(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,to=e=>"Literal"===e.type&&"number"==typeof e.value,ta=e=>"Literal"===e.type&&!!e.regex,ti=e=>e?.type==="Literal"&&"null"===e.raw,ts=e=>"Literal"===e.type&&!!e.bigint;function tl(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 tu={},tp=["CallExpression"],tc=["NewExpression"],td=["CallExpression","NewExpression"];function tm(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??tu;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 tl(e.callee,n,o)}let tf=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tm(e,t,tc)},tg=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function ty(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>ty(e,t)):"EmptyStatement"===r||!!t?.(e)}let th=e=>"ArrayExpression"===e.type&&0===e.elements.length,tx=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tb(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tE=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tv(e){return tE.includes(e.type)}let tC=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tD(e){return tC.includes(e.type)}let tS={};function tT(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??tS;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!tl(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&tl(e.object,o,a)}let tA={};function tw(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),tm(e,{argumentsLength:(t??=tA).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},tp)&&tT(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tk(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&to(e.argument)&&1===e.argument.value}function tI(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 tj=e=>tm(e,{name:"require",argumentsLength:1,optional:!1},tp)&&tt(e.arguments[0]);function tF(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 tB(e,t){return t.some(t=>tF(e,t))}function tR(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tB(e.parent.tag,t))}function tP(e){return e?.type==="Identifier"&&"undefined"===e.name}let tL=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tT(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tT(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&th(a)||"Object"===r&&tx(a)})(e,{...t,object:"Array"}),tN=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),t$=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tM=e=>t$(e.parent)&&e.parent.argument===e,tO=(e,t)=>tU(e.parent,t)&&e.parent.arguments[0]===e,tU=(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=ey(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tq(e,t){return!!(t$(e)||tM(e)||tU(e,t)||tO(e,t))||!!tN(e.parent)&&tq(e.parent,t)}function tV(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)||!!tN(e.parent)&&tV(e.parent)}function tW(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 t_(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tv(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&&t_(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 tK(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 tG=["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"],tJ=["globalThis","Infinity","NaN","undefined"];function tX({includeGlobalProperties:e=!1}={}){return new i([...tG,...e?tJ:[]])}let tY=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,tH=`(?!(?:${[...tX({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,tQ=new o,tZ=new m.Script("returnValue = functionToRun()"),t0=Symbol.for("worker"),t1=Symbol.for("events");class t2{constructor(){Object.defineProperty(this,t1,{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[t1].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[t1].get(e);r||this[t1].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[t1].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function t3(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var t8="function"==typeof Worker?Worker:x.isMainThread?t9():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=x.workerData;if(!e)return t9();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}x.parentPort.on("message",e=>{let t=new t3("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),x.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends t2{postMessage(e,t){x.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)?t4(n).data:y.readFileSync(new f.URL(g.posix.normalize(n),f.pathToFileURL(e)),"utf-8"),h.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:f.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."),t5(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?t5(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let t6=f.pathToFileURL(process.cwd()+"/");function t9(){class e extends t2{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:f.fileURLToPath(new f.URL(e,t6));let a=new x.Worker(f.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:S&&"SCRIPT"===S.tagName.toUpperCase()&&S.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,t0,{value:a}),a.on("message",e=>{let t=new t3("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new t3("close"))})}postMessage(e,t){this[t0].postMessage(e,t)}terminate(){this[t0].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function t5(e,t){let{data:r}=t4(e);return h.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function t4(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 t7 extends Error{constructor(e){super(e),this.name="TimeoutError"}}class re extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let rt=e=>void 0===globalThis.DOMException?new re(e):new DOMException(e),rr=e=>{let t=void 0===e.reason?rt("This operation was aborted."):e.reason;return t instanceof Error?t:rt(t)};function rn(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&&(r.count===1/0||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(rr(e)),n=()=>{u(rr(e))},e.addEventListener("abort",n,{once:!0})}if(o===1/0)return void e.then(l,u);let p=new t7;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 ro=!!globalThis.process?.versions?.node;function ra(e){let t,r;if(ro){let t;r=new t8((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new t8(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function ri(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 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=`
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 t_(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=rn(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}=ra(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=ra(t),i=rn(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 rs={};function rl(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=m.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),tZ.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:rs})()}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=tQ.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?tH:""}${tY.source}`;n=RegExp(e?`^${o}$`:o,"u"),tQ.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function ru(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}ri((e,t,r)=>new a(e,t).test(r)),ri((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=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=`
12
12
  const nothing = Symbol('nothing');
13
13
  let iterator = nothing;
14
14
 
@@ -24,34 +24,36 @@ Please open an issue at ${i}.`)}function t_(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}=ra(r),a=rn(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([rn(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 rp=e=>[e,...e.childScopes.flatMap(e=>rp(e))],rc=e=>[...new i(rp(e).flatMap(({references:e})=>e))],rd=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"]),rm=e=>"string"==typeof e&&rl(e)&&!rd.has(e),rf=(e,t)=>t.every(t=>!(ru(e,t)||rc(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rg=()=>!0;function ry(e,t,r=rg){if(rm(e)||rm(e+="_")){for(;!rf(e,t)||!r(e,t);)e+="_";return e}}function rh(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return eC(n)&&eD(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rx(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,eC),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eb(a)?a:void 0}}function rb(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rx(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rE(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rE(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=e$(t);if(!r)return;return String(r.value)}}function rv(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rv(e.expression):e}function rC(e,t){if(e=rv(e),t=rv(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=rE(e);if(void 0!==r)return rC(e.object,t.object)&&r===rE(t);return e.computed===t.computed&&rC(e.object,t.object)&&rC(e.property,t.property)}default:return!1}}let rD=e=>null===e||"object"!=typeof e&&"function"!=typeof e,rS=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=e$(e,r.getScope(e));if(n&&rD(n.value))return{value:n.value}},rT=(e,t,r)=>{let n=rS(e,r),o=rS(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&&rC(e,t)},rA=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>rT(e,o,t))&&n.push(o),r.push(o));return n};function rw(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 rk=new i(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rI=e=>rk.has(e?.type);function rj(e){for(;rI(e);)e=e.expression;return e}function rF(e){return rl(e,{checkReserved:!1})}function rB(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let rR=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),rP=([e,t],[r,n])=>e>=r&&t<=n;function rL(e,t,r=[]){let{sourceCode:n}=e,o=rR(e,t),a=r.map(t=>rR(e,t));return rB(e).some(e=>{let t=n.getRange(e);return rP(t,o)&&a.every(e=>!rP(t,e))})}function rN(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 r$=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},rM=new i(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rO=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||rM.has(e.type),rU=e=>rO(e)||"BlockStatement"===e.type&&e.body.some(e=>rO(e));function rq(e,t){if("Identifier"!==e.type)return;let r=ey(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 rV(e,t){let{sourceCode:r}=t,[,n]=e5(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let rW=new i(["depth","height","width"]);function r_(e){return tT(e,{properties:["length","size"],optional:!1})}function rz(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rK=["Program","StyleSheet","Document","root"];function rG(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 rJ=({identifiers:e,references:t})=>[...new i([...e,...t.map(({identifier:e})=>e)])];function rX(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(rX(e,t))return!0}else if(rX(n,t))return!0}return!1}function rY(e){let t;return(e=rj(e),e?.type==="ChainExpression")?rY(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?rY(e.object):rY(e.callee))))}let rH=(e,t)=>{let{references:r=[]}=ey(e,t)||{};return r};function rQ(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||rH(t,"arguments").some(({from:e})=>e===t))||!!(n&&rH(t,n).length>0))}let rZ=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],r0=new i(["any","error","unknown"]),r1=new i(["null","undefined"]),r2=e=>e.getSymbol()??e.aliasSymbol,r3=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function r8(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let r6="target",r9="non-target",r5="nullish",r4="unknown",r7=new i(["ClassDeclaration","ClassExpression"]),ne=new i(["FunctionDeclaration","FunctionExpression"]),nt=new i(["ClassName","ImportBinding","TSEnumName","Type"]),nr=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),nn=new i(["TSNullKeyword","TSUndefinedKeyword"]),no=e=>e===r5?r9:e,na=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==r5):e.map(no)).length?r9:(t.treatMixedUnionAsTarget?e.includes(r6):e.every(e=>e===r6))?r6:(t.treatMixedUnionAsNonTarget?e.includes(r9):e.every(e=>e===r9))?r9:r4,ni=e=>(e=e.map(no)).includes(r6)?r6:e.every(e=>e===r9)?r9:r4,ns=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nt.has(e.type));if(r)return r;t=t.upper}},nl=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=nl(e.left);return t?`${t}.${e.right.name}`:void 0}},nu=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?r6:t.nonTargetTypeNames?.has(e)?r9:r4},np=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?r6:r9:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||nu(o,r)!==r4||nu(a,r)!==r4?r9:r4};function nc(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nc(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?nc(e.typeAnnotation,t,r,n):r4;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=nl(t.typeName);if(!s)return r4;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return r4;let n=e.typeName.right.name,o=ns(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?r4:np({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==r4)return l;if(!n.preferTypeReferenceDefinitions){let e=nu(s,n);if(e!==r4)return e}if(o.has(s))return r4;o.add(s);let u=ns(s,r);if(!u)return o.delete(s),nu(s,n);let p=r4,c=((e,t)=>{if("ImportBinding"!==e.type)return r4;if("ImportDefaultSpecifier"===e.node.type)return nu(e.node.local.name,t)===r4?r4:r9;let r=e.node.imported?.name??e.node.imported?.value;return r?np({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):r4})(u,n);return c!==r4?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=nc(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=nc(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?r9:ni(a.extends.map(t=>nl(t.expression)?e({typeName:t.expression},r,n,o):r4))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?r4:nm(i.superClass,r,n,o):r9),o.delete(s),p}(e,t,r,n);case"TSUnionType":return na(e.types.map(e=>nc(e,t,r,n)),r);case"TSIntersectionType":return ni(e.types.map(e=>nc(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return r6;if(nn.has(e?.type))return r5;return nr.has(e?.type)?r9:r4}}let nd=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?nm(e.superClass,t,r,n):r9;function nm(e,t,r,n=new i){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return nu(o,r);if(n.has(o))return r4;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=r4;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=nm(i.node.init,t,r,n):i?.type==="ClassName"&&(s=nd(i.node,t,r,n)),n.delete(o),i?s:nu(o,r)}return r7.has(e.type)?nd(e,t,r,n):r4}let nf=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return nc(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function ng(e,t,r,n=new i){if(!e)return r4;if("TSSatisfiesExpression"===e.type)return ng(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=nc(e.typeAnnotation,o,r);if(a!==r4)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=ey(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return r4;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=nc(a.name?.typeAnnotation,i,r),l=r4;return s!==r4?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=ng(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(r7.has(n.type))return nd(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return r9;if(ne.has(n.type)){let e=nf(n,t,r);if(e!==r4)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return r9;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return r9;continue}break}}return r4})(e,t,r):r4;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 r9;if(r7.has(n.type))return n.superClass?nm(n.superClass,t.sourceCode.getScope(n),r):r9}return r4})(e,t,r):r4;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,nm(a,t.sourceCode.getScope(a),r,void 0)):r4;case"TSAsExpression":case"TSTypeAssertion":{let a=nc(e.typeAnnotation,o,r);return a===r4?ng(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return ng(e.expression,t,r,n);case"SequenceExpression":return ng(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return na([ng(e.consequent,t,r,n),ng(e.alternate,t,r,n)],r);default:return r4}})(e,t,r,n);if(s!==r4)return s;if("Identifier"!==e.type){let t,n=(t=e$(e,o))?r.getStaticType?.(t.value,e)??r4:r4;if(n!==r4)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tf(e,{name:t}))||r.targetCallNames?.some(t=>tm(e,{name:t},tp)))return r6;let l=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return r4;try{let{program:t}=n;return function e(t,r,n,o){if(r0.has(t.intrinsicName))return r4;if(r1.has(t.intrinsicName))return r5;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):r4}if(t.isUnion())return na(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return ni(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return r6;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&r8(t,r).some(t=>e(t,r,n,o)===r6))return r6;if(t.intrinsicName)return r9;let i=r2(t);if(!i)return r4;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?r6:r9}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return r4}})(e,t,r);return l!==r4?l:r.isNonTargetNode?.(e,t)?r9:r4}let ny=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>no(ng(t,r,{...e,...n})),isTarget:(t,r,n)=>ng(t,r,{...e,...n})===r6,isKnownNonTarget:(t,r,n)=>no(ng(t,r,{...e,...n}))===r9}),nh=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>ny({...n,targetTypeNames:new i([e]),typeReferenceAliases:new o(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),nx=new i(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),nb=new i([...rZ,"Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),{isTarget:nE,isKnownNonTarget:nv}=ny({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new i(["Array","ReadonlyArray"]),nonTargetTypeNames:nb,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||nx.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)?r6:"Identifier"===t.type||"MemberExpression"===t.type?r4:r9}),nC=new i(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function nD(e,t){return!nC.has(e.type)&&nv(e,t)}let nS=new i(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),nT=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",...nS]),{isTarget:nA,isKnownNonTarget:nw}=ny({preferTypeReferenceDefinitions:!0,targetTypeImports:new o([["react",nS]]),targetTypeNamespaceImports:new o([["react",nS]]),targetTypeNames:nT}),{isTarget:nk}=nh({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?r6:r4}),{isTarget:nI}=nh({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?r6:r4}),nj=new i(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),nF=new i(["KeyboardEvent","React.KeyboardEvent"]),nB=new i(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:nR}=ny({targetTypeNames:nj,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?r6:r4}}),{isKnownNonTarget:nP}=ny({targetTypeNames:nF,nonTargetTypeNames:nB}),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,nN=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,n$=(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),nM=new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),nO=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"]),nU=new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nq=new i(["parseFloat","parseInt"]),nV=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&to(e.literal),nW=new i(["-","*","/","%","**","<<",">>","|","^","&"]);function n_(e,t){let r;if(to(e)||n$(e,"Math",nM)||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"Math",nO)||nN(e,"Number")||n$(e,"Number",nU)||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"Number",nq)||nN(e,"parseInt")||nN(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&&n_(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&n_(e.left,t)&&n_(e.right,t)||">>>"===r||nW.has(r)&&(n_(e.left,t)||n_(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&n_(e.argument,t))return!0;break}case"UpdateExpression":if(n_(e.argument,t))return!0;break;case"ConditionalExpression":{let r=n_(e.consequent,t),n=n_(e.alternate,t);if(r&&n)return!0;let o=e$(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(n_(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=ey(t,e))&&r.defs.some(e=>nV(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(nV(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(n_(e.expression,t))return!0}return"number"==typeof e$(e,t)?.value}ny({targetTypeNames:new i,targetCallNames:["Number"],isTargetTypeAnnotation:nV,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?r6:r4});let nz=new i([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),nK=new i(["boolean","true","false"]),nG=new i(["isFinite","isNaN"]),nJ=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"])]]),nX=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"])]]),nY=new o([["regexp",new i(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function nH(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):nK.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function nQ(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>n0(e.returnType,t,r,n))}function nZ({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=ru(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 n0(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n0(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return nZ({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&n0(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>n0(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function n1(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n1(e.typeAnnotation,t,r,n);case"TSFunctionType":return n0(e.returnType,t,r,n);case"TSTypeLiteral":return nQ(e.members,t,r,n);case"TSTypeReference":return nZ({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&n1(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&nQ(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>n1(e,t,r,n));default:return!1}}function n2(e,t,r=new i){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!n0(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?n6(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&n6(e.body,t,r))}function n3(e,t,r=new i){if(e?.type!=="Identifier")return!1;let n=ey(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=>n2(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(n1(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&&n2(a,t,r)}}return r.delete(n),o}function n8(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=ey(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=n8(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return n8(e.expression,t,r)}}function n6(e,t,r=new i){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!n0(e.typeAnnotation,t,n)||"boolean"==typeof e$(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&&n0(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&n6(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)&&n6(e.right,t,r)}return r.delete(e),a}(ey(t.sourceCode.getScope(e),e),t,r)||nH(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return n6(e.left,t,r)&&n6(e.right,t,r);case"BinaryExpression":return nz.has(e.operator);case"ConditionalExpression":return n6(e.consequent,t,r)&&n6(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),n0(e.typeAnnotation,t,n)||n6(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=nJ.get(e.callee.object.name),n=eO(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=nX.get(n8(e.callee.object,t)),n=eO(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?nH(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||nG.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||n3(e.callee,t,r)||nH(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=nY.get(n8(e.object,t)),n=eO(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return n6(e.argument??e.expression,t,r);case"SequenceExpression":return n6(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&n6(e.right,t,r)}return}}(e,t,r)??nH(e,t))}let n9=new i(["asIntN","asUintN"]),n5=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n5(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return ts(e.literal);default:return!1}},{isTarget:n4}=ny({targetTypeNames:new i,targetCallNames:["BigInt"],isTargetNode:e=>ts(e)||nN(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"BigInt",n9),isTargetTypeAnnotation:n5,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?r6:r4}),n7=new i(["fromCharCode","fromCodePoint"]),oe=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oe(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return tt(e.literal);default:return!1}},{isTarget:ot,isKnownNonTarget:or}=ny({targetTypeNames:new i,targetCallNames:["String"],isTargetNode:(e,t)=>{if(tt(e)||nN(e,"String")||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"String",n7))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(on(e.left,t)||on(e.right,t));case"AssignmentExpression":if("="===e.operator)return on(e.right,t);return"+="===e.operator&&(on(e.left,t)||on(e.right,t));default:return!1}},isTargetTypeAnnotation:oe,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?r6:r4});function on(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&oe(e.typeAnnotation)||ot(e,t))||"string"==typeof e$(e,t.sourceCode.getScope(e))?.value)}let oo=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),oa=e=>oo.has(e.type)||tP(e),oi=new i(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),os=new i(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),ol=e=>oi.has(e.type)||os.has(e.type)||tP(e)||tm(e,void 0,tp)&&!tw(e,{method:"bind",optionalCall:!1,optionalMember:!1}),ou=(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&&ou(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&ou(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&&ou(e,t))return!0;continue}if(ou(r,t))return!0}}return!1};function op(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),!r0.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),om=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function of(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!ey(t.sourceCode.getScope(e),e))}let og=(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],oy=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&og(n,o,t)&&n===e},oh=new i(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function ox(e){return oh.has(e.type)}let ob=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,oE=e=>tb(e.parent),ov=new i(["String","Null","Boolean","Numeric","RegularExpression"]),oC=new i(["[","(","/","`","+","-","*",",","."]);function oD(e,t,r){if(""===r||r&&!oC.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!!ov.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let oS=e=>"type"===e.importKind||"type"===e.parent.importKind,oT=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],oA=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},ow=new i(["Map","ReadonlyMap"]),ok=new i(["Set","ReadonlySet"]),oI=ow.union(ok),oj=e=>new i([e]),oF=e=>oI.has(e)?e:void 0,oB=new i(["ClassName","ImportBinding","TSEnumName","Type"]),oR=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>oB.has(e.type)))return!0;n=n.upper}return!1},oP=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},oL=(e,t)=>{if(r0.has(e.intrinsicName))return;if(e.isUnion())return oP(e.types.map(e=>oL(e,t)));let r=r2(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&oF(n);return o&&oj(o)},oN=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oN(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?oN(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||oR(e.typeName.name,e,t))return;let r=oF(e.typeName.name);return r&&oj(r)}case"TSUnionType":return oP(e.types.map(e=>oN(e,t)))}},o$=(e,t,r=new i)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=oL(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(oR(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tf(e,{names:["Map","Set"]})&&of(e.callee,t))return oj(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=ey(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=oN(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=o$(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return oN(e.typeAnnotation,t)??o$(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return o$(e.expression,t,r);case"ConditionalExpression":return oP([o$(e.consequent,t,r),o$(e.alternate,t,r)])}})(e,t,r),oM=(e,t)=>{let r=o$(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(ow.has(e)){n=!0;continue}if(ok.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function oO(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)oO(r,t)}class oU extends Error{name="FixAbortError"}let oq={abort(){throw new oU("Fix aborted.")}};function oV(e){return t=>{let r=e(t,oq),n=[];try{return oO(r,e=>{n.push(e)}),n}catch(e){if(e instanceof oU)return;throw e}}}class oW{#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=oV(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:oV(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&oO(t,r)}}}(this.#e,r);return e}}let o_=new i;function oz(e){return o_.has(e)?e:t=>{let r=new oW(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return b.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function oK(e,t){var r;let{visitScriptBlock:n=!0}={},o=oz(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},o_.add(r),r}let oG={"??":4,"||":4,"&&":5},oJ={"|":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 oX(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return oG[e.operator];case"BinaryExpression":return oJ[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 oY(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let oH=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function oQ(e){if(to(e=rj(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=oQ(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function oZ(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!rh(e,t);case"Literal":let r;return!!(to(e)&&(r=e.raw,oH.test(r)));default:return!0}}let o0=new i(["!","typeof","void","delete","~","+","-"]),o1=new i(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function o2(e,t){if(!o0.has(t))throw Error("Unexpected operator");return 16>oX(e)||o1.has(e.type)}function o3(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 o8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o6={exports:{}},o9=o6.exports,o5=o8(function(){return u?o6.exports:(u=1,o6.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}(),o6.exports)}());function o4(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 o7(e,t){let r=[],n=new s,o=new s,a=new l;return e.on("onCodePathStart",()=>{r.push(new i)}),e.on("onCodePathEnd",()=>{r.pop()}),e.on("onCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable)&&a.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{n.set(e,new i(r.at(-1)))}),e.onExit("IfStatement",e=>{let i=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let s=n.get(r),l=s&&[...i].every(e=>e.prevSegments.every(e=>!s.has(e)))||t?.(r);o.set(r,a.has(e)&&!!l)}}),e=>!!(e&&o.get(e))}function ae(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 at=(e,t)=>ae(e,t,-1),ar=(e,t)=>ae(e,t,1),an=e=>e.charAt(0).toUpperCase()+e.slice(1),ao=e=>e.charAt(0).toLowerCase()+e.slice(1),aa="too-deep",ai="should-parenthesized",as="prefer-event-target",al=new i(["@angular/core","eventemitter3"]),au=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 ap(e){let t;return!!e&&(tj(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(tt(t)&&al.has(t.value)))}let ac={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"},ad="prefer-keyboard-event-key",am="prefer-keyboard-event-key/suggestion",af=new i(["keyCode","charCode","which"]),ag=new i(["onKeyDown","onKeyPress","onKeyUp"]),ay=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)},ah=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tw(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&&ag.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))ay(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nP(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},ax=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,ab=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tv(n)&&r.push(...ah(e,n));return r},aE=(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)&&to(a)))return;let i=Object.hasOwn(ac,t=a.value)?ac[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:ad,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tK(r.key))];return t?n.fix=o:n.suggest=[{messageId:am,data:{key:r.key},fix:o}],n},av=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),aC=(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)},aD="error",aS="suggestion";function*aT(e,t,r){for(let n of e9(e,r))yield t.remove(n)}function aA(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=eb(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function aw(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=e9(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);eb(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&&r$(r,n)){let{sourceCode:o}=r,a=e9(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 ak(e,t,r,n){return e.replaceTextRange(e5(t,n),r)}function aI(e,t,r,n){let o=e4(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!oZ(r,n):ox(r))||e7(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),oD(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*aj(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);eE(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function aF(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*aB(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield aF(n,t,r),rh(e,t)||(yield r.insertTextAfter(e,"()")),op(n,e.callee,t)||e7(e,t)||(yield aj(r,e.parent,t))}let aR=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*aP(e,t,r){let{sourceCode:n}=r,o=e5(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&aR(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&aR(i)&&(yield e.insertTextBefore(i," "))}function*aL(e,t,r){var n;yield aP(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!e7(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 aN(e,t,r,n){let[,o]=e5(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let a$=(e,t,r)=>aN(e,t,r,"");function*aM(e,t,r){let n=t.callee;yield a$(e,n,r);let[,o]=e5(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function aO(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);eE(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 aU(e,t,r,n){if(ob(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&ob(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(oy(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&&og(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 aq=(e,t,r,n)=>rJ(e).map(e=>aU(e,t,r,n)),aV=(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*aW(e,t,r,n,o){for(let t of e9(e,o?{sourceCode:o}:n))yield aW(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 a_="require-array-join-separator",az="no-thenable-object",aK="no-thenable-export",aG="no-thenable-class",aJ=(e,t)=>e$(e,t.sourceCode.getScope(e))?.value==="then",aX=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===eO(e,t.sourceCode.getScope(e)):"then"===r.name},aY=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&aX(r,t)&&(yield r.key)},messageId:az},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){aX(e,t)&&(yield e.key)},messageId:aG},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&aX(e,t)&&(yield e.property)},messageId:az},{selector:"CallExpression",*getNodes(e,t){if(!tw(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})||"SpreadElement"===e.arguments[0].type)return;let[,r]=e.arguments;aJ(r,t)&&(yield r)},messageId:az},{selector:"CallExpression",*getNodes(e,t){if(tw(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;aJ(e,t)&&(yield e)}},messageId:az},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:aK},{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:aK},{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:aK}],aH="no-invalid-remove-event-listener",aQ="consistent-function-scoping",aZ=(e,t)=>e&&t&&(e===t||e.block===t.block),a0=(e,t)=>e.some(e=>aZ(e,t)),a1=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),a2=new i(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),a3=e=>e?.type==="BlockStatement"&&a2.has(e.parent.type)&&e.parent.body===e,a8=new i(["FunctionExpression","ArrowFunctionExpression"]),a6={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tE,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&&ou(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tE.includes(t.type)&&tB(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),a3(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&&tB(l.block.parent.callee,a1)||l&&(a=s,a8.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||rc(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(a0(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&a0(u,t.scope)})||e.defs.some(e=>a0(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||aZ(i,r))&&a0(u,r.upper)}))}(e,n,r))return{node:e,loc:ew(e,r),messageId:aQ,data:{functionNameWithKind:eU(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:{[aQ]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},a9="error",a5="error-unknown",a4="suggestion";function a7(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield aB(e,t,n)}}let ie="no-console-spaces",it=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),ir=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),io="no-empty-file",ia={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:io}}if(r.body.some(e=>!ty(e,tg)))return;let{sourceCode:n}=e,o=rB(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:io}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=rB(e);if(!t||!(n.length>0))return{node:r,messageId:io}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=rB(e);if(!t||!(n.length>0))return{node:r,messageId:io}}),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:io}}))},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:{[io]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},ii="no-useless-fallback-in-spread";function is(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 il(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let iu="zero-fraction",ip="dangling-dot",ic="error",id="suggestion",im=Symbol.for("default"),ig=Symbol("NAMESPACE_SPECIFIER_NAME"),iy=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},ih=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*ix(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?eb:eS),[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);eb(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function ib(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 iE={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=>{tt(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:oS(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:im,text:"default",...n};case"ImportSpecifier":return{name:iy(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:ig,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:im,text:"default",isTypeExport:ih(r)};case"ExportSpecifier":return{node:r,name:iy(r.exported),text:t.getText(r.exported),isTypeExport:ih(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!==ig||o.name!==im)&&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:ic,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===ig)yield n.insertTextAfter(o,`
28
- export ${l?"type ":""}* as ${r.text} ${ib(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,eS);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
- export {${s}} ${ib(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield ix(t.node,n,e)),yield ix(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:id,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:{[ic]:"Use `export…from` to re-export `{{exported}}`.",[id]:"Switch to `export…from`."},languages:["js/js"]}},iv="prefer-native-coercion-functions",iC=new i(["String","Number","BigInt","Boolean","Symbol"]),iD=new i(["every","filter","find","findLast","findIndex","findLastIndex","some"]),iS=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&iC.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,iT=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},iA=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},iA(e[r],n)):e[r]=n}};class iw{static READ=e1.READ;static CALL=e1.CALL;static CONSTRUCT=e1.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=e1.READ,context:n,filter:o,handle:a}){for(let e of t)iA(this.#n,iT(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 e1(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 ik="no-document-cookie",iI=new iw({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:ik})}),ij=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],iF=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",...ij("AnimationStart"),...ij("AnimationEnd"),...ij("AnimationIteration"),...ij("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"]),iB="prefer-add-event-listener",iR={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=>{tj(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(!iF.has(u))return;let p="addEventListener",c="";if(tP(i)||ti(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||ol(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);e7(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);e7(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:iB,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:{[iB]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},iP=new i(["false","true"]),iL=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(om(e.left,t)||om(e.right,t)),iN=({type:e,name:t},r)=>"Identifier"===e&&t===r;function i$({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(!tw(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&iL(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&&iL(p.body.body[0].argument,p.params[0]))||nD(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(iN(f,y))l=g,u=f;else{if(!iN(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||ey(h,m).references.some(({identifier:e})=>e!==u)||rQ(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);e7(l,n)&&!e7(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(!tw(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(om(r,t))return r;if("CallExpression"===r.type&&!r.optional&&iN(r.callee,"Boolean")&&1===r.arguments.length&&om(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=>iP.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||ey(p,a).references.some(({identifier:e})=>e!==u)||rQ(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 iM=i$({method:"findIndex",replacement:"indexOf"}),iO=i$({method:"findLastIndex",replacement:"lastIndexOf"}),iU={create(e){iM.listen(e),iO.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:{...iM.messages,...iO.messages},languages:["js/js"]}},iq="error",iV="prefer-date",iW="prefer-date-now-over-methods",i_="prefer-date-now-over-number-data-object",iz=e=>tf(e,{name:"Date",argumentsLength:0}),iK=(e,t,r)=>({node:e,messageId:iV,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield aP(t,e,r))},...t}),iG="prefer-dataset",iJ="prefer-attributes",iX=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,iY=e=>tT(e,{property:"dataset"}),iH=e=>e.computed||"Identifier"!==e.property.type?e.computed&&tt(e.property)?e.property.value:void 0:e.property.name,iQ=new i(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),iZ=/[\s\u0000-\u001F"'/<=>]/,i0=e=>iQ.has(e)||e.includes("-")||iZ.test(e);function i1(e,t){let r=e4(e,t);return!e7(e,t.sourceCode)&&oZ(e,t)?`(${r})`:r}let i2={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(i0(n.value)||nR(o.object,e))return;let a=i1(o.object,e),i=o.optional?"?.":".",s=tK(iX(n.value),n.raw.charAt(0)),l=rL(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return oD(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:iJ,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&tt(e.left)&&iY(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tw(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&iY(e.arguments[0])&&tt(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tw(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&iY(e.callee.object)&&tt(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&iY(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||nR(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:iJ,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=iH(n);if(void 0===o||i0(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=>ey(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)&&!rL(t,o)&&i.every(e=>!rL(t,e))))return;let s=i1(n.object,t);return function*(e){for(let r of(yield aO(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tK(iX(iH(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?!tt(e.key)||i0(e.key.value):i0(e.key.name))))return;let a=t.parent,i=i1(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!rL(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=rw(a,e),n=o.map(e=>{let t=tK(iX(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:iJ,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!iY(o)||nR(o.object,e))return;let a=iH(r);if(void 0===a||i0(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=i1(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tK(iX(a),c);return s&&oE(i)&&!rL(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${e4(i.right,e)})`):l&&tb(i.parent)&&!rL(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return oD(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||rL(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:iJ,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tw(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tw(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&tt(t.arguments[0]))||nR(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:iG,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&rY(e.callee)||"setAttribute"===r&&!oE(e)||"removeAttribute"===r&&!tb(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!rL(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=`${i1(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=rF(a)?`.${a}`:`[${tK(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${e4(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tK(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:{[iG]:"Prefer `.dataset` over `{{method}}(…)`.",[iJ]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},i3="prefer-modern-math-apis",i8=(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,i6=(e,t)=>"CallExpression"===e.type&&!e.optional&&i8(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function i9({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(i6(n.left,"log")&&i8(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):i6(n.right,"log")&&i8(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:i3,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${e4(s,o)})`)}}}function i5({constantName:e,replacementMethod:t}){let r={messageId:i3,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&i6(n.left,"log")&&i8(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${e4(a,o)})`)}}}let i4=[i9({constantName:"LOG10E",replacementMethod:"log10"}),i9({constantName:"LOG2E",replacementMethod:"log2"}),i5({constantName:"LN10",replacementMethod:"log10"}),i5({constantName:"LN2",replacementMethod:"log2"})],i7=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>i7(e)):[e],se="number-literal-case",st=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},sr={create:oK(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(to(t)?o=st(r,n):ts(t)&&(o=st(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:se,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:{[se]:"Invalid number literal casing."},languages:["js/js"]}},sn="error",so="suggestion",sa={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},si=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function ss(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=si(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:sn,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 aP(e,a,t)},s;let l=e=>aU(r,`Number.${i}`,t,e);return sa[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&&n_(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:so,fix:l}],s}let sl={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new iw({objects:Object.keys(sa).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:ss,filter(t){let{node:r,path:n}=t,[o]=n;return!nL(r)&&!("Infinity"===o&&(e=>{if(!si(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&&e$(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:{[sn]:"Prefer `Number.{{property}}` over `{{description}}`.",[so]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},su="prefer-reflect-apply",sp=(e,t)=>(ti(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),sc=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,sd="prefer-set-size";var sm={exports:{}},sf=o8(function(){var e,t,r,n;return p?sm.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(C());y("|");)r.push(C());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function C(){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 D("(?=","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=D("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=S("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return D("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||W("Invalid flags for modifiers group"):a||W("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))&&W("flags cannot be duplicated for modifiers group"),y(":")||W("Invalid flags for modifiers group"),(u=S("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,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 D(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return S(o,a)}function S(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=U();)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=q())r=n;else{if(n=N())return n;W("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=U())return c(r,n,o,H);W("Invalid range end",h())}return r}function U(){if(y("\\")){var e,t=H;if(e=V())return e;W("Invalid escape","\\"+h(),t)}return q()}function q(){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}},sm.exports?sm.exports=n:window.regjsparser=n,sm.exports)}());let sg=String.raw`\$&`,sy=new i(String.raw`\^$.*+?()[]{}|/-`),{parse:sh}=sf,sx="method",sb="pattern",sE="split-join",sv=new i(["i","y"]),sC=new i(["anchor","reference"]),sD=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function sS(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`:sD(r);if("null"===t||"octal"===t)return sD(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function sT(e){return"value"===e.type?sS(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?sA(e.body):void 0:sS(e.body[0])}function sA(e){let t=[];for(let r of e){let e=sT(r);if(void 0===e)return;t.push(e)}return t.join("")}let sw=e=>{let{pattern:t,flags:r}=e.regex;try{return sh(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},sk=e=>{let t=0;for(let r of e)t+=sI(r);return t};function sI(e){return sC.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?sk(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>sI(e))):"quantifier"===e.type?e.min*sk(e.body):"group"===e.type&&"ignore"===e.behavior?sk(e.body):0}let sj=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>sj(e)),sF=e=>to(e)&&Number.isSafeInteger(e.value)&&e.value>=0,sB=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rC(e.left,t)&&te(e.right,1)||te(e.left,1)&&rC(e.right,t)))return t},sR=e=>to(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-sR(e.argument):void 0,sP=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,sL="prefer-string-trim-start-end",sN="no-unreadable-iife",s$="suggestion",sM="throw-new-error",sO=/^(?:[A-Z][\da-z]*)*Error$/,sU="escape-uppercase",sq="escape-lowercase",sV=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,sW=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,s_=({node:e,original:t,regex:r=sV,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?sq:sU,fix:t=>o?o(t,a):t.replaceText(e,a)}},sz="prefer-unicode-code-point-escapes",sK="prefer-unicode-code-point-escapes/add-unicode-flag",sG=String.raw`\u{`,sJ=/^[\da-f]$/iv,sX=/^[0-7]$/v,sY=/^[A-Za-z]$/v;function sH(e){return sX.test(e)}function sQ(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function sZ(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function s0(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!sJ.test(e))))return Number.parseInt(n,16)}function s1(e){return e>=55296&&e<=56319}function s2(e){return e>=56320&&e<=57343}function s3(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function s8(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)&&!sZ(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!sZ(e,i)){o--,n+=s;continue}if("\\"!==s||!sQ(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=s0(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:s3(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=s0(e,t+2,4);if(void 0===o||!n&&(s1(o)||s2(o)))return;let a=t+6;if(r&&s1(o)&&"\\"===e[a]&&sQ(e,a)&&"u"===e[a+1]){let t=s0(e,a+2,4);if(s2(t))return{end:a+6,replacement:s3((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:s3(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&sY.test(r))return{end:t+3,replacement:s3(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!sH(e[t+2])||!sH(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&sH(e[o]);)o++;return{end:o,replacement:s3(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 s6(e,t,r){let{fixed:n,hasReplacement:o}=s8(t);if(o)return{node:e,messageId:sz,fix:t=>r?r(t,n):t.replaceText(e,n)}}function s9(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let s5=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],s4=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],s7="missing-message",le="message-is-empty-string",lt="message-is-not-a-string",lr=new o([["AggregateError",1],["SuppressedError",2]]),ln=e=>"instanceof"===e.value&&"Keyword"===e.type,lo="no-instanceof-builtins",la="switch-to-type-of",li=new i(["String","Number","Boolean","BigInt","Symbol"]),ls=new i(["global","globalThis","self","window"]),ll=[...s4,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...rZ,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],lu=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=rG(t,e),s=i.getTokenAfter(o,ln),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield aP(n,e,t);let c=e5(o,{sourceCode:i});!e7(o,t)&&o2(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=e5(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},lp=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,lc={create:oK(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new i("strict"===r?[...ll,...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&&ls.has(n.object.name)&&of(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:lo};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=rG(e,r),s=i.getTokenAfter(o,ln);yield aP(t,r,e);let l=e5(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield aW(s,"",t,e,i),yield aW(a,"",t,e,i)},p}return"Function"===l?(lp(n,e)||(p.fix=lu(r,e,l)),p):li.has(l)?(lp(n,e)||(p.suggest=[{messageId:la,data:{type:l.toLowerCase()},fix:lu(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:{[lo]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[la]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},ld="prefer-type-error",lm=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"]),lf=new i(["isNaN","isFinite"]),lg=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&lm.has(e.name)||!1===r&&lf.has(e.name)),ly=(e,t)=>!!lg(e.property,t,!0)||"MemberExpression"===e.object.type&&ly(e.object,t),lh=/^(?:[A-Z][\da-z]*)*Error$/,lx=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,lb=(e,t)=>{switch(e.type){case"Identifier":return lg(e,t,!1);case"MemberExpression":return ly(e,t);case"CallExpression":return lb(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&lb(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?lh.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&lh.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(lx(r)&&te(n,"undefined")||lx(n)&&te(r,"undefined"))})(e))return!1;return lb(n,t)||lb(o,t)}case"LogicalExpression":return lb(e.left,t)&&lb(e.right,t);default:return!1}},lE="consistentDestructuring",lv="consistentDestructuringSuggest",lC=new i(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),lD=e=>{for(;e.parent;)if(e=e.parent,lC.has(e.type))return e},lS=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,lT=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=ey(n.getScope(o.value),o.value);if(e&&ey(r,o.value)===e)return o}},lA=({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=rj(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?ey(r,l):void 0,c="ThisExpression"===l.type?lD(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},lw=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&tt(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&&(lw(e.left,t,r)||lw(e.right,t,r)),lk=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&lw(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&lw(e.left,r,n);default:return!1}},lI=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),lj=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...s4,...["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}`),...rZ],lF=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],lB="error-date",lR="suggestion-date";function lP(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let lL=new iw({objects:["BigInt","Boolean","Number","String","Symbol"],type:iw.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=>aB(r,t,e)),o}}),lN=new iw({objects:lj,type:iw.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||rY(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 aP(e,r,t)}let e={node:r,messageId:lB};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:lR,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>aL(r,t,e)}}}),l$=new iw({objects:lF,type:iw.CALL,handle:lP}),lM=new iw({objects:lF,type:iw.CONSTRUCT,handle:lP}),lO="error/array-push",lU="suggestion",lq=e=>tT(e,{property:"classList",computed:!1}),lV=e=>e.arguments.some(e=>"SpreadElement"===e.type),lW=[{description:"Array#push()",test:e=>tw(e,{method:"push",optionalCall:!1}),ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>tw(e,{method:"unshift",optionalCall:!1}),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=>tw(e,{method:"add",optionalCall:!1,optionalMember:!1})&&lq(e.callee.object)},{description:"Element#classList.remove()",test:e=>tw(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&lq(e.callee.object)},{description:"importScripts()",test:e=>tm(e,{name:"importScripts"},tp)}],l_={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}of lW){if(!a(n))continue;let l=[...i,...t];if(tB(n.callee,l))continue;let u=function(e){let t=e.parent;return"ChainExpression"===t.type&&e===t.expression&&(t=t.parent),"ExpressionStatement"===t.type?t:void 0}(n);if(!u)continue;let p=at(u,e);if(p?.type!=="ExpressionStatement")continue;let c=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(p);if(!a(c)||!rC(c.callee,n.callee))continue;let{shouldKeepSecondCall:d,shouldPrependSourceArguments:m,targetCall:f,sourceCall:g}=function(e,t,r){let n=r&&(!rY(t.callee)||rY(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(c,n,s),y=g.arguments,h=r.getRange(p),x=r.getRange(u),b=d?[h[0],x[0]]:[h[1],x[1]],E=!d&&!eE(r.getLastToken(p))&&eE(r.getLastToken(u)),v=d&&oD(r.getTokenBefore(p),e,r.text.slice(x[0],x[0]+1)),C={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:lO,data:{description:o}},D=function*(t){if(y.length>0){let r=rb(e,g,!m),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rx(f,e);m?yield t.insertTextAfter(n,f.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,f.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(b,E||v?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,b)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(lV(e)||lV(t))||r&&o.some(e=>null===e$(e,n.getScope(e)))||o.some(e=>ez(e,n))}(c,n,s,r)?C.suggest=[{messageId:lU,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",uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[lO]:"Do not call `{{description}}` multiple times.",[lU]:"Merge with previous one."},languages:["js/js"]}},lz="no-process-exit",lK=e=>te(e,"node:worker_threads")||te(e,"worker_threads"),lG="no-single-promise-in-promise-methods/error",lJ="no-single-promise-in-promise-methods/unwrap",lX="no-single-promise-in-promise-methods/use-promise-resolve",lY=["all","any","race"],lH=(e,t)=>{let[r]=e.arguments[0].elements,n=e4(r,t);return!e7(r,t)&&16>oX(r)&&(n=`(${n})`),n},lQ=(e,t)=>e.getCommentsInside(t).length>0,lZ=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",l0="no-static-only-class",l1=({type:e,value:t})=>"Punctuator"===e&&"="===t,l2=e=>"PropertyDefinition"===e.type,l3="ignored-elements",l8="property-assignment",l6={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:l3},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;!e7(c,e)&&oZ(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield aP(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rI(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:l8}})},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:{[l3]:"Array destructuring may not contain consecutive ignored values.",[l8]:"Do not assign destructured values to object properties."},languages:["js/js"]}},l9="spread-in-list",l5="iterable-to-array",l4="iterable-to-array-in-for-of",l7="iterable-to-array-in-yield-star",ue="spread-in-collection-constructor",ut="spread-in-object-assign",ur="clone-array",un="suggestion/remove-object-assign-spread",uo=["Map","WeakMap","Set","WeakSet"],ua=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ui=[...ua,"filter","flatMap","map"],us=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",ul={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*uu(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),eb(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||op(o,i,r)||e7(t,r)?yield aP(e,t,r):yield aj(e,u,r)}let up=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&nv(e.callee.object,t),uc="no-useless-switch-case/error",ud="no-useless-switch-case/suggestion",um=e=>e.consequent.every(e=>ty(e)),uf=e=>tP(e.test)||ti(e.test),ug=new i(["CallExpression","MemberExpression"]),uy=new i(["Identifier","MemberExpression","Super","ThisExpression"]);[...new o([["===","!=="],["!==","==="],["==","!="],["!=","=="]])];let uh=e=>"MemberExpression"===(e=rj(e)).type?{...e,object:uh(e.object),property:e.computed?uh(e.property):e.property}:e,ux=(e,t)=>rC(uh(e),uh(t)),ub=e=>uy.has(rj(e).type),uE=e=>!!("ChainExpression"===e.type||ug.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&uE(e)):t.type&&uE(t))),uv="no-useless-undefined",uC="no-useless-undefined/suggestion",uD=new i(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),uS=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},uT={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},uA={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},uw={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},uk={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},uI=new i(["<","<=",">",">="]);function uj(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function uF(e,t){return tT(e=rj(e),{property:"length",optional:!1,computed:!1})&&ux(e.object,t)}function uB(e,t){return uF(e=rj(e),t)?"length":"BinaryExpression"===e.type&&"-"===e.operator&&uF(e.left,t)&&1===oQ(e.right)?"lengthMinusOne":void 0}function uR(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let uP={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=uS(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:uv,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tP(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=uS(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>aW(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>aW(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>aW(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||rz(e.physicalFilename))&&!n.optional&&tv(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tP(r.consequent);if(n===tP(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tT(e=rj(e),{computed:!0,optional:!1})||uE(e)||ez(e.object,t,{considerGetters:!0})||ez(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rj(e)).type&&"-"===e.operator){let t=oQ(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=rj(e)).type||!uI.has(e.operator)||uE(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=oQ(n),i=oQ(o);return Number.isSafeInteger(i)&&ux(n,t.node)?uj(uT,r,i,t.offset):Number.isSafeInteger(a)&&ux(o,t.node)?uj(uA,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=uB(o,t.node.object);if(a&&ux(n,t.index.node))return uR(uw,r,a);let i=uB(n,t.node.object);if(i&&ux(o,t.index.node))return uR(uk,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:uv};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:uC,fix(n){let a=t.getText(o),i=oD(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rz(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tP(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),uD.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:uv,fix:t=>aw(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:{[uv]:"Do not use useless `undefined`.",[uC]:"Use the indexed access directly."},languages:["js/js"]}},uL="numeric-separators-style";function uN(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 u$={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},uM={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(!(to(e)||ts(e))||to(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";ts(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+uN(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 uN(r,t)+n+uN(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+uN(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:uL,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(u$).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:u$.binary,octal:u$.octal,hexadecimal:u$.hexadecimal,number:u$.number}],messages:{[uL]:"Invalid group length in numeric value."},languages:["js/js"]}},uO="error-zero-index",uU="error-shift",uq="error-pop",uV="error-at-zero",uW="error-at-minus-one",u_="error-slice-minus-one",uz="error-destructuring-declaration",uK="error-destructuring-assignment",uG="error-variable",uJ="suggest-nullish-coalescing-operator",uX="suggest-logical-or-operator",uY=(e,t,r)=>tw(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!nv(e.callee.object,t),uH=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,uQ=(e,t)=>tw(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uH(e.arguments[0])&&uY(e.callee.object,t),uZ=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*u0(e,t,r){let{left:n}=uZ(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eK(e,t))return!1;let{left:r}=uZ(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 u1=e=>"AssignmentPattern"===uZ(e).left.elements[0].type,u2=(e,t)=>{let r,n,{property:o}=uZ(t).right.callee;return u1(t)?r=[{operator:"??",messageId:uJ},{operator:"||",messageId:uX}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=uZ(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eK(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 u0(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield u0(t,e,r)},{fix:n,suggest:r}},u3=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,u8=e=>{let{left:t,right:r}=uZ(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},u6={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&&uY(t.object,e))||nL(t)))return{node:t.object.callee.property,messageId:uO,fix:r=>[r.replaceText(t.object.callee.property,"find"),a$(r,t,e)]}}),e.on("CallExpression",t=>{if(tw(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uU,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aM(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&&uY(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:uz,...u2(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&&uY(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:uK,...u2(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&uY(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=ey(n,r.id),a=rJ(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(u3(e))i.push(e.parent);else{if(!u8(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:uG};return s.every(e=>!u1(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=o5.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=ry(l,rp(n));yield aq(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 a$(a,t,e);for(let e of s)yield u0(e,t,a)}),l}),e.on("CallExpression",t=>{if(tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uV,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aM(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tw(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uq,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aM(r,t,e)]}}),e.on("CallExpression",t=>{if(tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uH(t.arguments[0])&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uW,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aM(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nL(r)&&uQ(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:u_,*fix(o,{abort:a}){if(r$(e,[e5(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aM(o,r.object,e),yield a$(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tw(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uQ(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:u_,*fix(o,{abort:a}){if(r$(e,[e5(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aM(o,r.callee.object,e),yield aM(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:{[uG]:"Prefer `.find(…)` over `.filter(…)`.",[uO]:"Prefer `.find(…)` over `.filter(…)[0]`.",[uV]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[uU]:"Prefer `.find(…)` over `.filter(…).shift()`.",[uq]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[uW]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[u_]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[uz]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uK]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uJ]:"Replace `.filter(…)` with `.find(…) ?? …`.",[uX]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},u9="prefer-array-flat-map",u5="prefer-array-flat-map/filter-flat-map",u4="prefer-array-flat-map/filter-flat-map-suggestion",u7=["React.Children","Children"],pe=new i(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),pt=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,pr="prefer-array-flat",pn={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tw(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&om(r.params[0],r.body)&&!pu(e.callee.object,t)}},po={testFunction(e){if(!tw(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&th(r)))return!1;let n=t.body,[o,a]=t.params;return tw(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&om(o,n.callee.object)&&om(a,n.arguments[0])||"ArrayExpression"===n.type&&2===n.elements.length&&n.elements.every((e,r)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&om(t.params[r],e.argument))},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},pa={testFunction:e=>tw(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&th(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},pi={testFunction(e){if(!(tw(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tL(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return th(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()"},ps=["_.flatten","lodash.flatten","underscore.flatten"],pl=/^\p{Uppercase_Letter}/u,pu=(e,t)=>{let r,n;return"Identifier"===e.type&&pl.test(e.name)&&(!(r=rq(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=rq(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))},pp={create:function(e){let{functions:t}=e.options[0],r=[...t,...ps],n=[pn,po,pa,pi,{testFunction:e=>tm(e,{argumentsLength:1,optional:!1},tp)&&tB(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tF(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:pr,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=e4(t,r);n?s=`[${s}]`:!e7(t,i)&&oZ(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,oD(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield aP(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",uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[pr]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},pc="some",pd="some-suggestion",pm="filter",pf={create:oK(e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||nv(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tP(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&ti(t.parent.right));if(!r&&!(tq(t,e)||tV(t)||function(e,t){if(!nE(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()&&(tq(r,t)||tV(r))})}(t,e)))return;let n=t.callee.property,o=r&&r$(e,[e5(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:pc,data:{method:n.name},suggest:o?void 0:[{messageId:pd,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=e5(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(!(tw(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)&&te(n,0)))||nv(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:pc,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(r$(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&&tT(t.left,{property:"length",optional:!1})&&tw(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if(nv(n,e)||"Identifier"===n.type&&n.name.startsWith("$"))return;let[o]=r.arguments;if(!o||ol(o))return;let a=r.callee.property;return{node:a,messageId:pm,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(r$(e,[e5(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield a$(n,s,e),yield n.removeRange([e5(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:{[pc]:"Prefer `.some(…)` over `.{{method}}(…)`.",[pd]:"Replace `.{{method}}(…)` with `.some(…)`.",[pm]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},pg=(e,t,r=!0)=>({node:e,messageId:`error/${e.name}`,...r&&{suggest:[{messageId:`suggestion/${t}`,fix:r=>r.replaceText(e,t)}]}}),py=new i(["+","-","*","/","%","**","&","|","^","<<",">>",">>>"]),ph=new i(["+","-","~"]),px="preferDefaultParameters",pb="preferDefaultParametersSuggest",pE=new i(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),pv=(e,t)=>{if(!t)return!1;if(pE.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(pv(e,t))return!0}else if(pv(e,n))return!0}return!1},pC="prefer-logical-operator-over-ternary/error",pD="prefer-logical-operator-over-ternary/optional-chain-error",pS="prefer-logical-operator-over-ternary/suggestion",pT="prefer-logical-operator-over-ternary/optional-chain-suggestion",pA=new i(["==","==="]),pw=new i(["!=","!=="]);function pk(e,t,r){if(rC(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return pk(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&pk(e.left,t.left,r)&&pk(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&pk(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function pI({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:pC}:{node:t,messageId:pC,suggest:o.map(o=>({messageId:pS,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=e7(e,t),o=n?e4(e,t):i.getText(e);return!n&&o3(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return oD(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function pj(e){return ti(e)?"null":tP(e)?"undefined":void 0}function pF(e){if("BinaryExpression"!==e.type||!pA.has(e.operator)&&!pw.has(e.operator))return;let t=pj(e.left),r=pj(e.right);if(!!t==!!r)return;let n=pA.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let pB=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,pR="with-name",pP="without-name",pL="regexp-exec",pN="string-match",p$="string-search",pM="suggestion",pO="string",pU="regexp",pq="other",pV="string-or-other",pW="regexp-or-other",p_="unknown";function*pz(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);eK(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eK(t,a)&&oZ(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let pK=[{type:pL,test:e=>tw(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:pN,test:e=>tw(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:pz},{type:p$,test:e=>tw(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:pz}],pG=e=>ta(e)||tf(e,{name:"RegExp"}),pJ=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},pX=e=>{if(e.includes(p_))return p_;let t=new i(e),r=t.has(pO)||t.has(pV),n=t.has(pU)||t.has(pW);if(r&&n)return pV;let o=t.has(pq)||t.has(pV)||t.has(pW);return r?o?pV:pO:n?o?pW:pU:pq},pY=e=>{let t=new i(e);return t.has(p_)?p_:t.has(pU)?pU:t.has(pO)?pO:pq},pH=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),pQ=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return pQ(e.typeAnnotation);case"TSStringKeyword":return pO;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?pO:pq;case"TSTypeReference":if("Identifier"!==e.typeName.type)return p_;if("String"===e.typeName.name)return pO;if("RegExp"===e.typeName.name)return pU;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return pq;return p_;case"TSUnionType":return pX(e.types.map(e=>pQ(e)));case"TSIntersectionType":return pY(e.types.map(e=>pQ(e)));default:return pH.has(e?.type)?pq:p_}},pZ=(e,t)=>{let r,n;if(r=e,r0.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),r0.has(n.intrinsicName)))return p_;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?pZ(r,t):p_}return e.isUnion()?pX(e.types.map(e=>pZ(e,t))):e.isIntersection()?pY(e.types.map(e=>pZ(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?pO:"RegExp"===r2(e)?.getName()||r8(e,t).some(e=>pZ(e,t)===pU)?pU:pq},p0=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function p1(e,t,r=new i){let n;if(pG(e))return pU;if(on(e,t))return pO;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=ey(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return p_;r.add(o);let[a]=o.defs,i=pQ(a.name?.typeAnnotation),s=p_;return i!==p_?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=p1(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==p_)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=pQ(e.typeAnnotation);return n===p_?p1(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return p1(e.expression,t,r);case"SequenceExpression":return p1(e.expressions.at(-1),t,r);case"ConditionalExpression":return pX([p1(e.consequent,t,r),p1(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=e$(e,o))?"string"==typeof n.value?pO:pJ(n.value)?pU: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)?pq:p_:p_;return a!==p_?a:p0.has(e.type)?pq:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return p_;try{let{program:t}=r;return pZ(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return p_}})(e,t)}let p2=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tN(e.parent)||tU(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},p3=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),p8=(e,t,r)=>[e5(t,r)[1],r.sourceCode.getRange(e.node)[1]],p6=e=>[{messageId:pM,fix:e}],p9=e=>[pU,pW,pq].includes(e),p5=e=>[pO,pV,pq].includes(e),p4=({type:e,stringType:t,regexpType:r})=>e===pL?p5(r)||p9(t):p9(t)||p5(r),p7=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[e5(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([e5(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!p3(r.sourceCode,e))&&(e.suggest=p6(t));return}if(!o||!p3(r.sourceCode,p8(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=p6(t)}},ce={create:oK(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tT(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(p2(o,t))return;if(tq(o,t)||tV(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&te(a.right,0)&&!p2(a,t)&&(tq(a,t)||tV(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)&&tk(n)||">="===r&&te(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tk(n)||"<"===r&&te(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tq(t,e)||tV(t))for(let{type:o,test:a,getNodes:i,fix:s}of pK){if(o===p$!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=e$(p,c),m=d?pJ(d.value):void 0,f=pG(p);if(p4({type:o,stringType:p1(l.stringNode,e),regexpType:p1(p,e)}))continue;let g={node:o===pL?u:t,messageId:o};p7(g,function*(o){for(let a of(r?(yield a$(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([e5(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(p8(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:{[pL]:"Prefer `.test(…)` over `.exec(…)`.",[pN]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[p$]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[pM]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},ct="error",cr="suggestion",cn=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],co=["slice","concat"],ca=e=>tw(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e,ci=new i(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),cs=(e,t,r=new i)=>"ArrayExpression"===e.type||tm(e,{name:"Array",optional:!1},td)||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tw(e,{methods:cn,optionalCall:!1,optionalMember:!1})||tw(e,{methods:co,optionalCall:!1,optionalMember:!1})&&void 0===tn(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new i)=>{if("Identifier"!==e.type)return!1;let n=ey(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&&cs(o.node.init,t,r)})(e.callee.object,t,r)),cl=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,cu=e=>e.some(e=>e?.type==="SpreadElement"),cp=(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])}),cc=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,cd=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(;cc(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},cm=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)||tw(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},cf={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)&&cs(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?cu(i.elements)?void 0:i.elements.length:tm(i,{name:"Array",optional:!1},td)?((e,t)=>{if(cu(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=e$(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:cl(n)?n:void 0})(i,s):tw(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?cu(i.arguments)?void 0:i.arguments.length:tw(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 cu(r.elements)?void 0:r.elements.length;if(void 0!==tn(r)){let e=e$(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=e$(r.value,t);return cl(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=ey(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(ca(o)){t.push(o);continue}if(cd(o)){r.push(o),n.push(o);continue}if(cm(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(rJ(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!cu(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=e$(t,e.sourceCode.getScope(t)))&&rD(r.value)&&!Object.is(r.value,-0)}))||0!==rA(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(ci.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:ct,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(cp(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(cp(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&&!cp(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:cr,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:{[ct]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[cr]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},cg=e=>tw(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tm(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},tp),cy="prefer-string-raw",ch="unnecessary-string-raw";function cx(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let cb="prefer-switch",cE=(e,t)=>e===t||rC(e,t),cv=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tP(e))),cC=new i(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),cD=e=>{for(;e.parent;e=e.parent)if(cC.has(e.type))return e},cS=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},cT={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||=cv(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>cE(e,r)||cE(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:cb};!ez(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!cS(n,t,r))continue;let e=cD(n);if(!e||cS(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=rw(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}=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,`
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=cE(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=dI(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:{[cb]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},cA="require-number-to-fixed-digits-argument";function cw(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||r===1/0?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}let ck=/^(?:( )+|\t+)/,cI="space";function cj(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(ck);if(null===e)i=0,r="";else{let o=e[0].length,s=e[1]?cI:"tab";if(t&&s===cI&&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===cI&&1===e)continue;n=(s===cI?"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 cF(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=cj(e,!0);0===r.size&&(r=cj(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]?cI:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===cI?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let cB="template-indent",cR=(e,t=new i)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),cP=[{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."}}}],cL="no-await-in-promise-methods/error",cN="no-await-in-promise-methods/suggestion",c$=["all","allSettled","any","race"],cM="no-negation-in-equality-check/error",cO="no-negation-in-equality-check/suggestion",cU=new i(["===","!==","==","!="]),cq=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function cV(e,{methods:t,messageId:r}){e.on("CallExpression",n=>{if(!tw(n,{methods:t,argumentsLength:2,optionalCall:!1}))return;let o=n.arguments[1],a=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tT(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tT(e,{property:"length",computed:!1})&&rC(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(o,n.callee.object);if(!a)return;let i=n.callee.property.name,s={description:a};return"splice"===i?s.argumentName="deleteCount":"toSpliced"===i&&(s.argumentName="skipCount"),{node:o,messageId:r,data:s,fix:t=>aw(t,o,e)}})}let cW="no-unnecessary-slice-end",c_="catch-error-name",cz={create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>E.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(an(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&&(tw(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tw(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=ey(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=ry(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:c_,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>aq(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",uniqueItems:!0,description:"Patterns to ignore."}}}],defaultOptions:[{name:"error",ignore:[]}],messages:{[c_]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},cK="invalidExport",cG="doNotPassMessageToSuper",cJ="doNotAssignMessageWithoutSetter",cX="missingOptionsParameter",cY="invalidOptionsParameter",cH="passMessageToSuper",cQ="passOptionsToSuper",cZ=/^(?:[A-Z][\da-z]*)*Error$/,c0=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=>`
42
42
  name = '${e}';
43
- `,c1=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&&cZ.test(r)},c2=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tF(e.expression.callee,"super"),c3=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tF(e.expression.left,`this.${t}`),c8=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),c6=(e,t)=>tn(e?.value)===t,c9=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,c5=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,c4=e=>c5(e)?.name==="options",c7=(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&&c7(e,t)))return!0;continue}if(c7(n,t))return!0}}return!1},de=e=>{let t=c5(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},dt=(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])||tP(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},dr=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*dn(e,t){if(!c1(t)||null===t.id)return;let{name:r}=t.id,n=an(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(c6(s,r))return;let e=a.getRange(t.body);yield{...c8(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,c0(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],c0(r))};return}let l=o.some(e=>c9(e,"get")),u=o.some(e=>c9(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=>c2(e)),p=a.findIndex(e=>c2(e)),c=a.findIndex(e=>c3(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tP(r)))m=!0,yield{node:u,messageId:cG};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:cJ};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=c5(l),f=1===t.value.params.length&&m&&!c4(l),g=f||c4(d);if(0===u.expression.arguments.length){if(c!==p+1||c7(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${e4(s,e)}, options`:e4(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,`, ${de(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=>c3(e,"name"));return a?tn(a.expression.right)!==n?c8(a.expression.right??e,n):void 0:c6(o,n)?void 0:c8(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=c5(a);if(0===o.length||!i)return;let s=r.expression;if(c4(a)){if(!c4(s.arguments[1])){let t={node:s,messageId:cQ};return dr(s.arguments[0],i)||(t.fix=dt(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!==tn(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===eO(n.properties[0])})(s,u))return;return{node:a,messageId:cX,fix:function*(r){let{sourceCode:n}=e,o=dt(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${de(a)}`),yield o}}}if(!c4(l))return{node:l,messageId:cY};if(u&&!dr(s.arguments[0],i)){let t;return{node:s,messageId:cH,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])||tP(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!c4(s.arguments[1]))return{node:s,messageId:cQ,fix:dt(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 da="no-lonely-if",di=e=>"IfStatement"===e.type&&!e.alternate;function ds(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 dl=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),du=e=>e.trim()?e:"",dp=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,dc=(e,t)=>dl(e.ifToken,e.openingParenthesisToken,t),dd=(e,t,r)=>{let n,o=dl(e.openingParenthesisToken,e.closingParenthesisToken,r);return e7(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},dm="no-magic-array-flat-depth",df="no-negated-condition",dg="identifier",dy="non-identifier",dh="prefer-negative-index",dx=new o([["slice",{argumentsIndexes:[0,1],supportObjects:new i(["Array","String","ArrayBuffer",...rZ])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new i(rZ)}],["splice",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new i(["Array","String",...rZ])}]]),db=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var dE=["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 dv(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new i(dE)).has(t)}let dC="prefer-node-protocol",dD="node:",dS="consistent-date-clone/error",dT="no-accessor-recursion/error",dA=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,dw=(e,t)=>["type","name"].every(r=>e[r]===t[r]),dk=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&dA(e.parent.property)&&dw(e.parent.property,t.key),dI="error/calculate-dirname",dj="error/calculate-filename";function dF(e,{modules:t,functionName:r,sourceCode:n}){if(!tm(e,{optional:!1,argumentsLength:1},tp))return!1;let o=new i;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tT(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tw(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=ey(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 dB(e,t){return dF(e,{modules:new i(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function dR(e,t){return dF(e,{modules:new i(["path","node:path"]),functionName:"dirname",sourceCode:t})}let dP="no-unnecessary-array-flat-depth",dL="no-unnecessary-array-splice-count",dN="no-useless-error-capture-stack-trace/error",d$="prefer-class-fields/error",dM="prefer-class-fields/suggestion",dO="prefer-bigint-literals/error",dU="prefer-bigint-literals/suggestion",dq="prefer-classlist-toggle/error",dV="prefer-classlist-toggle/suggestion",dW=e=>tT(e,{property:"classList",computed:!1}),d_=(e,t,r)=>{let n={node:r??e,messageId:dq};return"IfStatement"===e.type||tb(e)||tb(e.parent)?n.fix=t:n.suggest=[{messageId:dV,fix:t}],n},dz=(e,t,r)=>{let{sourceCode:n}=t,o=e4(e,t);return r?(!e7(e,n)&&o2(e,"!")&&(o=`(${o})`),o=`!${o}`):(e7(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},dK=(e,t)=>tw(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dW(e.callee.object),dG=(e,t)=>rC(e.callee.object,t.callee.object)&&rC(e.arguments[0],t.arguments[0]),dJ=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),dK(e,["contains"])&&dG(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?dJ(e.argument,!t,r):void 0,dX="require-module-attributes",dY="error",dH="suggestion/array",dQ="suggestion/object",dZ="suggestion/object-assign",d0="suggestion/set",d1="suggestion/map",d2=(e,t,r)=>{let{sourceCode:n}=r,o=rJ(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 d3(e,t){if(!tf(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*d8(e,t,r){let n=!eE(t.sourceCode.getTokenBefore(e));yield aO(e,t,r,n)}function d6(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eb(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*d9({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rh(r,e)){let[o]=r.arguments;if(o)yield d6(e,t,o,n);else{let{openingParenthesisToken:o}=rh(r,e)?rx(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*d8(o,e,t)}let d5=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tw(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!d2(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:dY,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:dH,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=rb(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):d6(e,a,t,i),yield d8(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&&tT(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!d2(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:dY,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:dQ,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=e4(o,e);n.computed&&(s=`[${s}]`);let l=e4(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eb(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield d8(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tw(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||d2(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:dY,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return ez(i,a)?s.suggest=[{messageId:dZ,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(eb(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${e4(o,e)}`,i&&(yield d6(e,a,t,i)),2!==n.arguments.length)?yield aw(a,o,e):yield d8(r,e,a)}},{testValue:e=>d3(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),tw(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!d2(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:dY,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>ez(e,i))?s.suggest=[{messageId:d0,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rb(e,r,!1);return d9({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>d3(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tw(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!d2(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:dY,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>ez(e,i))?s.suggest=[{messageId:d1,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rb(e,r,!1);return d9({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],d4="no-useless-collection-argument/error",d7="no-useless-collection-argument/suggestion",me="prefer-response-static-json",mt=/([\p{Ll}\d])(\p{Lu})/gu,mr=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,mn=/(\d)\p{Ll}|(\p{L})\d/u,mo=/[^\p{L}\d]+/giu,ma="$1\0$2";function mi(e){let t=e.trim();t=(t=t.replace(mt,ma).replace(mr,ma)).replace(mo,"\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 ms(e){let t=mi(e);for(let e=0;e<t.length;e++){let r=t[e],n=mn.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 ml(e,t){let[r,n,o]=mf(e,t);return r+n.map(mc(t?.locale)).join(t?.delimiter??" ")+o}function mu(e,t){var r,n;let[o,a,i]=mf(e,t),s=mc(t?.locale),l=md(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):mm(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function mp(e,t){let[r,n,o]=mf(e,t),a=mm(mc(t?.locale),md(t?.locale));return r+n.map(a).join("")+o}function mc(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function md(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function mm(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function mf(e,t={}){let r=t.split??(t.separateNumbers?ms:mi),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 mg="filename-case",my="directory-case",mh="filename-extension",mx=e=>!/^[\w-]$/.test(e),mb=new i(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),mE=new Intl.ListFormat("en-US",{type:"disjunction"}),mv=/^[\da-z]+$/i,mC=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,mD=e=>e>="0"&&e<="9",mS=e=>e>="a"&&e<="z",mT=e=>e>="A"&&e<="Z",mA={camelCase:{fn:mu,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!mS(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(mS(r)||mD(r))continue;if(!mT(r))return!1;let n=t;for(;mT(e[t+1]);)t++;if(t!==n){if(mS(e[t+1])){t--;continue}for(;mD(e[t+1]);)t++;if(t===e.length-1)return!0;if(!mT(e[t+1]))return!1}}return!0}(e)?mu(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return ml(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return ml(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(mv.test(e)){let t=mC.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&mp(r)===r)return e}return mp(e)},name:"pascal case"}};function mw(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function mk(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 mI=/^(?<leading>_+)(?<tailing>.*)$/;function mj(e){let t,{leading:r="",tailing:n=e}=(mI.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=mx(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function mF(e){let t;return t=e.map(e=>mA[e].name),mE.format(t)}let mB=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",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",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}]}],mR="consistent-template-literal-escape",mP=["entries","keys","values"],mL=["drop","filter","flatMap","map","take"],mN=["concat","from","zip","zipKeyed"],m$=new i(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:mM}=ny({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:m$}),mO=e=>{for(;rI(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},mU="iterable-accepting",mq="for-of",mV="yield-star",mW="spread",m_="iterator-method",mz="iterable-accepting/suggestion",mK="iterator-method/suggestion",mG=["every","find","forEach","some"],mJ="reduce",mX=e=>tw(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),mY=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aM(r,e,t)},mH=(e,t,r,n)=>{let o=mY(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},mQ="prefer-simple-condition-first",mZ="prefer-simple-condition-first/unsafe";function m0(e){return"Identifier"===(e=rj(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rj(e.argument).type}function m1(e){if(m0(e=rj(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rj(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function m2(e){if("Identifier"===(e=rj(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return m2(e.argument);if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)){let t=rj(e.left),r=rj(e.right);return m1(t)&&m1(r)&&(m0(t)||m0(r))}return!1}let m3="switch-case-break-position",m8=new i(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),m6="first-child",m9="first-element-child",m5="query-selector",m4="closest",m7="merge-query-selector",fe="suggestion-first-child",ft="suggestion-first-element-child",fr="suggestion-merge-query-selector",fn={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},fo=(e,t)=>tT(e,{property:t,optional:!1,computed:!1}),fa=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&to(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,fi=(e,t)=>t.getCommentsInside(e).length>0,fs=(e,t,r,n)=>{let{sourceCode:o}=n;if(fi(e,o))return;let[,a]=e5(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},fl=e=>tT(e,{property:"parentElement",optional:!1,computed:!1}),fu=e=>void 0!==tn(e),fp=e=>tw(e,fn),fc=new i(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),fd=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),fm=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("/"))},ff="consistent-compound-words/error",fg="consistent-compound-words/rename",fy={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"},fh=new i(String.raw`\^$.*+?()[]{}|`),fx=e=>{let t="";for(let r of e)t+=fh.has(r)?`\\${r}`:r;return t},fb=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,fE=(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(ao(e));if(r){let t;return(t=e[0])===t.toUpperCase()?an(r):ao(r)}})(e,r));if(o!==e)return o},fv=(e,t)=>({node:e,messageId:ff,data:{name:e.name,replacement:t}}),fC={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]}}}},fD="no-blob-to-file",fS="suggestion";function fT(e,t){let r=ey(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function fA(e,t){if(e?.type!=="Identifier")return;let r=ey(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 fw="no-canvas-to-image",fk=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function fI(e,t){if(e=fk(e),e?.type!=="Identifier")return e;let r=ey(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 fk(n.parent.init)}let fj=e=>e.toLowerCase().includes("canvas"),fF="replace-one-element",fB="insert-at-negative-one",fR="suggestion-replace-one-element",fP="suggestion-insert-at-negative-one";function fL(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&fL(e.object)}let fN=(e,t)=>t.getCommentsInside(e).length>0,f$="no-duplicate-set-values",fM="first-match",fO="id-selector",fU="length-check",fq="query-selector-all-nullish",fV="query-selector-undefined",fW=e=>tw(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oa(e.callee.object),f_=e=>tw(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oa(e.callee.object),fz=e=>{let t,r;return t=e,r=f_,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&te(t.property,0)},fK=e=>{let t,r;return t=e,r=f_,tw(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&te(t.arguments[0],0)},fG=e=>nL(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,fJ=(e,t,r,n)=>{let[,o]=e5(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},fX=(e,t,r)=>{if("Identifier"!==e.type)return;let n=ey(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},fY=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tM(e))r=!r,e=e.parent;else if(tO(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tV(n)||(f_(e)?!e:!fX(e,r,f_)))return;let a=r.getText(e);return{node:e,messageId:fU,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"}`)}},fH=(e,t,r)=>({node:e,messageId:fM,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?a$(n,e,r):aM(n,e,r)}}),fQ=(e,t)=>ti(e)||tP(e)&&t.isGlobalReference(e),fZ=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:fX(n,r,t))&&fQ(a,r)?{node:n,value:a}:(t(a)?a:fX(a,r,t))&&fQ(n,r)?{node:a,value:n}:void 0:void 0},f0="no-invalid-file-input-accept/invalid",f1="no-invalid-file-input-accept/static",f2="no-invalid-file-input-accept/normalize",f3=new i(["audio/*","image/*","video/*"]),f8=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"]]),f6=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,f9=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},f5=e=>{if(e.startsWith("."))return e.length>1&&!f9(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]&&!f9(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 f3.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new C.MIMEType(e);return{replacement:f8.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},f4=e=>{if("JSXIdentifier"===e.type)return e.name},f7=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&f4(e.name)===t),ge=(e,t)=>{let r=e.sourceCode.getScope(t),n=e$(t,r)?.value;if("string"==typeof n)return n},gt=e=>">"===e||""===e.trim(),gr=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},gn=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],go=(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}},ga=(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&&!gt(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},gi=(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=gr(n,i,a),!gn(n,i,a));){let e=go(n,i,a);if(i=gr(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=gr(n,++i,a);let t=ga(n,i,a);if(i=t.index,e.name===r)return t}},gs=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:f0,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:f1};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=f5(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:f0,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:f2,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},gl=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,gu=e=>{for(let t=e.parent;t;t=t.parent)if(tv(t))return t},gp=(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}},gc=e=>{let{sourceCode:t}=e,r=new i,n=e=>{let t=gu(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(gp(o,n)&&t_(o,t.visitorKeys))return!0;return!1}}},gd="after-suspension",gm="in-nested-function",gf="no-unnecessary-nested-ternary";function gg(e,t,r){return r.getText(e)===r.getText(t)}function gy(e,t,r,n){let o=e4(e,t);return!e7(e,t)&&o3(e,{operator:r,property:n})&&(o=`(${o})`),o}function gh(e,t){let r=e4(e,t);return!e7(e,t)&&oY(e)&&(r=`(${r})`),r}function gx(e,t,r){let n={node:t,messageId:gf};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=[gy(r,e,n,"left"),gy(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${gh(a,e)} : ${gh(i,e)}`;return oD(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let gb="no-unused-array-method-return",gE=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"]),gv=/^\p{Uppercase_Letter}/v,gC=Symbol("uncertainValue"),gD=["BigInt","Boolean","Number","RegExp","String","Symbol"],gS=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),gT="prefer-array-last-methods",gA="replace",gw=new o([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),gk=["reverse","toReversed"],gI="prefer-math-abs",gj=new i([">",">=","<","<="]),gF={">":"<",">=":"<=","<":">","<=":">="},gB={">":"<",">=":"<="};function gR(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&ts(e.literal)||"TSTypeAnnotation"===e.type&&gR(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>gR(e))||"TSIntersectionType"===e.type&&e.types.some(e=>gR(e))}function gP(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?gP(e.expression):e}function gL(e){let t;return ts(e)||tm(e,{name:"BigInt",argumentsLength:1,optional:!1},tp)||"UnaryExpression"===e.type&&"-"===e.operator&&gL(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&gR(t)}function gN(e,t){return gL(e)||function(e,t){let r=gP(e);if("Identifier"!==r.type)return!1;let n=ey(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&gR(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&gL(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&gR(e.node.id.typeAnnotation)||e.node.init&&gL(e.node.init)))??!1}(e,t)}function g$(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rC(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&te(e.left,0)?rC(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rC(e.left,t)&&tk(e.right)||tk(e.left)&&rC(e.right,t))}function gM(e,t){if(!("BinaryExpression"!==e.type||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:gF[e.operator]}}function gO(e,t){if(!("BinaryExpression"!==e.type||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:gF[e.operator]}}function gU(e,t){let r=e4(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function gq(e,t,r){let n={node:e,messageId:gI};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function gV(e){return["Identifier","Literal","ThisExpression"].includes((e=gP(e)).type)}let gW="prefer-split-limit",g_=(e,t)=>{let r=e$(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},gz=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tw(r,{method:"split",argumentsLength:1})&&(tt(t=r.arguments[0])&&""!==t.value||ta(t)))return r},gK=(e,t,r,n)=>({node:e,messageId:gW,fix:e=>aA(e,t,String(r),n)}),gG=(e,t,r)=>{let{elements:n}=e,o=gz(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return gK(e,o,n.length,r)},gJ="prefer-queue-microtask",gX={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tT(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&of(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:gJ,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&&!ol(n.arguments[0])&&oE(n)&&of(n.callee,e)?{node:n.callee,messageId:gJ,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&&!ol(n.arguments[0])&&oE(n)&&of(n.callee,e)?{node:n.callee,messageId:gJ,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(!r$(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:{[gJ]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},gY="prefer-string-pad-start-end",gH="suggest-padding-method",gQ=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),gZ=(e,t)=>{let r,n=((e,t)=>{if("Identifier"!==e.type)return;let r=ey(t.sourceCode.getScope(e),e),n=r?.defs[0]?.node;return n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"?n:n?.type==="VariableDeclarator"?n.init:void 0})(e,t);return(r=e$(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||gQ.has(e.type)||gQ.has(n?.type)||n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"},g0=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,g1=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,g2=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&to(t)&&g1(r),g3=(e,t)=>{if(!tw(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=e$(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]}},g8=(e,t)=>{let r,n=g3(e,t);if(!n)return;let{widthNode:o}=n;if("BinaryExpression"===o.type&&"-"===o.operator&&(r=o.right,r?.type==="MemberExpression"&&!1===r.computed&&"Identifier"===r.property.type&&"length"===r.property.name))return{...n,targetLengthNode:o.left,targetNode:o.right.object}},g6=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=e4(t,a),s=e4(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${e4(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},g9=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:gY,data:{method:t}};return o&&!g0(e,n)&&(a.fix=function(t){let o=oD(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},g5=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:gY,data:{method:t}};return o&&!g0(e,n)&&(a.suggest=[{messageId:gH,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},g4="require-css-escape",g7=["closest","matches","querySelector","querySelectorAll"],ye=e=>e.value.cooked,yt=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=ye(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=ye(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},yr=e=>tw(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),yn=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],yo={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tw(e,{methods:g7,minimumArguments:1})||oa(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!yr(n)&&(t||yt(r,e))&&(yield{node:n,messageId:g4,fix:yn(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:{[g4]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},ya="require-passive-events",yi=new i(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),ys=e=>e.computed||"Identifier"!==e.property.type?tt(e.property)?e.property.value:void 0:e.property.name,yl=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===ys(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)},yu=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=ys(e.parent);return t&&"preventDefault"!==t&&!nL((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},yp="this",yc="class",yd="class-unavailable",ym="super",yf="super-class",yg="super-class-unavailable",yy="suggestion",yh=new i(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),yx=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),yb=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,yE=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,yv=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(yE(r)&&!yb(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(yh.has(r.type))return}},yC=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},yD=(e,t,r)=>ey(e.getScope(t),t)===ey(e.getScope(r),r),yS=(e,t,r)=>ey(e.getScope(t),r.name)===ey(e.getScope(r),r),yT=(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,yA=e=>{let t;return(t=e.parent,yx.has(t.type)&&t.expression===e)?e.parent:void 0},yw=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=yA(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)},yk=e=>{let t=e;for(;t.parent;){if(yT(t.parent,t))return!0;let e=yw(t);if(!e)break;t=e}return!1},yI=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,yj=e=>{let t=e;for(;t.parent;){let e=yA(t);if(!e)break;t=e}return t},yF=e=>{let t=yj(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},yB=e=>{let t=yj(e);return yI(t)&&"PrivateIdentifier"===t.parent.property.type},yR=e=>{let t=yj(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},yP=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,yL=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:yy,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),yN=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),y$={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||yk(e)||yF(e)||yB(e)||yR(e))return;let n=yv(e);if(!n)return;let o=yC(n.parent.parent);return o&&yS(t,e,o)?yL({node:e,messageId:yc,source:"this",replacement:o.name,name:o.name}):yN(e,yd)}),e.on("Super",e=>{if(n||yk(e))return;let r=yv(e);if(!r)return;let o=yP(r.parent.parent);return o&&yS(t,e,o)?yL({node:e,messageId:yf,source:"super",replacement:o.name,name:o.name}):yN(e,yg)}),e.on("Identifier",o=>{if(!tI(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)||yk(o)||yF(o)||yB(o)||yR(o))return;let a=yv(o);if(!a)return;let i=a.parent.parent;if(r){let e=yC(i);if(e&&o.name===e.name&&yD(t,o,e))return yL({node:o,messageId:yp,source:o.name,replacement:"this",name:o.name})}if(!n||!(yI(o)&&!o.parent.optional&&!yk(o.parent))||e7(o,e))return;let s=yP(i);if(s&&o.name===s.name&&yD(t,o,s))return yL({node:o,messageId:ym,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:{[yp]:"Use `this` instead of `{{name}}` in static methods.",[yc]:"Use `{{name}}` instead of `this` in static methods.",[yd]:"Use the class name instead of `this` in static methods.",[ym]:"Use `super` instead of `{{name}}` in static methods.",[yf]:"Use `{{name}}` instead of `super` in static methods.",[yg]:"Use the superclass name instead of `super` in static methods.",[yy]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},yM="consistent-optional-chaining/remove-optional",yO="consistent-optional-chaining/use-optional",yU="consistent-optional-chaining/suggest-remove-optional",yq="consistent-optional-chaining/suggest-use-optional",yV=new i(["Identifier","ThisExpression","Super"]);function yW(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rj(e)).type&&(e=e.expression);return e}function y_(e){return"MemberExpression"===(e=yW(e)).type?e:void 0}function yz(e){return e=yW(e),!!yV.has(e.type)||"MemberExpression"===e.type&&yz(e.object)}function yK(e,t){let r=rV(e,t);return!r$(t,r)}function yG({memberExpression:e,context:t,fixer:r,replacement:n}){let o=rV(e,t);return r.replaceTextRange(o,n)}function yJ(e,t,r){return yG({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let yX="always",yY="never",yH="missing-delay",yQ="redundant-delay",yZ=new i(["setTimeout","setInterval"]),y0=new i(["window","globalThis","global","self"]),y1=e=>te(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&y1(e.argument),y2="negative-index",y3="length-index",y8="no-duplicate-loops",y6=["filter","map"],y9="no-declarations-before-early-exit",y5=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),y4=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,y7=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eT(n)},he=(e,t)=>{let[r,n]=e.getRange(t);return new i(rc(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*ht(e,t,r){let n;for(let[o,a]of t.entries())if(y5(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&&t_(r.init,e.visitorKeys)||a>o+1&&!y4(r.init)||r.init&&(i=r.init,s=he(e,n),[...he(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:y9};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&y4(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!y7(e,t,"before")&&!y7(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eT(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 hr="no-optional-chaining-on-undeclared-variable",hn=e=>"Type"===e.type||"ImportBinding"===e.type&&oS(e.node);function ho(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rj(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let ha="no-object-methods-with-collections/error",hi="no-object-methods-with-collections/suggestion",hs=new i(["entries","keys","values"]),hl="no-subtraction-comparison/error",hu="no-subtraction-comparison/suggestion",hp={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},hc=new i(Object.keys(hp)),hd=new i([">","<"]),hm=e=>"BinaryExpression"===e.type&&"-"===e.operator,hf=(e,t)=>{let r=e$(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},hg="no-unnecessary-global-this",hy=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function hh(e){for(;hy.has(e.type);)e=e.expression;return e}let hx=e=>{for(;hy.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},hb=tX();function hE(e){return"CallExpression"===(e=hx(e)).parent.type&&e.parent.callee===e}let hv=new i(["==","!=","===","!=="]),hC="computed-key",hD="nested-array",hS="deep-object",hT="property-assignment";function hA(e){let{parent:t}=e;if(t){if(rI(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return hA(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 hw(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=hA(e);return t}let hk="no-useless-else",hI=new i(["Program","BlockStatement","StaticBlock","SwitchCase"]),hj=new i(["[","(","<","/","`","+","-"]),hF=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},hB=e=>hj.has(e.value[0]),hR="no-useless-recursion",hP=new i(["using","await using"]),hL=e=>e?.type==="VariableDeclaration"&&hP.has(e.kind),hN=e=>"ForStatement"===e.type?hL(e.init):"ForOfStatement"===e.type&&hL(e.left),h$="prefer-add-event-listener-options",hM="prefer-direct-iteration",hO="Array",hU="FormData",hq="URLSearchParams",hV=new i([hO,"Map","Set",hU,hq,...rZ]),hW=new o([["ReadonlyArray",hO],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),h_=new o([[hO,["values"]],["Map",["entries"]],["Set",["values","keys"]],[hU,["entries"]],[hq,["entries"]],...rZ.map(e=>[e,["values"]])]),hz=["Map","WeakMap","Set","WeakSet"],hK=["all","allSettled","any","race"],hG=new i(["ArrayExpression","CallExpression","NewExpression"]),hJ=e=>new i([e]),hX=(e,t)=>tw(e,{objects:rZ,methods:t,optionalCall:!1,optionalMember:!1}),hY=e=>hV.has(e)?e:hW.get(e),hH=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},hQ=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return hH(e.types.map(e=>hQ(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return hJ(hO);let n=r2(e);if(!r3(n,r))return;let o=n.getName(),a=o&&hY(o);return a&&hJ(a)},hZ=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return hZ(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return hJ(hO);case"TSTypeOperator":return"readonly"===e.operator?hZ(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=hY(e.typeName.name);return t&&hJ(t)}case"TSUnionType":return hH(e.types.map(e=>hZ(e)))}},h0=(e,t,r=new i)=>((e,t,r)=>{if("ArrayExpression"===e.type||tf(e,{name:"Array"}))return hJ(hO);if(tf(e,{names:rZ})||tf(e,{names:["Map","Set",hU,hq]}))return hJ(e.callee.name);if(tm(e,{name:"Array"},tp)||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return hJ(hO);if(hX(e,["from","of"]))return hJ(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=hZ(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?h0(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return hZ(e.typeAnnotation)??h0(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return h0(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return hQ(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),h1="prefer-number-is-safe-integer/error",h2="prefer-number-is-safe-integer/suggestion",h3="prefer-number-is-safe-integer/integer-check-error",h8="prefer-number-is-safe-integer/integer-check-suggestion",h6=["_","lodash","underscore"],h9=["floor","trunc"],h5=(e,t)=>{let r=ey(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},h4=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&te(e.right,1))return e.left},h7=(e,t)=>{if(tw(e,{object:"Math",methods:h9,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},xe="prefer-object-define-properties";function xt(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tw(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let xr="prefer-object-destructuring-defaults",xn="prefer-object-destructuring-defaults/suggestion",xo=new i(Object.getOwnPropertyNames(Object.prototype)),xa={considerGetters:!0,considerImplicitTypeConversion:!0},xi=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,xs=(e,t,r)=>rc(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)),xl=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=e4(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},xu="prefer-single-object-destructuring",xp=(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=ey(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}},xc=(e,t,r)=>{let n,o,a=xp(e,t),i=xp(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=>eT(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:xu,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*xd(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=xc(e,t[r-1],n);o&&(yield o)}}let xm="prefer-smaller-scope",xf=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function xg(e,t){let r=e.parent;for(;r&&r!==t;){if(xf.has(r.type))return!1;r=r.parent}return r===t}function xy(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eT(n))}function xh(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let xx="prefer-single-array-predicate/error",xb="prefer-single-array-predicate/suggestion",xE=new o([["||","some"],["&&","every"]]),xv=new i(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),xC="prefer-url-href",xD="non-url",xS="unknown",xT=new i(["ClassName","ImportBinding","Type"]),xA=new i(["any","error","unknown"]),xw=new i(["node:url","url"]),xk=e=>xT.has(e.type),xI=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>oT(e,r,n)))return o;t=t.upper}},xj=e=>e.every(e=>"url"===e)?"url":!e.includes(xS)&&e.includes(xD)?xD:xS,xF=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,xw.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},xB=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||oS(e.node)),xR=e=>"Type"===e.type||xB(e),xP=e=>xF(e)&&!xB(e),xL=(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=>!xR(e)&&oT(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(of(e,t))return!0;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>xR(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>xP(e))??!1})(r,t))},xN=(e,t)=>t.sourceCode.getScope(e.name??e.node),x$=(e,t,r,n=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return x$(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return xS;let o=e.typeName.name,a=xI(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=>xk(e)))return!0;t=t.upper}return!1})(o,r)?xS:"url";if(n.has(o))return xS;if(xF(i))return"url";n.add(o);let s=xS;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=x$(i.node.typeAnnotation,t,xN(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=xS:"ClassName"===i.type&&(s=xD),n.delete(o),s})(e,t,r,n);case"TSUnionType":return xj(e.types.map(e=>x$(e,t,r,n)));case"TSIntersectionType":return xj(e.types.map(e=>x$(e,t,r,n)));case"TSImportType":let o;return(o=e.source,xw.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":xD;default:return e?xD:xS}},xM=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(xA.has(e.intrinsicName)||e.isTypeParameter?.())return xS;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return xM(i,t);if(e.isUnion()||e.isIntersection())return xj(e.types.map(e=>xM(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return xS;let n=xI(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||xF(e))??[];return 0===o.length?xS:o.every(e=>xF(e))?"url":xD})(r.typeToString(e),o,n);if(s!==xS)return s;let l=r2(e);return r3(l,a)&&"URL"===l.getName()?"url":xD},xO=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return xS;try{let{program:n}=r;return xM(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return xS}};function xU(e,t,r=new i){if(!e)return xS;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return xS;let[o]=n.defs;if(!oT(o,e,t))return xS;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?xU(o.node.init,t,r):xS,i=x$(o.name?.typeAnnotation,t,xN(o,t)),s=xS;return a!==xS?s=a:i!==xS&&(s=i),r.delete(n),s})(e,t,r);if(n!==xS)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=x$(e.typeAnnotation,t,n);return o===xS?xU(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return xU(e.expression,t,r);case"SequenceExpression":return xU(e.expressions.at(-1),t,r);case"ConditionalExpression":return xj([xU(e.consequent,t,r),xU(e.alternate,t,r)])}if(xL(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!xR(e)&&!xP(e))??!1})(e.callee,t))return xD;let r=xO(e,t);return r===xS?xD:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return xS;let r=ey(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return xS;let[n]=r.defs;return x$(n.node.returnType,t,xN(n,t))})(e,t);return o!==xS?o:xO(e,t)}let xq=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return xq(e.expression,t);case"SequenceExpression":return xq(e.expressions.at(-1),t);case"ConditionalExpression":return xq(e.consequent,t)&&xq(e.alternate,t);case"NewExpression":return xL(e,t);default:return!1}},xV=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,xW="require-proxy-trap-boolean-return",x_=new i(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),xz=new i(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),xK=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),xG=new i(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),xJ=(e,t)=>({node:e,messageId:xW,data:{name:t}}),xX=e=>{if(e)return xJ(e.node,e.data.name)},xY=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?xX(xY(e.right,t,r)):xJ(e,t);if("ConditionalExpression"===e.type)return xY(e.consequent,t,r)??xY(e.alternate,t,r);if("LogicalExpression"===e.type)return xX(xY(e.left,t,r)??xY(e.right,t,r));if("SequenceExpression"===e.type)return xX(xY(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=e$(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(xK.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&xG.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{...xJ(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},xH=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eO(e,t.getScope(e));if(x_.has(r)&&xz.has(e.value.type))return{name:r,functionNode:e.value}},xQ=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return xJ(e,t);if("BlockStatement"!==e.body.type)return xY(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&&xz.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 xJ(e,t)}for(let e of o){if(!e.argument)return xJ(e,t);let n=xY(e.argument,t,r);if(n)return n}if(!a)return xJ(e,t)},xZ=D.builtinRules.get("logical-assignment-operators"),x0="ifNullish",x1="convertIf",x2={...xZ.meta.messages,[x0]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},x3=e=>e.fix??e.suggest?.[0]?.fix,x8={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 x3(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:x0};if(t.getCommentsInside(e.node).length>0)return n;let o=x3(e);return{...n,suggest:[{messageId:x1,data:{operator:"||="},fix:o},{messageId:x1,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(xZ.create(r)))e.on(t,n)},meta:{type:xZ.meta.type,docs:{description:xZ.meta.docs.description,recommended:!0},fixable:xZ.meta.fixable,hasSuggestions:xZ.meta.hasSuggestions,schema:xZ.meta.schema,defaultOptions:[xZ.meta.defaultOptions?.[0]],messages:x2,languages:["js/js"]}},x6="no-useless-coercion",x9=new o([["Boolean",{type:"boolean",isType:n6}],["String",{type:"string",isType:on}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&n5(e.typeAnnotation)||n4(e,t))||"bigint"==typeof e$(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>n_(e,t.sourceCode.getScope(e))}]]),x5="no-useless-boolean-cast",x4=["every","filter","find","findIndex","findLast","findLastIndex","some"],x7="no-useless-continue",be="no-useless-override",bt=e=>e.isUnion()?e.types.every(e=>bt(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,br=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},bn="prefer-has-check",bo=new i(["Map","ReadonlyMap","WeakMap"]),ba=new i(["Map","WeakMap"]),bi=new i(["FormData","Headers","URLSearchParams"]),bs=new i(["Array","ReadonlyArray"]),bl=ba.union(bi),bu=new i(["ClassName","ImportBinding","TSEnumName","Type"]),bp=new i(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),bc=new i(["TSTypeAnnotation","TSParenthesizedType"]),bd=new i(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),bm=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),bf=new i(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),bg=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),by=new i(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),bh=e=>{for(;by.has(e.type);)e=e.expression;return e},bx=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=bx(e.left);return t?`${t}.${e.right.name}`:void 0}},bb=e=>e.typeArguments?.params??e.typeParameters?.params??[],bE=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>bu.has(e.type));if(r)return r;t=t.upper}},bv=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===bb(e.node).length)return e.node.typeAnnotation},bC=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=ey(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},bD=(e,t)=>tP(e)&&bC(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,bS=(e,t)=>bo.has(e)?{kind:"map",typeName:e,valueType:t}:bi.has(e)?{kind:"null-sentinel",typeName:e}:void 0,bT=(e,t,r=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bT(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?bT(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=bx(e.typeName);if(!n)return;if((bo.has(n)||bi.has(n))&&!bE(n,t))return bS(n,bb(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),bv(bE(e,t))})(n,t,r);return o?bT(o,t,r):void 0}}},bA=(e,t)=>{let r=t.sourceCode.getScope(e);return bT(e.typeAnnotation,r)},bw=(e,t,r=new i)=>{let n=bA(e,t);if(n)return n;if(tf(e=bh(e))&&"Identifier"===e.callee.type&&bl.has(e.callee.name)&&bC(e.callee,t))return bS(e.callee.name);if("Identifier"!==e.type)return;let o=ey(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,s=bT(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?bw(a.node.init,t,r):void 0)},bk=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=r2(r);if(r3(e,t))return e.getName()}},bI=(e,t,r)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>bI(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=>bI(e,t,r)).find(e=>e?.kind==="map");let n=bk(e,r);return bS(n,bo.has(n)?t.getTypeArguments(e).at(-1):void 0)},bj=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return bI(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},bF=(e,t)=>bj(e,t)??bw(e,t),bB=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,bR=(e,t,r,n=new i)=>{if(!e||bd.has(e.type))return!1;if(bc.has(e.type))return bR(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&bR(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>bR(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(bm.has(e.type))return"truthy"!==r;if(bf.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&&bB(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=bx(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=bv(o=bE(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=bR(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},bP=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,bL=(e,t,r)=>{if(r0.has(e.intrinsicName))return!1;let n=bP(e,t);return n&&n!==e?bL(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>bL(e,t,r)):!r.has(e.intrinsicName))},bN=(e,t,r)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return!1;let n=bP(e,t);if(n&&n!==e)return bN(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>bN(e,t,r));if(bp.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)||bs.has(bk(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},b$=(e,t,r)=>{if(!tf(e)||"Identifier"!==e.callee.type||!ba.has(e.callee.name)||!bC(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=e$(n,t.sourceCode.getScope(n)))?bB(o.value,r):!tP(n)&&bg.has(n.type))})},bM=(e,t,r)=>{let n=b$(bh(e),t,r);if(void 0!==n)return n;let o=bj(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?bN(o,n,e):"not-undefined"===r?bL(o,n,new i(["undefined","void"])):bL(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=bA(t,r);if(u?.kind==="map")return!!u.valueType&&bR(u.valueType,r,n);let p=((e,t,r,n)=>{if(!tf(e)||"Identifier"!==e.callee.type||!ba.has(e.callee.name)||!bC(e.callee,t))return;if(n){let n=b$(e,t,r);if(void 0!==n)return n}let o=bb(e).at(-1);return!!o&&bR(o,t,r)})(t=bh(t),r,n,l);if(void 0!==p)return p;let c=((e,t,r)=>{if("Identifier"!==e.type)return;let n=ey(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=bT(d.name?.typeAnnotation,r.sourceCode.getScope(d.name)),a?.kind==="map"?!!a.valueType&&bR(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)},bO="logical",bU="ternary",bq="consistent-conditional-object-spread",bV=new i(["==","==="]),bW=new i(["!=","!=="]),b_=e=>tx(e)||tP(e)||ti(e),bz=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function bK(e,t,r){if(rC(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return bK(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&bK(e.left,t.left,r)&&bK(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&bK(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function bG(e){return ti(e)?"null":tP(e)?"undefined":void 0}function bJ(e){if("BinaryExpression"!==e.type||!bV.has(e.operator)&&!bW.has(e.operator))return;let t=bG(e.left),r=bG(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:bV.has(e.operator)}}let bX=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function bY(e,t){let r=bJ(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=bJ(e.left),o=bJ(e.right);if(n&&o&&bK(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&bX(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&bX(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function bH(e,t,r){let n=e4(e,r);return!e7(e,r)&&o3(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function bQ(e,t){let r=e4(e,t);return!e7(e,t)&&oY(e)&&(r=`(${r})`),r}let bZ="default-export-style/inline",b0="default-export-style/separate",b1="default-export-style/suggestion-inline",b2="default-export-style/suggestion-separate",b3="inline",b8="separate",b6="ignore",b9="class",b5="function",b4=()=>({enum:[b3,b8,b6]}),b7=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,Ee=e=>e.id?.name,Et=e=>{switch(e.type){case"ClassDeclaration":return b9;case"FunctionDeclaration":return b5}},Er=e=>e===b9?"classes":"functions",En=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return rB(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},Eo=(e,t)=>ey(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,Ea=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),Ei=(e,t)=>{if(Ea(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&Ei(e,t)))return!0;continue}if(n?.type&&Ei(n,t))return!0}return!1},Es=(e,t)=>e.params.every(e=>!rX(e,t.sourceCode.visitorKeys)),El=(e,t,r)=>ey(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,Eu=(e,t)=>{let r=Ee(e);if(r){let t=Et(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||Ea(r.id)||r.init?.type!=="ArrowFunctionExpression"||Ei(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:b5,name:n.id.name,declaration:e,functionNode:n.init}},Ep=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),Ec=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||El(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!Ei(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&Es(t,e)&&!rX(t.body,e.sourceCode.visitorKeys))return[{messageId:b2,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${Ep(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
44
- export default ${n};`)}]},Ed=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===b6||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return rB(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||Eo(i,r.declaration))&&(o!==b5||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===b5&&"FunctionDeclaration"===t.type&&Ei(t,e.sourceCode.visitorKeys))){if(n===b3)return"VariableDeclaration"===t.type?{node:r,messageId:bZ,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||En(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||El(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!Ei(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&Es(i,e)&&!rX(i.body,e.sourceCode.visitorKeys))return[{messageId:b1,data:{kind:b5},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${Ep(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${e4(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===b9&&Ei(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||En(e,r)?{node:r,messageId:bZ,data:{kind:o}}:{node:r,messageId:bZ,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===b8&&o===b5&&"FunctionDeclaration"===t.type)return{node:r,messageId:b0,data:{kind:o,style:"const arrow function"},suggest:Ec({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},Em=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=Ee(o),i=e.sourceCode.getScope(t);if(!(!a||r===b6||r===b3||Eo(i,a)||n===b5&&(o.generator||Ei(o,e.sourceCode.visitorKeys)))){if(n===b5)return{node:t,messageId:b0,data:{kind:n,style:"const arrow function"},suggest:Ec({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===b9&&Ei(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:b0,data:{kind:n,style:"class declaration"}}:{node:t,messageId:b0,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};`)}}}},Ef={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=Et(r),a=Ee(r);if(!n||!a)continue;let i=Em({context:e,exportDeclaration:o,expectedStyle:t[Er(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=Eu(o,e);if(!i||!b7(a,i.name))continue;let s=Ed({context:e,exportDeclaration:a,expectedStyle:t[Er(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:b4(),classes:b4()},additionalProperties:!1}],defaultOptions:[{functions:b3,classes:b3}],messages:{[bZ]:"Prefer declaring this default-exported {{kind}} inline.",[b0]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[b1]:"Use an inline default {{kind}} declaration.",[b2]:"Use a separate const arrow function default export."},languages:["js/js"]}};function Eg(e){for(;;){let t=rj(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function Ey(e,t){return ey(t.sourceCode.getScope(e),e)}let Eh="no-array-concat-in-loop",Ex="no-array-front-mutation",Eb=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],EE="no-array-sort-for-min-max/error",Ev="no-array-sort-for-min-max/suggestion",EC=e=>to(e)&&0===e.value,ED=(e,t)=>{if(!tw(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||nv(e.callee.object,t)||rY(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tv(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rj((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(rC(t.left,r)&&rC(t.right,n))return"ascending";if(rC(t.left,n)&&rC(t.right,r))return"descending"}})(r);if(n)return{direction:n,node:e.callee.object}},ES=(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:EE,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=ox(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:Ev,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},ET="no-boolean-sort-comparator",EA="no-boolean-sort-comparator/suggestion",Ew=new i(["sort","toSorted"]),Ek=new i([">",">=","<","<="]),EI=(e,t,r,n)=>(e=rj(e),t=rj(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?!!rC(e.property,t.property):e.property.name===t.property.name)&&EI(e.object,t.object,r,n),Ej=(e,t)=>{for(;rI(e);){if(e.typeAnnotation&&n1(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},EF="no-chained-comparison/error",EB="no-chained-comparison/suggestion",ER=new i(["<",">","<=",">="]),EP=new i(["===","!==","==","!="]),EL=ER.union(EP),EN=e=>"BinaryExpression"===e.type&&EL.has(e.operator),E$="no-constant-zero-expression/error",EM="no-constant-zero-expression/suggestion",EO="no-duplicate-logical-operands",EU="no-duplicate-logical-operands/suggestion",Eq=new i(["Identifier","ThisExpression","Literal"]),EV=new i(["Identifier","ThisExpression"]),EW=e=>{if(uE(e=rj(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return EW(e.object)&&(!e.computed||(t=rj(t=e.property),Eq.has(t.type)));default:return!1}},E_="no-impossible-length-comparison",Ez={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},EK="no-invalid-character-comparison",EG=new i(["==","===","!=","!=="]),EJ=(e,t)=>!!(tw(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&on(e.callee.object,t)||tw(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&on(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(to(e))return!0;if(!tt(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&on(e.object,t),EX="no-loop-iterable-mutation",EY=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],EH=["add","clear","delete"],EQ=["clear","delete","set"],EZ={array:new i(EY),set:new i(EH),map:new i(EQ),unknown:new i([...EY,...EH,...EQ])},E0=new i(["entries","keys","values"]),E1=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function E2(e,t){return nE(e,t)?"array":nk(e,t)?"set":nI(e,t)?"map":void 0}function E3(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function E8(e){return"Identifier"===(e=rj(e)).type?e:void 0}function E6(e){if("ArrayPattern"!==(e=rj(e)).type)return;let[t]=e.elements;return t&&E8(t)}function E9(e,t){if(uE(e=rj(e)))return;if(ub(e))return{collectionKind:E2(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eO(e.callee,t.sourceCode.getScope(e.callee));if(!(!E0.has(r)||uE(e.callee.object))&&ub(e.callee.object))return{collectionKind:E2(e.callee.object,t),reference:e.callee.object,method:r}}function E5(e,t){let r=E3(e);return"keys"===t.method?E8(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?E6(r):void 0}function E4(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=E3(e),"entries"===t.method?E6(r):"direct"!==t.method||"map"!==t.collectionKind?E8(r):void 0),a=E5(e,t),i=(n=E3(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?E8(n):"direct"===t.method&&"map"!==t.collectionKind?E8(n)??E6(n):E5(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*E7(e){"Identifier"===(e=rj(e)).type?yield e:"MemberExpression"===e.type&&(yield*E7(e.object),e.computed&&(yield*E7(e.property)))}function ve(e,t,r){if(!ux(e,t))return!1;let n=[...E7(e)],o=[...E7(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=ey(r.sourceCode.getScope(e),e),i=ey(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function vt(e,t,r){let[n]=e.arguments;return!!(t&&n&&ve(n,t,r))}function vr(e,t,r,n){return"add"===r&&vt(e,t.addArgumentIdentifier,n)||"set"===r&&vt(e,t.setKeyIdentifier,n)}let vn="no-selector-as-dom-name",vo=["add","remove","contains","toggle","replace"],va=/^[#.]-?[A-Z_a-z][\w-]*$/u,vi=new i([".","#"]),vs=e=>vi.has(e?.[0]),vl=e=>tn(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),vu=(e,t,r,n)=>({node:e,messageId:vn,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(va.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),vp=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),vc="no-useless-compound-assignment/error",vd="no-useless-compound-assignment/remove",vm="no-useless-compound-assignment/replace",vf=new o([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),vg="no-useless-delete-check",vy="removeCheck",vh={considerGetters:!0},vx=new i(["Map","Set","WeakMap","WeakSet"]),vb=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),vE=new i(["ClassName","FunctionName"]),vv=new i(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),vC=e=>null!==e&&("object"==typeof e||"function"==typeof e),vD=e=>!!vv.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>vD(e)),vS=(e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>vE.has(e.type))??!1},vT=(e,t)=>{let r=e$(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!vC(r.value)?String(r.value):void 0},vA=(e,t)=>{let r=e$(e,t.sourceCode.getScope(e));if(r)return vC(r.value);let n=rq(rj(e),t);if(n){let e=rj(n),r=e$(e,t.sourceCode.getScope(e));if(r)return vC(r.value);if(vb.has(e.type))return!0}return!vS(rj(e),t)&&vD(((e,t)=>{if("Identifier"!==(e=rj(e)).type)return;let r=ey(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},vw=(e,t)=>!ez(e,t.sourceCode,vh),vk=(e,t)=>tw(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),vI=(e,t,r)=>n=>{if(r$(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),oD(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},vj="no-useless-logical-operand",vF=new o([["&&",!0],["||",!1]]),vB=new o([["&&",!1],["||",!0]]),vR=new i(["FunctionExpression","ClassExpression","ObjectExpression"]),vP="prefer-boolean-return",vL=new i(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function vN(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return vN(t[0])}return e}}let v$=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function vM(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return vL.has(e.operator);case"LogicalExpression":return vM(e.left,t)&&vM(e.right,t);case"CallExpression":return tU(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 vO="prefer-flat-math-min-max",vU=["min","max"],vq=(e,t)=>tw(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),vV=(e,t)=>{let r=[];for(let n of e.arguments){if(vq(n,t)){r.push(...vV(n,t));continue}r.push(n)}return r},vW="prefer-hoisting-branch-code/start",v_="prefer-hoisting-branch-code/end",vz="prefer-hoisting-branch-code/suggestion",vK=new i(["await using","using"]),vG=(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),vJ=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},vX=(e,t,r)=>{let n=vJ(e,r),o=vJ(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 vY(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 vH({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=>!rU(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 r$(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&&r$(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(r$(a,[r,n-1]))return!0}return r$(a,vY(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"&&vK.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?vW:v_};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rw(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=rw(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&&oD(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&&oD(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
47
- ${s}${c}${n}`)}for(let e of t)yield l.removeRange(vY(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(vG(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!vG(e,s))?c.fix=i:c.suggest=[{messageId:vz,fix:i}]}return c}let{parse:vQ}=sf,vZ="prefer-single-replace",v0=new i(["g","m","s"]),v1=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 v2(e){if(!tw(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(tt(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(ta(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!v0.has(e))return;try{r=vQ(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 v3="consistent-tuple-labels",v8="no-invalid-well-known-symbol-methods/async-dispose",v6="no-invalid-well-known-symbol-methods/dispose-generator",v9="no-invalid-well-known-symbol-methods/sync-iterator",v5="no-invalid-well-known-symbol-methods/async-iterator",v4="no-invalid-well-known-symbol-methods/suggestion",v7=new i(["Promise","PromiseLike"]),Ce=new i(["dispose","iterator","asyncIterator"]);function Ct(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&v7.has(e.typeName.name)}function Cr(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(!Ce.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:v6};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?Ct(r):"TSUnionType"===r.type&&r.types.some(e=>Ct(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:v8,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:v9};return o.generator&&(t.suggest=[{messageId:v4,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:v5}}let Cn="after-suspension",Co="in-generator",Ca="in-nested-function",Ci=["preventDefault","stopImmediatePropagation","stopPropagation"],Cs="prefer-abort-signal-timeout",Cl="prefer-abort-signal-timeout/suggestion",Cu=new i(["reason","throwIfAborted"]),Cp=(e,t)=>{let r,{parent:n}=e;if(!(!tT(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nL(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tT(n.parent)&&n.parent.object===n&&(r=n.parent,Cu.has(eO(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rI(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)||r$(t,t.sourceCode.getRange(n))))return n},Cc=(e,t,r,n)=>{let o=ey(n.sourceCode.getScope(r),e);return o&&o!==t},Cd="prefer-aggregate-error",Cm=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,Cf=new i(s4);function Cg(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rj(e)}function Cy(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=Cy(e.left);return t?`${t}.${e.right.name}`:void 0}}function Ch(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?Ch(e.typeAnnotation):e}function Cx(e,t,r,n=new i){switch(e=Ch(e),e?.type){case"TSTypeReference":{let o=Cy(e.typeName);if(!o)return!1;let a=oA(o,t);if(Cf.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&&Cx(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>Cx(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>Cx(e,t,r,n));default:return!1}}function Cb(e,t){let r;if(tT(e=Cg(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,Cm.test(r))&&nE(e.object,t)&&function(e,t){let r=oA(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=Ch(t),t?.type){case"TSArrayType":return Cx(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>Cx("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=Cy(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return Cx(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=oA(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=r2(t);return!!(Cf.has(s?.getName())&&r3(s,n))||r8(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 CE=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&te(Cg(t),0))return!0;let o=(n=Cg(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)},Cv=e=>"LogicalExpression"!==(e=Cg(e)).type||"&&"!==e.operator?[e]:[...Cv(e.left),...Cv(e.right)],CC={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},CD=new i(Object.keys(CC)),CS=new i(["globalThis","self","window"]),CT=new i(["getBoundingClientRect","getClientRects"]),CA=new i(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),Cw=new i(["innerHeight","innerWidth"]),Ck=new i(["height","width"]),CI=new i(["Window"]),Cj=new i(["VisualViewport"]),CF=new i(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),CB=(e,t,r)=>{let n;if(r0.has(e.intrinsicName))return!1;if(r1.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>CB(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CB(o,t,r);let a=r2(e);return!(!a||r8(e,t).some(e=>!CB(e,t,r)))&&(!r3(a,r)||(n=a.getName(),!(CF.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},CR=(e,t,r,n)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!r1.has(e.intrinsicName));return o.length>0&&o.every(e=>CR(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>CR(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CR(o,t,r,n);let a=r2(e);return!!(a&&r3(a,r)&&n.has(a.getName()))||r8(e,t).some(e=>CR(e,t,r,n))},CP=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return CR(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},CL=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return CB(r.getTypeAtLocation(e),n,t)}catch{return!1}},CN=e=>e.computed||"Identifier"!==e.property.type?tn(rj(e.property)):e.property.name,C$=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?tn(rj(e.key)):e.key.name})(e))),CM=(e,t)=>"Identifier"===e.type&&CS.has(e.name)&&of(e,t),CO=e=>nL(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),CU=(e,t)=>"Identifier"===(e=rj(e)).type?"visualViewport"===e.name&&of(e,t):"MemberExpression"===e.type&&"visualViewport"===CN(e)&&CM(rj(e.object),t),Cq=(e,t)=>{var r;return CM(e=rj(e),t)||("Identifier"===(r=rj(r=e)).type?"document"===r.name&&of(r,t):"MemberExpression"===r.type&&"document"===CN(r)&&CM(rj(r.object),t))||CU(e,t)},CV=(e,t,r)=>{let n=rj(t);return C$(e,Cw)&&(CM(n,r)||CP(t,r,CI))||C$(e,Ck)&&(CU(n,r)||CP(t,r,Cj))||C$(e,CA)&&!Cq(n,r)&&!CL(t,r)},CW=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tv(e))return!1;if(a=e,i=t,tm(a,void 0,tp)&&"MemberExpression"===a.callee.type&&CT.has(CN(a.callee))&&!Cq(a.callee.object,i)&&!CL(a.callee.object,i)||tI(e)&&Cw.has(e.name)&&!CO(e)&&of(e,t)||"MemberExpression"===e.type&&!CO(e)&&(n=CN(e),o=rj(e.object),Cw.has(n)&&(CM(o,t)||CP(e.object,t,CI))||Ck.has(n)&&(CU(o,t)||CP(e.object,t,Cj))||CA.has(CN(e))&&!Cq(e.object,t)&&!CL(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?CV(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&CV(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=>CW(e,t,r)))return!0;continue}if(CW(o,t,r))return!0}return!1},C_="prefer-set-methods/union",Cz="prefer-set-methods/intersection",CK="prefer-set-methods/intersection-suggestion",CG="prefer-set-methods/difference",CJ="prefer-set-methods/difference-suggestion",CX=(e,t)=>tf(e,{name:"Set",argumentsLength:1})&&of(e.callee,t),CY=(e,t)=>{let r=e4(e,t);return oZ(e,t)&&!e7(e,t)?`(${r})`:r},CH=(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)&&oD(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,CQ=(e,t)=>("ParenthesizedExpression"===e.type||rI(e))&&e.expression===t,CZ=e=>{for(;e.parent;){let{parent:t}=e;if(CQ(t,e)){e=t;continue}break}return e},C0=(e,t)=>e?.type==="SpreadElement"&&"Set"===oM(e.argument,t),C1=(e,t,r)=>{if(!(!tw(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rC(e.arguments[0],t)||rC(e.callee.object,t))&&"Set"===oM(e.callee.object,r))return e.callee.object},C2=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=CZ(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rI(e.parent))return;let o=((e,t)=>{if(!tw(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&&C0(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=C1(e,t,r);if(n)return{method:"intersection",messageId:Cz,suggestionMessageId:CK,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=C1(e.argument,t,r);if(o)return{method:"difference",messageId:CG,suggestionMessageId:CJ,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:`${CY(r,t)}.${o.method}(${e4(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,CH(t,o.replacement,r))}]}},C3="prefer-toggle-attribute/error",C8="prefer-toggle-attribute/suggestion",C6=(e,t,r)=>{let n=e4(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?C6(e.argument,t,!1):(!e7(e,t.sourceCode)&&o2(e,"!")&&(n=`(${n})`),`!${n}`):e7(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},C9=(e,t,r)=>tw(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function C5(e){if(e?.type==="ChainExpression"&&(e=e.expression),C9(e,["removeAttribute","hasAttribute"],1)||C9(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(tn(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||te(n,"")}}}function C4(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),C5(e)}}let C7=(e,t)=>e.isOptional===t.isOptional&&rC(e.receiver,t.receiver)&&rC(e.attributeName,t.attributeName),De=(e,t)=>oa(e.receiver)||nR(e.receiver,t),Dt="prefer-url-search-parameters/error",Dr="prefer-url-search-parameters/suggestion",Dn=new i(["node:url","url"]),Do=e=>"Type"===e.type||"ImportBinding"===e.type&&oS(e.node),Da=(e,t,r)=>{let n=ey(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>Do(e))},Di=(e,t)=>tn(rj(e))===t,Ds=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},Dl=(e,t)=>{if(!tw(e=rj(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(tw(e=rj(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!Di(e.arguments[0],"&")||or(e.callee.object,t)||(n=e$(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!!tw(e=rj(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!om(rj(e.callee.object),t)&&!!Di(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],e$(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},Du=(e,t)=>`new URLSearchParams(${Ds(e,t)})`,Dp=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=e5(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},Dc=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e5(t,r);return[[n,a],[i,o]]},Dd=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=ey(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>Do(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return Dn.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||rL(n,e,r)))return[{messageId:Dr,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:Dt,suggest:a}},Dm="no-unsafe-promise-all-settled-values",Df=new i(["PromiseSettledResult","PromiseRejectedResult"]),Dg=new i(["PromiseFulfilledResult"]),Dy=new i(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Dh=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",Dx=e=>{for(;e&&Dy.has(e.type);)e=e.expression;return e},Db=e=>tw(Dx(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),DE=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,Dv=e=>tw(Dx(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function DC(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?DC(e.right):void 0}function DD(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 DS(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DC(t.typeName);return Df.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(DD(e))}function DT(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DC(t.typeName);return Dg.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(DD(e))}function DA(e){if(e.isUnion())return e.types.every(e=>DA(e));let t=e.aliasSymbol??e.getSymbol();return Dg.has(t?.getName())}function Dw(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>Dw(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function Dk(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let DI=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function Dj(e,t,r=new i){var n;let o;return!!(DI(o=e)&&DS(o.typeAnnotation))||!!(e=Dx(e))&&(n=Dx(n=e),!!(n?.type==="AwaitExpression"&&Db(n.argument)||DS(e.typeAnnotation)||function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=Dw(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return Df.has(r?.getName())}(a))}(e,t))||(Dv(e)?Dj(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(DS(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&Dj(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let DF=e=>(e=Dx(e),e?.type==="Identifier"?e.name:void 0),DB=e=>{if(e=Dx(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===eO(t)&&"Identifier"===t.value.type)return t.value}},DR=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function DP(e,t){return e=Dx(e),!!(t.statusVariable&&D_(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&D_(e.object,t.entryVariable,t.context)&&"status"===eO(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&DF(e.object)===t.entryName&&"status"===eO(e))}function DL(e,t){if(e=Dx(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=DP(e.left,t)?DR(e.right):DP(e.right,t)?DR(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function DN(e,t){return"fulfilled"===DL(e=Dx(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(DN(e.left,t)||DN(e.right,t))}function D$(e,t){return"unfulfilled"===DL(e=Dx(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(D$(e.left,t)||D$(e.right,t))}let DM=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&DN(e.test,r)||e.alternate===t&&D$(e.test,r)),DO=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&DN(e.left,r)||"||"===e.operator&&e.right===t&&D$(e.left,r)),DU=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&DN(e.test,r)||e.alternate===t&&D$(e.test,r)),Dq=e=>{let t;if(!Dh(e)||0===e.params.length)return!1;let r={entryName:DF(e.params[0]),statusName:(t=e.params[0],DB(t)?.name)},n=Dx(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&DN(e.argument,r)}return DN(n,r)};function DV(e){if(e=Dx(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===eO(t))return t}}let DW=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function D_(e,t,r){return e=Dx(e),e?.type==="Identifier"&&t&&ey(r.sourceCode.getScope(e),e)===t}function Dz(e){for(e=Dx(e);Dv(e);){if(Dq(e.arguments[0]))return!0;e=Dx(e.callee.object)}return!1}function DK(e,t,{knownPromiseSettledResultArray:r=!1}={}){let n,o;if(!tw(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!Dj(e.callee.object,t)||function e(t,r,n=new i){return!!(DI(t)&&DT(t.typeAnnotation)||function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=Dw(n,o);return!!(a&&DA(a))}(t=Dx(t),r))||("Identifier"===t.type?function(t,r,n){let o=ey(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(DT(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):Dv(t)&&Dz(t)&&Dj(t,r))}(e.callee.object,t))return;let[a]=e.arguments;if(!Dh(a)||0===a.params.length)return;let[s]=a.params;if(function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n}=r;return DA(n)}(s,t))return;let l=DV(s);if(l&&"Identifier"!==l.value.type)return{node:l.key,messageId:Dm};let u=DF(s),p=u&&ey(t.sourceCode.getScope(s),s),c=(n=DV(s),o=n?.value,o?.type==="Identifier"?o:o?.type==="AssignmentPattern"&&"Identifier"===o.left.type?o.left:void 0),d=c&&ey(t.sourceCode.getScope(c),c),m=DB(s),f=m?.name,g=m&&ey(t.sourceCode.getScope(m),m),y=function e(t,r){var n;if(n=t=Dx(t),n=Dx(n),(n?.type==="MemberExpression"&&D_(n.object,r.entryVariable,r.context)&&"value"===eO(n)||n?.type==="Identifier"&&D_(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(DM(n,r,t)||DO(n,r,t)||DU(n,r,t)||function(e,t){let r=e.parent?.body;if(!Array.isArray(r))return!1;let n=r.indexOf(e),o=r[n-1];return o?.type==="IfStatement"&&!o.alternate&&D$(o.test,t)&&function e(t){return t=Dx(t),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||t?.type==="BlockStatement"&&t.body.length>0&&e(t.body.at(-1))}(o.consequent)}(n,t))return!0;if(DE(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||DW(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||Dh(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}}(a.body,{entryName:u,entryVariable:p,statusName:f,statusVariable:g,valueVariable:d,context:t});if(y)return{node:y,messageId:Dm}}let DG="prefer-abort-signal-any",DJ="prefer-abort-signal-any/suggestion",DX=new i(["reason","throwIfAborted"]),DY=new i(["capture","once","passive"]),DH=new i(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),DQ=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]},DZ=(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})},D0=e=>{let t=e,{parent:r}=e;for(;rI(r);)t=r,r=r.parent;return{expression:t,parent:r}},D1=(e,t)=>{let{parent:r}=e;if(!(!tT(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}=D0(e);return tT(n)&&n.object===r&&DX.has(eO(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=D0(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||r$(t,t.sourceCode.getRange(r))))return r},D2=(e,t,r)=>{if(r0.has(e.intrinsicName))return;if(r1.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!r1.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>D2(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>D2(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return D2(n,t,r);let o=r2(e);if(o&&r3(o,r))return"AbortSignal"===o.getName();let a=r8(e,t).map(e=>D2(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},D3=(e,t)=>tm(e,{optional:!1},tp)&&tT(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),D8=e=>D3(e,["any","timeout"]),D6=e=>D3(e,["any"]),D9=(e,t)=>{if("Identifier"!==(e=rj(e)).type)return;let r=ey(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},D5=(e,t)=>{if("Identifier"!==(e=rj(e)).type)return!1;let r=ey(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})},D4=(e,t,r)=>tm(e,{optional:!1},tp)&&tT(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&of(e.callee.object,r),D7=(e,t)=>(tm(e,{name:"Array",optional:!1},tp)||tf(e,{name:"Array"}))&&of(e.callee,t),Se=(e,t,r=new i)=>{if(e=rj(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&&Se(e,t,r));if(D4(e,"of",t)||D7(e,t))return e.arguments.some(e=>Se(e,t,r));if(D4(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=D9(n,t);if(o)return!!(!nE(o,t)||D5(n,t))||Se(o,t,r);let a=rj(n);return"ArrayExpression"!==a.type||Se(a,t,r)}if(D6(e))return e.arguments[0]&&Se(e.arguments[0],t,r);let n=D9(e,t);return n?!!(nE(n,t)&&D5(e,t))||Se(n,t,r):D3(rj(e),["abort"])},St=(e,t,r,n=new i)=>{var o;if(e=rj(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&&St(e,t,r,n));if(D4(e,"of",r)||D7(e,r))return e.arguments.some(e=>St(e,t,r,n));if(D4(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=D9(o,r);if(a)return!!(!nE(a,r)||D5(o,r))||St(a,t,r,n);let i=rj(o);return"ArrayExpression"!==i.type||St(i,t,r,n)}if(D6(e))return e.arguments[0]&&St(e.arguments[0],t,r,n);let a=D9(e,r);return a?!!(nE(a,r)&&D5(e,r))||St(a,t,r,n):tT(o=rj(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},Sr=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return D2(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rj(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 D8(e)},Sn=(e,t)=>"Identifier"===(e=rj(e)).type?Sr(e,t):D8(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!ez(e,t.sourceCode)),So=(e,t)=>{if(!D4(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rj(r);if("ArrayExpression"===n.type)return n;let o=D9(r,t);if(o&&nE(o,t)&&!D5(r,t))return o},Sa=(e,t,r=new i)=>{if(e=rj(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(D4(e,"of",t)||D7(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=So(e,t);if(n)return Sa(n,t,r);let o=D9(e,t);if(o&&nE(o,t)&&!D5(e,t))return Sa(o,t,r)},Si=(e,t,r=new i)=>{if(e=rj(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||D4(e,"of",t)||D7(e,t))return!0;let n=So(e,t);return!!n&&Si(n,t,r)},Ss=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Ss(e.right):void 0,Sl=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Sl(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=Ss(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=ey(t.sourceCode.getScope(n),n.typeName),s=a?.defs[0],l=s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&Sl(s.node.typeAnnotation,t,r);return r.delete(n.typeName.name),l},Su=(e,t,r=new i)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?Su(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?Su(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?Sl(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>Sl("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=Ss(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return Sl(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=ey(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=Su(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,Sp=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Sp(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"===Ss(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=ey(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&Sp(o.node.typeAnnotation,t,r)},Sc=(e,t,r,n=new i)=>{if(!e||r0.has(e.intrinsicName)||r1.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>Sc(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Sc(o,t,r,n);let a=r2(e);if(a&&r3(a,r)&&"ReadonlyArray"===a.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||r8(e,t).some(e=>Sc(e,t,r,n))},Sd=(e,t)=>{if(DH.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===Ss(r.typeName)||Sp(e.typeAnnotation,t)||Sd(e.expression,t)}if("Identifier"!==(e=rj(e)).type)return!1;let r=ey(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&Sp(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&Sd(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return Sc(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},Sm=(e,t,r=new i)=>{if(r.has(e))return!1;if(r.add(e),DH.has(e.type))return Su(e.typeAnnotation,t)??Sm(e.expression,t,r);if("Identifier"===(e=rj(e)).type){let n=ey(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=Su(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&Sm(o.node.init,t,r))return!0}return nE(e,t)},Sf=(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(tm(s,{optional:!1},tp)&&tT(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],tT(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rj(o),a=rj(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&ey(n.sourceCode.getScope(o),o)===ey(n.sourceCode.getScope(a),a)))))return s.callee.object},Sg=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tm(r,{minimumArguments:2,maximumArguments:3,optional:!1},tp)&&tT(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===tn(rj(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rj(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 DY.has(t)})))return{call:r,sourceSignal:r.callee.object}},Sy=(e,t)=>!r$(t,t.sourceCode.getRange(e))&&!rN(t,e),Sh=(e,t,r,n)=>{let o=ey(n.sourceCode.getScope(r),e);return o&&o!==t},Sx="prefer-block-statement-over-iife",Sb=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,SE=(e,t)=>e!==t&&tv(e),Sv=(e,t)=>SE(e,t)&&"ArrowFunctionExpression"!==e.type;function SC(e,t,r,n=SE){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 SD=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,eE(o)?t.getRange(o)[1]:n]},SS="no-multiple-promise-resolver-calls",ST=e=>rI(e)||e?.type==="TSInstantiationExpression";function SA(e){for(;ST(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function Sw(e){for(;ST(e);)e=e.expression;return e}let Sk=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=SA(e);return tf(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&of(r.parent.callee,t)},SI=e=>e.references.some(e=>e.isWrite()),Sj=({resolverUncalled:e=!1,resolverCalled:t=!1,catchClausesAfterResolverCall:r=new i,pendingFinallyBlocksByCatchClause:n=new o}={})=>({resolverUncalled:e,resolverCalled:t,catchClausesAfterResolverCall:r,pendingFinallyBlocksByCatchClause:n}),SF=e=>Sj({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)}),SB=(e,t,r)=>{if(t.executor===r){let r=SF(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=SF(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 SR(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let SP=(e,t)=>void 0!==t&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&SR(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||!SR(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function SL(e,t,r){let n=Sj({resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return Sj();let o=n.catchClausesBySegment.get(r);return o?Sj({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??Sj(),o,e,r);for(let e of(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 SN=e=>{let t=Sw(e.test);return t?.type==="Literal"&&!t.value},S$=e=>{let t=SA(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t},SM="no-unnecessary-string-trim",SO=["startsWith","endsWith"],SU=new i(["bigint","boolean","number","string","undefined"]),Sq=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),SV=(e,t)=>e$(e=rj(e),t.sourceCode.getScope(e)),SW="no-useless-re-export",S_=e=>"Identifier"===e.type?e.name:e.value;function Sz(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let SK={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return SK}},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"}},comment:{name:"@eslint-sukka/eslint-plugin-sukka-full comments preset",plugins:{get sukka(){return SK}},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"]}},recommended:{...c.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return SK}},rules:Object.assign({"sukka/prefer-single-boolean-return":"off","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))},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return SK}},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-code-point":"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"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return SK}},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 SK}},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/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 SK}}}},rules:Object.assign(c.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":L,"browser/prefer-location-assign":$,"jsx/no-template-literal":O,"jsx/no-unneeded-nested":U,"string/no-locale-case":V,"string/no-simple-template-literal":W,"unicode/no-bidi":Y,"unicode/no-invisible":Q,"no-redundant-variable":Z,"no-single-return":et,"prefer-early-return":en,"prefer-fetch":eo,"prefer-timer-id":es,"string/no-unneeded-to-string":el,"type/no-force-cast-via-top-type":eu,"type/no-wrapper-type-reference":ec,"no-default-error":ed},Object.fromEntries(Object.entries({"unicorn/catch-error-name":cz,"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>dn(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return dn(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||!c1(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:cK,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[cK]:"Exported error name should match error class",[cG]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[cJ]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[cX]:"Error constructors should accept `options` as the second parameter.",[cY]:"Error constructors should use `options` as the second parameter.",[cH]:"Pass the error message to `super()` as the first argument.",[cQ]:"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||e7(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:aa}:void 0:{node:t,messageId:ai,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[aa]:"Do not nest ternary expressions.",[ai]:"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!!(al.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)&&au(e.parent.parent)&&ap(e.parent.parent.parent.init))||!!(au(e)&&tT(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&ap(e.parent.init.object))}(ey(r,t)?.defs[0]?.name))return{node:t,messageId:as}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[as]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(af.has(t.name)){for(let r of ab(e,t))if(r.references?.some(e=>ax(t,e.identifier)))return aE(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&af.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 ab(e,t))if(aC(t.key,r))return aE(t.key,r);for(let r of ab(e,t))if(av(t.key,r))return aE(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ad]:"Use `.key` instead of `.{{name}}`.",[am]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tT(t,{property:"innerText"})||nR(t.object,e))return;let r=t.property;return{node:r,messageId:aD,suggest:[{messageId:aS,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(nR(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&nR(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&nR(r.right,t)})(t.parent.parent,e))return{node:t,messageId:aD,suggest:[{messageId:aS,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:{[aD]:"Prefer `.textContent` over `.innerText`.",[aS]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"join",argumentsLength:0,optionalCall:!1})||tw(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tL(t.callee.object,{property:"join"}))||0===t.arguments.length&&nD(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:a_,fix:r=>aA(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[a_]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of aY)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:{[az]:"Do not add `then` to an object.",[aK]:"Do not export `then`.",[aG]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tw(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:ew(r,e.sourceCode),messageId:aH}:{node:r.callee.property,messageId:aH}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[aH]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":a6,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tf(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(n_(r,t))return"alloc";let n=e$(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:a9,data:{method:n},fix:a7(r,e,n)}:{node:r,messageId:a5,suggest:["from","alloc"].map(t=>({messageId:a4,data:{replacement:t},fix:a7(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:{[a9]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[a5]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[a4]:"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:o4(l,e),messageId:ie,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tw(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(!tt(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&it(o)&&(yield r(i,n,"leading")),e!==a-1&&ir(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:{[ie]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":ia,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tx(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:ii,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=e7(i,e),[,l]=s?e5(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield aT(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[ii]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new i,n=new i,o=new i,a=new i;e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tT(e.left,{property:"length",optional:!1})&&tN(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("CallExpression",t=>{tw(t,{optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===t.callee.property.type&&!nv(t.callee.object,e)&&("some"===t.callee.property.name?o.add(t):"every"===t.callee.property.name&&a.add(t))}),e.on("LogicalExpression",e=>{tN(e)&&t.push(e)}),e.on("Program:exit",function*(){let s=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,i,s)=>(function({node:e,operator:t,siblings:i}){return"||"===t&&r.has(e)&&i.some(t=>a.has(t)&&rC(e.left.object,t.callee.object))||"&&"===t&&n.has(e)&&i.some(t=>o.has(t)&&rC(e.left.object,t.callee.object))})({node:e,operator:t,siblings:[s[i-1],s[i+1]].filter(Boolean)}))})(e))),{sourceCode:l}=e;for(let t of s)yield{loc:{start:l.getLoc(t.left.property).start,end:l.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=e5(n,e),i=e5(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}=is(t);if(!(tw(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(tv(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}=is(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}=is(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?e5(e,a):o&&"YieldExpression"===t.type?e5(t,a):"ArrowFunctionExpression"===t.type?o?e5(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!rL(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=il(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(e5(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(e5(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(e5(e,r),(n=il(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>oX(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(!to(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:o4([p-(r.length-s.length),p],e),messageId:l?ip:iu,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&oH.test(s)&&!e7(t,e)&&(n=`(${n})`,oD(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield aP(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[iu]:"Don't use a zero fraction in the number.",[ip]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":iE,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tE,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&&iD.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&&iS(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&iS(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:ew(t,n),messageId:iv,data:{functionNameWithKind:eU(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:{[iv]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){iI.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[ik]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":iR,"unicorn/prefer-array-index-of":iU,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tw(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:iq,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:{[iq]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tw(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&iz(e.callee.object)){let t=e.callee.property;return iK(e,{node:t,messageId:iW,data:{method:t.name}})}if(tm(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},tp)&&iz(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?iK(e,{messageId:i_}):iK(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&iz(t.argument))return iK("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&iz(e.right))return iK(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])iz(t)&&(yield iK(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[iV]:"Prefer `Date.now()` over `new Date()`.",[iW]:"Prefer `Date.now()` over `Date#{{method}}()`.",[i_]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":i2,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tw(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=i7(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rC(e.left,e.right)||"**"===e.operator&&te(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:i3,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 aW(t,",",a,e),yield aT(r,a,e)}for(let t of r)yield a.removeRange([e5(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 i4){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:{[i3]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":sr,"unicorn/prefer-number-properties":sl,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tw(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"===eO(e.callee)&&2===e.arguments.length&&sp(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,sc(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eO(e.callee)&&"apply"===eO(e.callee.object)&&"prototype"===eO(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&sp(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,sc(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:su,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[su]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tT(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:tw(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&nk(n,e))return{node:t.property,messageId:sd,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);oZ(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield aP(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[sd]:"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(!tw(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tw(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(or(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=tn(o);if("string"==typeof i){if(0===i.length)return;r=tK(i)}else if(!(r=(e=>{if(!ta(e)||e.regex.flags.includes("y"))return;let t=sw(e);if(!t||sj(t)||0===sI(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=tn(a);if("string"==typeof s)return`${e4(n.callee.object,t)}.replaceAll(${r}, ${tK(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:sE,fix:e=>e.replaceText(t,o)};if(!tw(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tw(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&ta(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||!sy.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&tt(n=t.arguments[1])&&n.value===sg)return;let{arguments:a,callee:{property:s}}=t;if(or(t.callee.object,e))return;let[l]=a;if(!((e,t)=>{if(ta(e))return e.regex.flags.includes("g");if(tf(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=e$(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(!ta(e))return;let t=sw(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(sv.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?sA(t.body):sT(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:sb,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:sx,*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:{[sx]:"Prefer `String#replaceAll()` over `String#replace()`.",[sb]:"This pattern can be replaced with {{replacement}}.",[sE]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["substr","substring"]})||or(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tw(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(sF(t)&&sF(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&te(e.right,1))return e.left})(t);return sB(r,t)??(sB(t,r)?r:void 0)??(n&&rC(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=e$(a,s.getScope(e)),u=e5(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(to(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!sP(e.left)||!("Identifier"===t.type||tt(t))||!rC(e.left.object,t)||(o=((e,t)=>{let[r,n]=e5(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 ak(t,i,n,r));if(to(i)||sP(i))return;let o=sR(i);return"number"==typeof o?void(yield ak(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>to(e))){let e;return void(yield(e=String(a.value+i.value),ak(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?sR(o):void 0;if(!a){if(sP(o))return;if(void 0!==i)return void(yield ak(t,o,String(Math.max(0,i)),r));let e=e5(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=sR(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 ak(t,o,String(e[0]),r)),e[1]!==s&&(yield ak(t,a,String(e[1]),r));return}if(0===i||0===s){let e=e4(o,r),n=e4(a,r);yield ak(t,o,"0",r),yield ak(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(!tw(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||or(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:sL,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:{[sL]:"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||!e7(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:o4(e5(r,e),e),messageId:sN};return!function(e,t){let{sourceCode:r}=t,[n,o]=e5(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:s$,fix:t=>t.replaceTextRange(e5(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[sN]:"IIFE with parenthesized arrow function body is considered unreadable.",[s$]:"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||rY(r))&&("Identifier"===r.type&&sO.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&sO.test(r.property.name))&&!tT(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:sM,fix:r=>aL(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[sM]:"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(tt(e))return s_({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(ta(e))return s_({node:e,original:e.raw,regex:sW,lowercase:t})}),e.on("TemplateElement",r=>{if(!tR(r.parent))return s_({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>aV(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:{[sU]:"Use uppercase characters for the value of the escape sequence.",[sq]:"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=>tt(e)?s6(e,e.raw):ta(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}=s8(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(sG,t))return;let n=t+sG.length;for(;r=e[n],sJ.test(r);)n++;if(n===t+sG.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+sG.length,n),16);if(!(o>1114111))return o}(e,t)&&sQ(e,t))return!0;return!1}(n);if(!s&&(l||!u))return;let p=`/${s?i:n}/${s9(o)}`;return l?{node:e,messageId:sz,fix:t=>t.replaceText(e,p)}:!function(e,t){try{return new a(e,t),!0}catch{return!1}}(s?i:n,s9(o))?{node:e,messageId:sz}:{node:e,messageId:sz,suggest:[{messageId:sK,fix:t=>t.replaceText(e,p)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tR(t.parent))return s6(t,t.value.raw,(r,n)=>aV(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:{[sz]:"Prefer Unicode code point escapes.",[sK]:"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 e1(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(s5.map(e=>[e,{[e1.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tw(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tw(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(!tT(e,{optional:!1}))return;let n=e.object;if(th(n)||tx(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eO(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(tT(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield aP(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(!(tm(t,{names:s4,optional:!1},td)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=lr.has(r)?lr.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:s7,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:lt};let i=e$(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:lt}:""===s?{node:a,messageId:le}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[s7]:"Pass a message to the `{{constructorName}}` constructor.",[le]:"Error message should not be an empty string.",[lt]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":lc,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tf(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&lb(t.test)))return;let r=e.argument.callee;return{node:r,messageId:ld,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[ld]:"`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=rj(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?ey(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?lD(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&&ey(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?lD(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||tm(o.parent,void 0,td)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||nL(o))return;let i=rj(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&&ey(l,u),c="ThisExpression"===i.type?lD(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(lA({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})&&(n=lT(r.objectPattern.properties.filter(e=>lS(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!lI(n);){if(lk(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:lE};let m=t.getText(e),f=n.value.name;return{node:e,messageId:lE,suggest:[{messageId:lv,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:{[lE]:"Use destructured variables over properties.",[lv]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{lL.listen({context:e}),lN.listen({context:e}),l$.listen({context:e}),lM.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.",[lB]:"Use `String(new Date())` instead of `Date()`.",[lR]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":l_,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tw(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tj(e)&&lK(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&lK(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tw(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:lz}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[lz]:"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(!!l2(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:l0,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(l2(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tW(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 aF(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);tW(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield aF(o,t,r);let a=l2(e)?n.getLastToken(e):n.getTokenAfter(e),i=eE(a);if(l2(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,l1);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:{[l0]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":l6,"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)||tm(r.parent.parent,void 0,td)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:l9,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:ul[a]}};return"NewExpression"===a&&us(r)&&tf(n.parent,{names:uo,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield aT(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eb(u)&&(yield i.remove(u)),th(r)||tx(r)){let e=t.getTokenAfter(n);eb(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 eb(e)?e:void 0}let a=t.getTokenAfter(e||s,eb);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(!tw(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:ut};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:un,fix:t=>t.replaceText(r,r.properties.map(t=>e4(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tf(e,{names:uo,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:ue,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!us(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tf(r,{names:uo,argumentsLength:1})||tf(r,{names:rZ,minimumArguments:1})||tw(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{objects:["Array",...rZ],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=l5;switch(r.type){case"ForOfStatement":o=l4;break;case"YieldExpression":o=l7;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=>uu(r,t,e)}}),e.on("ArrayExpression",t=>{if(!us(t))return;let r=t.elements[0].argument,n=!!tw(r,{methods:ui,optionalCall:!1,optionalMember:!1})&&nE(r.callee.object,e)&&nE(r,e);if(!n&&!(!nv(r,e)&&(tw(r,{methods:ua,optionalCall:!1,optionalMember:!1})?!up(r,e):tw(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||up(r,e)):tw(r,{method:"split",optionalCall:!1,optionalMember:!1})||tw(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tw(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tf(r,{name:"Array"}))))return;let o={node:t,messageId:ur};return tf(r,{name:"Array"})||tw(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>uu(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l9]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[l5]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[l4]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[l7]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[ue]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[ut]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[ur]:"Unnecessarily cloning an array.",[un]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rz(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(!um(o))break;t&&uf(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ev);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:uc,suggest:[{messageId:ud,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uc]:"Useless case in switch statement.",[ud]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":uP,"unicorn/numeric-separators-style":uM,"unicorn/prefer-array-find":u6,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tw(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)&&tw(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tB(r.callee.object,u7)||nD(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=rL(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield aM(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:u9,fix:a}}),e.on("CallExpression",t=>{let r;if(!tw(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tw(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||rY(n.callee.object)||nv(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!pt(a)||!pt(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!om(s,l))return;let u=function(e,t){if(e7(e,t))return e4(e,t);let r=t.sourceCode.getText(e);return oZ(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(e7(e,t))return e4(e,t);let r=t.sourceCode.getText(e);return pe.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:u5,suggest:[{messageId:u4,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:{[u9]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[u5]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[u4]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":pp,"unicorn/prefer-array-some":pf,"unicorn/prefer-code-point":{create:e=>{e.on("CallExpression",e=>{if(tw(e,{method:"charCodeAt",optionalCall:!1}))return pg(e.callee.property,"codePointAt",!(e=>{let t=(e=>{let t=e;for(;;){let{parent:e}=t;if("ChainExpression"===e.type||"LogicalExpression"===e.type||"ConditionalExpression"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return t}})(e),{parent:r}=t;switch(r.type){case"BinaryExpression":return py.has(r.operator);case"UnaryExpression":return ph.has(r.operator);case"AssignmentExpression":return r.right===t&&py.has(r.operator.slice(0,-1));default:return!1}})(e))}),e.on("MemberExpression",e=>{if(tT(e,{object:"String",property:"fromCharCode",optional:!1}))return pg(e.property,"fromCodePoint")})},meta:{type:"suggestion",docs:{description:"Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{"error/charCodeAt":"Prefer `String#codePointAt()` over `String#charCodeAt()`.","error/fromCharCode":"Prefer `String.fromCodePoint()` over `String.fromCharCode()`.","suggestion/codePointAt":"Use `String#codePointAt()`.","suggestion/fromCodePoint":"Use `String.fromCodePoint()`."},languages:["js/js"]}},"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=ey(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(pv(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:px,suggest:[{messageId:pb,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(tE,e=>{r.push(e)}),e.onExit(tE,()=>{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:{[px]:"Prefer default parameters over reassignment.",[pb]:"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=pF(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=pF(e.left),o=pF(e.right);if(n&&o&&pk(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&pB(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&pB(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&&pk(i,o,t.sourceCode))return pI({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&pk(i,n,t.sourceCode))return pI({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tP(s)||!tT(l)||l.optional||!rC(rj(i),rj(l.object))||function(e){let t=e,{parent:r}=t;for(;rI(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=rV(e,t);if(r$(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:pD,suggest:[{messageId:pT,fix(r){let n=u;return oD(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(pk(n,o,t)?pI({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&pk(n.argument,a,t)?pI({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:{[pC]:"Prefer using a logical operator over a ternary.",[pD]:"Prefer using optional chaining over a ternary.",[pS]:"Switch to `{{operator}}` operator.",[pT]:"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?pR:pP,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tW(t,{test:eC,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tW(o,{test:eD,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:{[pR]:"Remove unused catch binding `{{name}}`.",[pP]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":ce,"unicorn/prefer-set-has":cf,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!tt(t)||function(e){let{parent:t}=e,{type:r}=t;return tg(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)||cg(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=cx(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:cy,*fix(r){yield aP(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)||cx(t)!==e)||cg(t)))return{node:t,messageId:cy,*fix(r){for(let n of(yield aP(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield aV(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tT(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:ch,*fix(r){let n=a.getTokenBefore(t);oD(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||op(n,t.quasi,e)||e7(t,e)||(yield aj(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||op(n,t.quasi,e)||e7(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield aT(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:{[cy]:"`String.raw` should be used to avoid escaping `\\`.",[ch]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":cT,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tw(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:cA,fix:r=>aA(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[cA]:"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 cF(cR(e.lines,t)).indent||cF(cw(r=cR(n.split(/\r?\n/)))).indent||cF(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=cw(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+function(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))}(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:cB,fix:t=>g.split(s).map((r,n)=>aV(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!!(cg(e)||r.tags.length>0&&tR(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tB(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:cP,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[cB]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{object:"Promise",methods:lY,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:lG,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tb(t.parent.parent)))return n.fix=r=>r.replaceText(t,lH(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(lQ(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&&lZ(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&lZ(t.left)&&tb(t.parent)?t.left:void 0})(n);if(o){if(lQ(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,lH(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&te(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!lQ(r,a))return r=>r.replaceText(a,`await ${lH(e,t)}`)})(t,e),n):(n.suggest=[{messageId:lJ,fix:r=>{let[n]=t.arguments[0].elements,o=e4(n,e);return e7(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),oD(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:lX,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),eb(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:{[lG]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[lJ]:"Use the value directly.",[lX]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tw(t,{object:"Promise",methods:c$,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:cL,data:{method:t.callee.property.name},suggest:[{messageId:cN,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield aF(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cL]:"Promise in `Promise.{{method}}()` should not be awaited.",[cN]:"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&&cU.has(t.operator)&&cq(n))||cq(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:cM,suggest:[{messageId:cO,data:{operator:i},*fix(s){yield aP(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!e7(t,e)&&(op(o.getFirstToken(u),l,e)||(yield aj(s,u,e))),yield s.remove(a),oD(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:{[cM]:"Negated expression is not allowed in equality check.",[cO]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){cV(e,{methods:["slice"],messageId:cW})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[cW]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(di(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&di(t.parent.parent)&&t.parent.parent.consequent===t.parent||di(t.parent)&&t.parent.consequent===t))return{node:t,messageId:da,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,...ds(i,r)},l={...e,...ds(e,r)},u=dc(s,r),p=dd(s,t,r),c=dp(du(dc(l,r)),dd(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(eA(a)){let t=n.getTokenAfter(e);t&&oD(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?du(dl(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?du(dl(s.openingBraceToken,l.ifToken,r)):du(dl(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?du(dl(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:du(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:du(dp(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=dl(t.closingParenthesisToken,t.openingBraceToken,n),r=dl(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=dl(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:{[da]:"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(!tw(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!to(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rx(t,e);if(!n.commentsExistBetween(o,a))return{node:r,messageId:dm}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[dm]:"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:df,*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 aT(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=e5(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 aP(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||op(i,s,e)||e7(t,e)||e7(r,e)?oD(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield aj(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[df]:"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&&tv(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:dg,data:{parameter:t.name}}:{node:r,messageId:dy}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[dg]:"Do not use an object literal as default for parameter `{{parameter}}`.",[dy]:"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(dx.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=db(t.object),!dx.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=dx.get(n),l=t.object.object;if(th(l)||"slice"===n&&te(l,"")||"prototype"===db(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}=dx.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=rj(t);if("BinaryExpression"!==o||"-"!==a||!(to(n=rj(s))&&n.value>0))return;let l=rj(i);return"MemberExpression"===l.type&&!l.computed&&!l.optional&&"Identifier"===l.property.type&&"length"===l.property.name&&ux(l.object,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:dh,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=e5(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:{[dh]:"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||(tw(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tj(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(dD)&&dv(r)&&dv(`${dD}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:dC,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],dD)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[dC]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tf(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tw(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:dS,fix:t=>aM(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[dS]:"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)&&dA(n.key)&&("get"===n.kind&&(dk(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&&dw(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!dk(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:dT,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[dT]:"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(!tT(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(dB(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tf(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&&dB(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&&dB(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(dR(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=ey(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;dR(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?dI:dj,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:{[dI]:"Do not construct dirname.",[dj]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&te(t.arguments[0],1)))return;let[r]=t.arguments;return{node:r,messageId:dP,fix:t=>aw(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[dP]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){cV(e,{methods:["splice","toSpliced"],messageId:dL})},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:{[dL]:"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&&s4.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))&&tw(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||tT(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=ey(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:dN},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:{[dN]:"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:d$};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 eE(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=rw(n,e),c=`${p}${a} = ${i};
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};
48
48
  `;"\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:dM,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:{[d$]:"Prefer class field declaration over `this` assignment in constructor for static values.",[dM]:"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(!tm(t,{name:"BigInt",argumentsLength:1,optional:!1},tp))return;let[r]=t.arguments,n=function(e){let t,r;if(tt(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:dO},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!e7(t,e)&&s<0n&&(n=`(${n})`,oD(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:dU,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:{[dO]:"Prefer using bigint literal over `BigInt(…)`.",[dU]:"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=>!dK(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&dG(o,a))return d_(r,function*(n){let i=e4(o.callee.object.object,e),s=e4(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=dJ(p,u,o),d=c?"":dz(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+=";"),oD(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield aP(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>tt(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&&dW(t.parent.object)&&tm(t.parent.parent,{optional:!1,argumentsLength:1},tp)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return d_(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=dJ(i,a,o)?"":dz(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield aN(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:{[dq]:"Prefer using `Element#classList.toggle()` to toggle class names.",[dV]:"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:dX,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)&&tx(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:dX,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(eb(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,eb),...t.getTokens(a),...e9(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:{[dX]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of d5)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=ar(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):ey(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:{[dY]:"Immediate mutation on {{objectType}} is not allowed.",[dH]:"{{operation}} the elements to the {{assignType}}.",[dQ]:"Move this property to the {{assignType}}.",[dZ]:"{{description}} the {{assignType}}.",[d0]:"Move the element to the {{assignType}}.",[d1]:"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(!tf(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=th(r=i)?"empty array":te(r,"")?"empty string":ti(r)?"`null`":tP(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=e7(o,e),[,s]=a?e5(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield aT(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>aw(t,i,e);let u={node:i,messageId:d4,data:{description:s}};return l?u.suggest=[{messageId:d7,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:{[d4]:"The {{description}} is useless.",[d7]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tf(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tw(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:me,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield aB(t,e,n);let[o]=r.arguments,a=e5(r,e),i=e5(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!e7(t,e)&&e7(t.callee,e)&&oD(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:{[me]:"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=>E.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>mA[e].fn);e.on(rK,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=v.relative(r,v.resolve(r,t)))||".."===l||l.startsWith(`..${v.sep}`)||v.isAbsolute(l)?[v.basename(t)]:l.split(v.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=v.extname(e),n=v.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}=mj(e);if(e.startsWith("$")||mw(a,r))return;let i=mk(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:my,data:{directory:e,chosenCases:mF(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),mE.format(n))}}}(e,n,s);if(t)return t}if(mb.has(c))return;let{leading:g,words:y}=mj(d);if(d.startsWith("$")||mw(y,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:mh,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let h=mk(y,s,{leading:g,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:mg,data:{chosenCases:mF(n),renamedFilenames:(u=h.map(e=>`\`${e}\``),mE.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:mB,defaultOptions:[],messages:{[mg]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[my]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[mh]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tR(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:mR,fix:r=>aV(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[mR]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tf(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tf(t,{names:rZ,minimumArguments:1}))||!mX(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?mY(r,e):void 0,o=t.arguments.length>1?mH(r,e,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tw(e,{objects:["Array",...rZ],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?mY(r,t):void 0,o=e.arguments.length>1?mH(r,t,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tw(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?mY(r,t):void 0,o=e.arguments.length>1?mH(r,t,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tw(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=mH(r,t,mz);return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tw(e,{methods:mG,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tw(e,{method:mJ,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!mX(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===mJ;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=mO(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=mH(s,t,mK,{method:a});return{node:s.callee.property,messageId:m_,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!mX(t.right))return;let r=mY(t.right,e);return{node:t.right.callee.property,messageId:mq,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!mX(t.argument))return;let r=mY(t.argument,e);return{node:t.argument.callee.property,messageId:mV,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!mX(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=mY(t.argument,e);return{node:t.argument.callee.property,messageId:mW,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mU]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[mq]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[mV]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[mW]:"Spread works on iterables, `.toArray()` is unnecessary.",[m_]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[mz]:"Remove `.toArray()`.",[mK]:"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(;rI(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tq(t,r)||tV(t))return!0;let{parent:n}=t;return rI(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rj(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:m2(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||m2(n=e)||function e(t){let r=rj(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>m2(t)||m1(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rI(t)){let e=rj(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]=e5(o,r),[,s]=e5(a,r),l={range:[i,s]};return eT(n.getTokenBefore(l,{includeComments:!0}))||eT(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=e7(e,t),a=o?e4(e,t):t.sourceCode.getText(e);return!o&&o3(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?mQ:mZ,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[mQ]:"Prefer this simple condition first in the `{{operator}}` expression.",[mZ]:"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(!m8.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:m3,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=>eT(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||rN(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rw(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:{[m3]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(fa(e)){if(fo(e.object,"childNodes"))return"childNodes";if(fo(e.object,"children"))return"children"}})(t);if(!n||oa(t.object.object)||"children"===n&&fo(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tT(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&fo(t.parent,"children")&&fa(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:m6,suggest:fs(t,"firstChild",fe,e)}:"children"===n&&0===o?{node:t,messageId:m9,suggest:fs(t,"firstElementChild",ft,e)}:"children"===n?{node:t,messageId:m5}:void 0}),e.on("MemberExpression",e=>{if(!(!fl(e)||!fl(e.object)||!(!fl(e.parent)||e.parent.object!==e)||oa((e=>{for(;fl(e);)e=e.object;return e})(e))))return{node:e,messageId:m4}}),e.on("CallExpression",t=>{if(!fp(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&fp(t.parent.parent)&&fu(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(;fp(e);){let[r]=e.arguments;if(!fu(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||oa(e))return;let r=[];for(let e of t)r.unshift(tn(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:m7,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(fi(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=e4(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(${tK(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:fr,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[m6]:"Prefer `.firstChild` over `.childNodes[0]`.",[m9]:"Prefer `.firstElementChild` over `.children[0]`.",[m5]:"Consider `.querySelector()` over positional child traversal.",[m4]:"Consider `.closest()` over chaining `.parentElement`.",[m7]:"Consider merging chained `.querySelector()` calls.",[fe]:"Switch to `.firstChild`.",[ft]:"Switch to `.firstElementChild`.",[fr]:"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?{...fy,...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(fx(n)),r.push(fx(an(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${fb}`,"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=fE(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&&tj(o.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||fm(l)))||!(!oy(l.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||fm(l)))||!t.checkShorthandProperties&&ob(l.name))return;let u=[...r.references.map(e=>e.from),r.scope],p=rF(s)?ry(s,u,a):void 0,c=fv(l.name,p??s);if(p&&rJ(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!fc.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:fg,data:{replacement:p},fix:t=>aq(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=fE(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||fd.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=fv(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 rp(e.sourceCode.getScope(r)))p(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:fC,defaultOptions:[{}],messages:{[ff]:"Prefer `{{replacement}}` over `{{name}}`.",[fg]:"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(!tf(e,{name:"File",minimumArguments:2,maximumArguments:2})||!fT(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===tn(n))return;let[o]=r.elements;if(function(e,t,r){let n=fA(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tf(o,{name:"Blob",maximumArguments:1})||tf(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&fT(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=ey(r.getScope(n),n);if(!i)return;let s=rJ(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tw(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&fT(n.callee.object,t)?{call:n,kind:"blobArgument"}:tw(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=fA(n.callee.object,t)?.init,tf(r,{name:"FormData",argumentsLength:0})&&fT(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 ey(n.getScope(e),e)===ey(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)||rN(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:fD,suggest:[{messageId:fS,*fix(n){yield aO(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:{[fD]:"Use the original `Blob` instead of converting it to a `File`.",[fS]:"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(!tw(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=fI(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tw(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?fj(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&fj(o.property.name))))return{node:a,messageId:fw}}),e.on("CallExpression",e=>{if(!tw(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tw(fI(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:fw}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[fw]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=oQ(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?fF:-1===Math.trunc(oQ(e))&&0===r?fB:void 0}(t.arguments);if(!r)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=e4(o,r),p=n.getText(i),c=n.getText(s);if(t===fF){if(fN(e,n))return;if("toSpliced"===l){var d,m;if(0>Math.trunc(oQ(i))||(d=i,m=o,d=rj(d),m=rj(m),"MemberExpression"===d.type&&!d.optional&&!d.computed&&"Identifier"===d.property.type&&"length"===d.property.name&&ux(d.object,m)))return;return{messageId:fR,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&fL(o)&&(oQ(i)??0)>=0?{messageId:fR,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===fB&&fL(o)&&!fN(i,n))return{messageId:fP,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:{[fF]:"Prefer a direct element replacement instead of `{{method}}()`.",[fB]:"Avoid using `{{method}}()` to insert at `-1`.",[fR]:"Use direct element replacement.",[fP]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tf(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return rA(n.elements,e).map(e=>({node:e??n,messageId:f$,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[f$]:"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(!fz(r)||fG(r))return;let n=r.object;if(!fJ(r,n,t,e))return fH(r,n,e)}),e.on("CallExpression",r=>{let n;if(fK(r)){if(fG(r))return;let n=r.callee.object;if(fJ(r,n,t,e))return;return fH(r,n,e)}let o=fY(r,e);if(o)return o;if(f_(r)&&!(fz(n=r.parent)||fK(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&fK(r.parent.parent))){let e;if(e=tn(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:fO}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(fZ(e,f_,r))return{node:e,messageId:fq}})(r,e)??((e,t)=>{let r=fZ(e,fW,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tP(r.value))return{node:e,messageId:fV}})(r,t)),e.on("Identifier",t=>fY(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[fM]:"Prefer `.querySelector()` when only the first match is used.",[fO]:"Prefer `.querySelector()` for a simple ID selector.",[fU]:"Check `.length` instead of the `NodeList` object itself.",[fq]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[fV]:"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"!==f4(t.name))return;let r=((e,t)=>{if(t?.value){if(tt(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return ge(e,t.value.expression)}})(e,f7(t,"type"));if(r?.toLowerCase()!=="file")return;let n=f7(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(tt(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=ge(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return gs({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=gi(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=gi(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}:f6.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 gs({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:{[f0]:"Invalid file input `accept` value: {{reason}}",[f1]:"The file input `accept` value must be static.",[f2]:"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=gc(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tT(e,{property:"currentTarget"})||!gl.test(e.object.name))return;let n=ey(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=gu(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?gm:gd,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[gd]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[gm]:"`{{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&&gg(o.alternate,a,t)?gx(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&gg(o,a.consequent,t)?gx(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:{[gf]:"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?eO(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!gE.has(r)||!(e=>{for(;;){if(oE(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===gC||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=ey(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 gC;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!nE(n.name.typeAnnotation,t)?gC: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?nE(e,t)?void 0:gC:n.node.init??gC}return gC}(t,r);return o===gC?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?gC:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?nE(t,r)?t:gC:t}(e,r);return!!(tm(n=o,"expect",tp)||tw(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===gC||!nE(o,r):o===gC||((e,t)=>{let r,n;return gS(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&&!gS(e.callee,"Array",t)||(r=e,n=t,tm(r,gD,tp)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&gv.test(o.name)&&!nE(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:gb,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[gb]:"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(!tw(r,{methods:gw.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tw(n,{methods:gk,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=gw.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:gT,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:gA,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield aM(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:{[gT]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[gA]:"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||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t))){if(te(e.right,0))return{value:e.left,operator:e.operator};if(te(e.left,0))return{value:e.right,operator:gF[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&g$(a,n)&&rC(i,n)||(">"===o||">="===o)&&rC(a,n)&&g$(i,n))return n}(t,e);if(!r)return;let n=gV(r)?function*(n){yield aP(n,t,e),yield n.replaceText(t,`Math.abs(${gU(r,e)})`)}:void 0;return gq(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=gM(e.left,t),n=gO(e.right,t);if(r&&n&&rC(r.value,n.value)&&gB[r.operator]===n.operator&&g$(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=gM(e.right,t),a=gO(e.left,t);if(o&&a&&rC(o.value,a.value)&&gB[o.operator]===a.operator&&g$(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=gV(n)&&gV(o)?function*(r){yield aP(r,t,e),yield r.replaceText(t,`Math.abs(${gU(n,e)}) ${a} ${e4(o,e)}`)}:void 0;return gq(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:{[gI]:"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||nL(r))return;let n=gz(r.object);if(!n)return;let o=g_(r.property,t);if(void 0!==o)return gK(r,n,o+1,e)}),e.on("CallExpression",r=>{if(!tw(r,{method:"at",argumentsLength:1}))return;let n=gz(r.callee.object);if(!n)return;let o=g_(r.arguments[0],t);if(void 0!==o)return gK(r,n,o+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return gG(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&oE(t))return gG(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[gW]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":gX,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=g8(e.left,t);if(r&&rC(e.right,r.targetNode)&&!gZ(e.right,t)){let n=g2({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return g9({node:e,method:"padStart",replacement:n&&g6({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=g8(e.right,t);if(n&&rC(e.left,n.targetNode)&&!gZ(e.left,t)){let r=g2({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return g9({node:e,method:"padEnd",replacement:r&&g6({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tw(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=g3(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&to(a.widthNode)&&rC(a.widthNode,i)&&"Identifier"===r.right.type&&!gZ(r.right,t)){let n=g1(a.paddingNode);return g5({node:e,method:"padStart",replacement:g6({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=g3(r.right,t);if(2===e.arguments.length&&s&&to(n)&&0===n.value&&to(s.widthNode)&&rC(s.widthNode,o)&&"Identifier"===r.left.type&&!gZ(r.left,t)){let n=g1(s.paddingNode);return g5({node:e,method:"padEnd",replacement:g6({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:{[gY]:"Prefer `String#{{method}}()` over manual string padding.",[gH]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":yo,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!tt(r)||!yi.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&rp(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(yl(e)||!yu(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(e5(r,e),", {passive: true}"))}}if(tr(r,!0)||tr(r,!1))return{fix:e=>e.replaceText(r,tr(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(tt(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=rw(o,e);return","===a.value?t.insertTextAfter(a,`
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,`
51
51
  ${i}passive: true,`):t.insertTextAfter(o,`,
52
- ${i}passive: true`)}};if(tr(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:ya,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[ya]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":y$,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=y_(r),i=y_(o);if(!a||!i)return;let s=yW(a.object),l=yW(i.object);if(yz(s)&&yz(l)&&rC(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:yM,...yK(i,t)&&{suggest:[{messageId:yU,fix:e=>yJ(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:yM,...yK(i,t)&&{suggest:[{messageId:yU,fix:e=>yJ(i,t,e)}]}}:{node:i,messageId:yO,...yK(i,t)&&{suggest:[{messageId:yq,fix:e=>yG({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:{[yM]:"Remove unnecessary optional chaining.",[yO]:"Use optional chaining consistently.",[yU]:"Remove optional chaining.",[yq]:"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&&yZ.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&yZ.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&y0.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===yX&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:yH,data:{name:a},fix:r=>r.insertTextAfterRange(e5(t,e),", 0")}}if(t===yY&&2===i.length){let t=i[1];if(y1(t))return{node:t,messageId:yQ,data:{name:a},fix(r){let[n]=i,[,o]=e5(n,e),[,a]=e5(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:[yX,yY],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[yX],messages:{[yH]:"`{{name}}` should have an explicit delay argument.",[yQ]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",e=>{var t,r,n,o;if(!tw(e,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:a}=e.callee,[i]=e.arguments,s=(t=i,r=a,0>Math.trunc(oQ(t))?y2:(n=t,o=r,n=rj(n),o=rj(o),"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"length"===n.property.name&&ux(n.object,o))?y3:void 0);if(s)return{node:e.callee.property,messageId:s}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[y2]:"Avoid using a negative index with `Array#with()`.",[y3]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=mO(t.right);if(tw(r,{methods:y6,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=mO(t),tw(n,{methods:mN,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=mO(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=mO(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tw(o=t,{methods:mP,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tw(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tw(a=t,{methods:mL,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 m$)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!nE(i,r)&&mM(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:y8,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:{[y8]:"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=o7(e);e.onExit("Program",e=>ht(t,e.body,r)),e.onExit("BlockStatement",e=>ht(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:{[y9]:"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=ho(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=ho(e);"MemberExpression"===e.type;)e=ho(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=>!hn(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:hr,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[hr]:"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||!of(n.object,t)||"Identifier"!==n.property.type||!hs.has(n.property.name))return;let[o]=e.arguments,a=oM(o,t);if(!a)return;let i=n.property.name,s=`${(r=e4(o,t),oZ(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:ha,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:hi,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:{[ha]:"`Object.{{method}}()` does not return {{type}} contents.",[hi]:"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(!hc.has(r.operator))return;if(te(r.right,0)&&hm(r.left))n=r.left,o=r.operator;else{if(!(te(r.left,0)&&hm(r.right)))return;n=r.right,o=hp[r.operator]}let a={node:r,messageId:hl};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${e4(i,e)} ${o} ${e4(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(hd.has(o)?n_(i,p)&&n_(s,p):hf(i,p)&&hf(s,p))?a.fix=u:a.suggest=[{messageId:hu,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:{[hl]:"Prefer comparing the values directly over comparing the difference with `0`.",[hu]:"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=hh(t.object),u=hx(t);if("Identifier"!==l.type||"globalThis"!==l.name||!of(l,e)||nL(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||rY(n=t)||("MemberExpression"===(n=hx(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=hx(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!hv.has(t.operator))return!1;let r=hh(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tV(o)||tq(o,e))return;let p=t.computed?tt(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||!(rF(p)&&(!hb.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&hE(t)||(s=ey(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:hg,data:{name:p}};return hE(t)||"TaggedTemplateExpression"===(a=hx(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:{[hg]:"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===e$(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:hC}}),e.on("ArrayPattern",e=>{if(0!==hw(e))return{node:e,messageId:hD}}),e.on("ObjectPattern",e=>{if(3===hw(e))return{node:e,messageId:hS}}),e.on("MemberExpression",e=>{if(hA(e)?.type==="ObjectPattern")return{node:e,messageId:hT}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[hC]:"Do not use computed keys in object destructuring.",[hD]:"Do not use array destructuring inside object destructuring.",[hS]:"Do not use object destructuring deeper than two levels.",[hT]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=o7(e,t=>(function e(t,r,n){let o;if(n(t)||"ExpressionStatement"===t.type&&(o=t.expression,tw(o,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&of(o.callee.object,r)))return!0;if("BlockStatement"===t.type){let o=t.body.at(-1);return!!(o&&e(o,r,n))}return"IfStatement"===t.type&&t.alternate&&e(t.consequent,r,n)&&e(t.alternate,r,n)})(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&hI.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:hk,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rU(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&&(oD(i,t,a.value)||hB(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&&(oD(s,t,l.value)||hB(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!r$(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
- ${hF(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=hF(r,r.getRange(t)[0]),u=s&&s!==o?hF(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=hF(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:{[hk]:"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(tv(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(hN(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=>hL(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=ey(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:hR}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[hR]:"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(!tw(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tr(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:h$,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:{[h$]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tw(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 hG.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tf(t,{names:hz,argumentsLength:1})||tf(t,{names:rZ,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tw(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||hX(t,["from"])||tw(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tw(t,{object:"Promise",methods:hK,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=h_.get(r);if(!t?.includes(e))return!1}return!0})(r,h0(t.callee.object,e)))return{node:t.callee.property,messageId:hM,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aM(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[hM]:"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:h3};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:h8,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(tw(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:h1,suggest:[{messageId:h2,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tw(e,{objects:h6,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&h5(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(te(e.right,0))return h4(e.left);if(te(e.left,0))return h4(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=h7(e.left,t);if(r&&rC(r,e.right))return r;let n=h7(e.right,t);if(n&&rC(n,e.left))return n})(e,t);if(n&&h5(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[h1]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[h2]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[h3]:"Prefer `Number.isSafeInteger()` over this integer check.",[h8]:"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=xt(r);if(!n)return;let o=xt(at(r,e));if(o&&rC(o.arguments[0],n.arguments[0]))return;let a=[r],s=[n],l=ar(r,e);for(;;){let t=xt(l);if(!t||!rC(n.arguments[0],t.arguments[0]))break;a.push(l),s.push(t),l=ar(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:xe},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=e$(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=>rC(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=rw(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}]`:rF(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}, {
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}, {
56
56
  ${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:{[xe]:"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(!(xi(n)&&"Identifier"===n.value.type))return;let e=eO(n,t.sourceCode.getScope(n));if(null===e||xo.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,xa))return;let a=new o;for(let e of r.slice(0,-1)){if(!xi(e)||ez(e.value,t.sourceCode,xa))return;let r=eO(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||xs(r.value,p,e))return;c.push(xl(t,r,e))}return{node:t,messageId:xr,suggest:[{messageId:xn,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:{[xr]:"Prefer object destructuring defaults over default object literals with spread.",[xn]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>xd(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>xd(t,e.body)),e.on("SwitchCase",e=>xd(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[xu]:"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(!xg(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=>!xg(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:xm,data:{name:r.id.name}};return r.id.typeAnnotation||xh(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||xy(t,e,"before")||xy(t,e,"after")||xy(t,l,"before")||xy(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield aO(t,{sourceCode:e},a);let i=`const ${o} = `;if(xh(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:{[xm]:"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=xE.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(!tw(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let{object:n}=e.callee;if(nv(n,r))return;let o=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(o){var a;let t;return{node:e,object:n,callback:{...o,parameterText:(a=o.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],!rC(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:xx,data:{method:r},suggest:[{messageId:xb,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(e7(e,r))return e4(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):xv.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:{[xx]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[xb]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tw(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===xU(t.callee.object,e)){let r={node:t.callee.property,messageId:xC};return xV(t,e)&&!e7(t.callee,e)&&xq(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tm(t,{name:"String",argumentsLength:1,optional:!1},tp)&&of(t.callee,e)))return;let[r]=t.arguments;if("url"!==xU(r,e))return;let n={node:t.callee,messageId:xC};return xV(t,e)&&xq(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=e4(r,e),a=!e7(r,e)&&oZ(r,e)?`(${o})`:o,i=`${a}.href`,(oD(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:{[xC]:"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(!(tf(n=e,{name:"Proxy",argumentsLength:2})||tw(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=xH(e,t);if(!n)continue;let o=xQ(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",e=>{if(!(xz.has(e.parent?.type)&&e.parent.body===e))return;let t=[...n.at(-1)].every(e=>!e.reachable);r.set(e.parent,t)}),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:{[xW]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":x8,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:x6,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield aI(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=x9.get(n);if(!o||!of(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&&n_(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(te(a,"")&&on(o,e))n=o;else{if(!(te(o,"")&&on(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&&on(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:{[x6]:"{{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(!tw(r,{methods:x4,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tv(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(!tU(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&om(n.params[0],a))&&!(function e(t){return(t=rj(t),t?.type==="ChainExpression")?rY(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||r1.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:x5,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:{[x5]:"`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 tD(e)&&e.body===t}})(t))return{node:t,messageId:x7,fix:r=>aO(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[x7]:"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=eO(e,l);if("string"==typeof u&&eO(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&&eO(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=br(i,e))||!0!==oc(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=br(i,e))&&bt(t.type)))return}return{node:r.key,messageId:be,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield aW(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[be]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tw(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;by.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=bF(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&bD(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(bD(t.value,r)&&bM(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(ti(t.value)&&o&&bM(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!bD(n,t):!ti(n)))return;return{node:e.callee.property,messageId:bn,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=e4(n=e.callee.object,r),!e7(n,r)&&oZ(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((tq(e,t)||tV(e))&&bF(e.callee.object,t)?.kind==="map"&&bM(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:bn,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:{[bn]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===bU?e.on("LogicalExpression",t=>{if(bz(t)){if("&&"!==t.operator||b_(t.right)||bK(t.left,t.right,e.sourceCode))return;let r=bY(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&bK(r.reference,t.right,e.sourceCode))return;let n=bQ(t.left,e),o=bQ(t.right,e);return{node:t,messageId:bq,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(bz(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=b_(o);if(a===b_(n))return;let i=a?n:o,s=bY(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?bK(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&bK(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&bK(s.reference,i,t.sourceCode))return;let u=a?bH(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return bH(e.argument,"left",t);let r=e4(e,t);return!e7(e,t)&&o2(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=bH(i,"right",t);return{node:e,messageId:bq,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:[bO,bU]}],defaultOptions:[bO],messages:{[bq]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":Ef,"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=Eg(e.right);if(!n||!tw(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=Eg(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=Ey(n,t);if(!a||!i||i!==Ey(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&&Eg(t.node.init);return!!(r&&th(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tv(r))return;if(tD(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:Eh}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[Eh]:"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(!tw(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tB(t.callee,Eb)||nD(r,e)))return{node:n,messageId:Ex,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[Ex]:"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||!EC(t.property)||nL(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=ED(t.object,e);if(r)return ES(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(EC(n)?r="first":tk(n)&&(r="last"),!r||nL(t))return;let o=ED(t.callee.object,e);if(o)return ES(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[EE]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[Ev]:"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,!(tm(r,{minimumArguments:1},tp)&&"MemberExpression"===r.callee.type&&Ew.has(eO(r.callee,n.sourceCode.getScope(r.callee))))||nv(t.callee.object,e))return;let[o]=t.arguments;if("SpreadElement"!==o.type){let t=rj(o);if(tv(t)){let r=(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})(t);if(!n2(t,e)&&!Ej(o,e))return;return{node:o,messageId:ET,suggest:o===t?((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=rj(n=t)).type&&Ek.has(n.operator)?n:void 0;if(!i||rI(i.left)||rI(i.right)||!EI(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:EA,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(t,r,e):void 0}}return n3(t,e)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||nG.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=nJ.get(e.object.name),n=eO(e,t.sourceCode.getScope(e));return!!r?.has(n)}(t,e)||Ej(o,e)?{node:o,messageId:ET}:void 0}})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ET]:"Do not return a boolean from a sort comparator.",[EA]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!EL.has(r.operator))return;let n=EN(r.left)?r.left:r.right;if(!EN(n))return;let o=n===r.left,a=o?r.right:r.left;if(EP.has(r.operator)&&n6(a,e))return;let i={node:r,messageId:EF},s=ER.has(n.operator)===ER.has(r.operator)&&!tr(r.right);if(o&&s&&!EN(r.right)&&!EN(n.left)&&((e,t)=>{if(e7(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)} && ${e4(n.right,e)} ${r.operator} ${e4(r.right,e)}`;i.suggest=[{messageId:EB,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:{[EF]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[EB]:"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 te(e.left,0)||te(e.right,0);case"/":return te(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:E$},n=e$(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:EM,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:{[E$]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[EM]:"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)||!EW(o)||!EW(t.right)||!ux(o,t.right))return;let a={node:t.right,messageId:EO};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e5(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=e4(t.left,e),s=e=>e.replaceText(t,i);return EV.has(o.type)&&(n=t.right,EV.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:EU,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[EO]:"This operand duplicates the left operand.",[EU]:"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(Ez,t.operator))return;let i=(r=rj(t.left),n=rj(t.right),r_(r)?{memberExpression:r,operator:t.operator,value:e$(n,e.sourceCode.getScope(n))?.value}:r_(n)?{memberExpression:n,operator:Ez[t.operator],value:e$(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rj(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rj(t)).type||rY(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=e$(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tN(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&&tT(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&rW.has(r.property.name)&&rC(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:E_,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[E_]:"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(EG.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=tn(n);if(void 0!==o&&o.length>1&&EJ(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:EK,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:{[EK]:"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=o7(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=E9(n.right,e);if(o)return function* e(t,r,n,o){if(E1.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=E9(t.right,o);e&&ve(e.reference,r.iterable,o)&&(a=E4(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=eO(e.callee,n.sourceCode.getScope(e.callee));if(!(!EZ[t.collectionKind??"unknown"].has(c)||!ve(u,i,n)||"delete"===c&&vt(e,a,n)||vr(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=rj(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eO(o.callee,n.sourceCode.getScope(o.callee))&&ve(o.callee.object,r.iterable,n)&&vt(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&&vr(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:EX,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,...E4(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[EX]:"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(tw(e,{methods:vo})&&tT(e.callee.object,{property:"classList",computed:!1})&&!oa(rj(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?vp(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:vp(e.arguments.slice(0,2),"."):vp(e.arguments.slice(0,1),".")}if(tw(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!oa(rj(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return vp(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rj(r),o=vl(e);vs(o)&&(yield vu(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[vn]:"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(!vf.has(r.operator)||!to(r.right)||r.right.value!==vf.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:vc,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:vc,data:n,suggest:[{messageId:vd,fix:t=>aO(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:vc,data:n,suggest:[{messageId:vm,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:{[vc]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[vd]:"Remove the useless assignment.",[vm]:"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&&rC(o.right,a.object)&&vA(o.right,r)&&vw(o.left,r)&&vw(o.right,r)&&(!a.computed||vw(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rC(e,t))return!((e,t)=>{var r;let n;if(vA(e,t)||vS(rj(e),t))return!0;let o=rq(rj(e),t);if(!o)return!1;let a=rj(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===vT(r,t)})(e,r);let n=vT(e,r),o=vT(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eO(a,r.sourceCode.getScope(a));n=null!==e&&e===vT(o.left,r)}return n?{suggest:[{messageId:vy,fix:vI(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(vk(n,"has")&&vk(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rj(e)).type)return!1;let n=rq(e,t);if(!n)return!1;let o=rj(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&vx.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&rC(n.callee.object,t.callee.object)&&rC(n.arguments[0],t.arguments[0])&&vw(n.arguments[0],r))return{fix:vI(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:vg,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:{[vg]:"The existence check before deletion is unnecessary.",[vy]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!vF.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=vB.get(o),tr(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=vF.get(o),a.filter((e,r)=>tr(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tq(n=e[t].parent,r)||tV(n)||o.every(e=>n6(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&&tt(rj(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&&tv(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:vj,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>aI(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=e7(t,e),a=e4(t,e),!o&&o3(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&vR.has(rj(t).type)&&(a=`(${a})`),a}).join(` ${n} `),oD(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:{[vj]:"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=v$(o),u=v$(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:vP},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||rN(e,a),m=!c&&!vM(n.test,e)&&!!(s=ey(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=e4(t,e);if(r)return o2(t,"!")?`!(${n})`:`!${n}`;if(vM(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>n.alternate?r(n,vN(n.consequent),vN(n.alternate)):function(n){let o,a=ar(n,e);if(!a||"ReturnStatement"!==a.type)return;let i=vN(n.consequent),s=v$(i);if(void 0!==s&&(o=at(n,e),o?.type==="IfStatement"&&!o.alternate&&v$(vN(o.consequent))===s))return;let l=r(n,i,a,[t.getRange(n)[0],t.getRange(a)[1]]);return l?.fix&&t.getTokensBetween(n,a,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:vP}:l}(n))},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[vP]:"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 vU)if(vq(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>vq(e,r))||((e,t)=>{let{parent:r}=e;return vq(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:vO,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=vV(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:{[vO]:"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=>vX(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>vX(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 vH({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield vH({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:{[vW]:"These branches start with the same code. Move it before the `if` statement.",[v_]:"These branches end with the same code. Move it after the `if` statement.",[vz]:"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===v2(r))return;let n=r.arguments[1];if(!tt(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==v2(e)&&tt(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(v2(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:vZ};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(v1.has(e))return v1.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=e4(p,e),a=e4(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:{[vZ]:"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:v3}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[v3]:"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=>Cr(t,e)),e.on("Property",t=>Cr(t,e)),e.on("PropertyDefinition",t=>Cr(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[v8]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[v6]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[v9]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[v5]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[v4]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=gc(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tw(e,{methods:Ci,computed:!1}))return;let{callee:t}=e,r=rj(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=ey(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!nw(o=u.name,e)&&(gl.test(o.name)||nA(o,e))))return;let c=gu(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=Cn;return c?m=Ca:d&&(m=Co),{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:{[Cn]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[Co]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[Ca]:"`{{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||!(tf(l,{name:"AbortController",argumentsLength:0})&&of(l.callee,t))||(n=ey(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||r$(t,a.getRange(l))||s.typeAnnotation&&r$(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"&&tm(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},tp)&&of(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)||r$(t,a.getRange(u))||rN(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(tm(n,{argumentsLength:0,optional:!1},tp)&&tT(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=ey(a.getScope(s),s);if(!d||ey(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=Cp(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=e$(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||Cc(o,d,d.identifiers[0],t)||m.some(e=>Cc(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:Cs,suggest:[{messageId:Cl,*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 aO(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:{[Cs]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[Cl]:"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(tf(r,{name:"Error",maximumArguments:2})&&of(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=Cv(e.test).map(e=>(function(e,t){let r=Cb(e=Cg(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=Cb(e.left,t);if(n&&CE(e.operator,e.right,!0))return n;let o=Cb(e.right,t);if(o&&CE(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=oA("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:Cd,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:{[Cd]:"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,tw(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!CL(r.callee.object,n):!(tm(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},tp)&&of(r.callee,n)))return;let[a,i]=t.arguments,s=tn(o=rj(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(!CD.has(s))return;let l=((e,t)=>{if(tv(e=rj(e)))return e;if("Identifier"!==e.type)return;let r=ey(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&&rj(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tv(o))return o})(i,e);if(l&&CW(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:CC,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!CX(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 C0(e,t)&&(r=e.argument,tf(r,{name:"Set",argumentsLength:0})&&of(r.callee,t)||!ez(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:C_,fix:n=>n.replaceText(e,CH(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=CY(r,t);for(let e of n)o+=`.union(${e4(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!CX(t,e))return;let[n]=t.arguments;return C2((e=>{for(;e?.type==="ParenthesizedExpression"||rI(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=CZ(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return C2(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[C_]:"Use `Set#union()` instead of spreading Sets into a new Set.",[Cz]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[CK]:"Use `Set#intersection()`.",[CG]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[CJ]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=C4(r.consequent),o=C4(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&C7(e,t)&&!rY(e.receiver)&&!rY(t.receiver)&&!De(e,r)&&!De(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=C5(t);if(a?.method==="hasAttribute"&&C7(a,r)&&!rY(a.receiver))return{isNegative:o,isKnownNonDom:De(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":C6(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==tn(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||rL(e,r,c)?void 0:function*(n){var o;let i,s=(i=e4(o=a.receiver,e),!e7(o,e.sourceCode)&&oZ(o,e)?`(${i})`:i),u=e4(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),oD(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield aP(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:C3};if(!t)return n;let o="IfStatement"!==e.type&&!(tb(e)||tb(e.parent));return r||o?n.suggest=[{messageId:C8,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:{[C3]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[C8]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tw(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&Da("Object",e,t)))return;let[r]=e.arguments,n=Dl(r,t);if(!n)return;let o=Dp(e,r,Du(n.query,t),t);return Dd({node:e,query:n.query,replacement:o,preservedNodes:[...Dc(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rI(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?tn(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tf(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=Dl(t,e);if(o)return Dd({node:t,query:o.query,replacement:Du(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tf(e,{name:"Map",argumentsLength:1})&&Da("Map",e,t);if(!r&&!tf(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=Dl(n,t);if(!o)return;let a=Ds(o.query,t),i=Du(o.query,t),s=Dp(e,n,r?i:a,t);return Dd({node:e,query:o.query,replacement:s,preservedNodes:[...Dc(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:{[Dt]:"Prefer `URLSearchParams` over manually splitting query strings.",[Dr]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{e.on("CallExpression",t=>(function(e,t){if(!tw(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!Db(e.callee.object))return;let[r]=e.arguments;if(!Dh(r)||0===r.params.length)return;let[n]=r.params,o=DF(n)&&ey(t.sourceCode.getScope(n),n);if(o)return function e(t,r,n){if(t=Dx(t),!(!t?.type||Dh(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tw(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!D_(t=Dx(t),r,n)||Dv(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!Dz(t.callee.object)){let e=DK(t,n,{knownPromiseSettledResultArray:!0});if(e)return e}for(let[o,a]of Object.entries(t))if(!("parent"===o||DW(t,o))&&a&&"object"==typeof a)for(let t of Array.isArray(a)?a:[a]){let o=e(t,r,n);if(o)return o}}}(r.body,o,t)})(t,e)??DK(t,e))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[Dm]:"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||!(tf(u,{name:"AbortController",argumentsLength:0})&&of(u.callee,t))||(n=ey(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||r$(t,a.getRange(u))||l.typeAnnotation&&r$(t,a.getRange(l.typeAnnotation)))return;let p=((e,t,r)=>{var n;let o,a=DQ(e);if(a?.type!=="ForOfStatement"||a.await||!Sy(a,r)||DZ(r,e,a)||!Si(a.right,r)||D5(a.right,r)||St(a.right,t,r)||Se(a.right,r)||!Sm(a.right,r)||!(!(o=Sa(a.right,r))||o.length>1&&o.every(e=>Sn(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||!Sr(s,r))return;let l=Sg("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||!rC(rj(l.sourceSignal),s))return;let u=Sf(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(!Sd(e,t))return r;let n=rj(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=DQ(e);for(;l;){let e=Sg(l);if(!e||!Sy(l,r)||DZ(r,s,l)||St(e.sourceSignal,t,r)||Se(e.sourceSignal,r)||!Sn(e.sourceSignal,r))break;let i=Sf(e.call.arguments[1],t,e.sourceSignal,r);if(!i)break;n.push(l),o.push(e.sourceSignal),a.add(i),s=l,l=DQ(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=ey(a.getScope(l),l);if(!c)return;for(let e of p.abortReferences)if(ey(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=D1(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||Sh(o,c,c.identifiers[0],t)||d.some(e=>Sh(o,c,e,t)))?r:o);return{node:l,messageId:DG,suggest:[{messageId:DJ,*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 aO(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:{[DG]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[DJ]:"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=>tg(e))||SC(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&&SC(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,rL(e,SD(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&SC(s.body,r,Sb,Sv))){let t;return{node:i,messageId:Sx,fix:(t=s.body,r=>r.replaceTextRange(SD(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:{[Sx]:"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),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)},u=e=>{t.currentSegments.delete(e)};e.on("onCodePathStart",(a,s)=>{let l=t;t={upper:l,codePath:a,currentSegments:new i,eventsBySegment:new o,executors:new i,catchClausesBySegment:new o,ignoredLoopEdges:[],hasResolverReferences:l?.hasResolverReferences??!1},Sk(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=ey(r.getScope(o),o);if(!(!a||SI(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",()=>{!function(e,t){var r;let n;if(0===e.executors.size)return;let a=(r=e.codePath,n=[],r.traverseSegments(e=>{e.reachable&&n.push(e)}),n),i=new l;for(let r of e.executors){let n=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=SB(e,n,r);return e}(SL(o,a,e),e.eventsBySegment.get(o)??[],t);SP(r,a.get(o))||(a.set(o,r),n=!0)}while(n);return a}(e,r,a);for(let o of a){let a=SL(o,n,e);for(let n of e.eventsBySegment.get(o)??[])n.executor===r&&a.resolverCalled&&!i.has(n.node)&&(i.add(n.node),t.report({node:n.node,messageId:SS})),a=SB(a,n,r)}}}(t,e),t=t.upper}),e.on("onCodePathSegmentStart",a),e.on("onUnreachableCodePathSegmentStart",a),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{(SN(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tv(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tD(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||"Identifier"===r.type&&(n.has(r)||!S$(r))||"ImportExpression"===r.type&&!S$(r))return;let o=((e,t)=>{if("CallExpression"!==e.type)return;let r=Sw(e.callee);return"Identifier"===r.type?t.get(r):void 0})(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tv(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tv(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}}(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(SN(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&&function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&Sk(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable)continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[SS]:"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=>{if(!tw(t,{methods:SO,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let r=t.callee.object;if(!tw(r,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||rY(t))return;let n=r.callee.object;if(((e,t)=>{if(e=rj(e),e=rj(rq(e,t)??e),Sq.has(e.type))return!0;let r=SV(e,t);return!!r&&"string"!=typeof r.value})(n,e)||or(n,e))return;let{property:o}=t.callee,{property:a}=r.callee,i=o.name,[s]=t.arguments;if(s){let t=((e,t)=>{let r=SV(e,t);if(!r)return;let{value:n}=r;return null===n||SU.has(typeof n)?String(n):void 0})(s,e);if(void 0===t||("startsWith"===i?t!==t.trimEnd():t!==t.trimStart()))return}let l="startsWith"===i?"trimStart":"trimEnd";return{node:a,messageId:SM,data:{method:i,replacement:l},fix:e=>e.replaceText(a,l)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[SM]:"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:Sz(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=S_(n.exported);if("default"===o)return;let a=S_(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=Sz(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:SW}};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:{[SW]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=v.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v72.0.0/docs/rules/${r}.md`)}},create:oz(t.create)}]})))};module.exports=SK;
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;