@angular-eslint/eslint-plugin-template 14.2.1-alpha.10 → 14.2.1-alpha.13

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.
@@ -62,7 +62,9 @@ declare const _default: {
62
62
  };
63
63
  rules: {
64
64
  "accessibility-alt-text": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityAltText", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
65
- "accessibility-elements-content": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityElementsContent", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
65
+ "accessibility-elements-content": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityElementsContent", [{
66
+ readonly allowList?: readonly string[] | undefined;
67
+ }], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
66
68
  "accessibility-interactive-supports-focus": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"interactiveSupportsFocus", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
67
69
  "accessibility-label-for": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityLabelFor", [{
68
70
  readonly controlComponents?: readonly string[] | undefined;
@@ -1,4 +1,9 @@
1
+ declare type Options = [
2
+ {
3
+ readonly allowList?: readonly string[];
4
+ }
5
+ ];
1
6
  export declare type MessageIds = 'accessibilityElementsContent';
2
7
  export declare const RULE_NAME = "accessibility-elements-content";
3
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityElementsContent", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
8
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"accessibilityElementsContent", Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
9
  export default _default;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e=require("path"),t=require("@typescript-eslint/type-utils"),n=require("typescript"),r=require("@typescript-eslint/utils"),a=require("@angular-eslint/bundled-angular-compiler"),o=require("aria-query");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/s(n);const i=new Map;var c={"extract-inline-html":{preprocess:function(n,r){const a=[n];if(!function(e,t){return!![".component.ts",".page.ts",".dialog.ts",".modal.ts",".popover.ts",".bottomsheet.ts",".snackbar.ts"].some(e=>t.endsWith(e))||!(!e.includes("Component")||!e.includes("@angular/core"))}(n,r))return a;try{const o=u.default.createSourceFile(r,n,u.default.ScriptTarget.Latest,!0),s=o.statements.filter(e=>u.default.isClassDeclaration(e));if(!s||!s.length)return a;const c=[];for(const e of s){const n=t.getDecorators(e);if(n)for(const e of n)u.default.isCallExpression(e.expression)&&u.default.isIdentifier(e.expression.expression)&&"Component"===e.expression.expression.text&&c.push(e)}if(!c||!c.length)return a;const l=[n];let p=0;for(const t of c){if(!u.default.isDecorator(t)||!u.default.isCallExpression(t.expression)||1!==t.expression.arguments.length)continue;const n=t.expression.arguments[0];if(!u.default.isObjectLiteralExpression(n))continue;const a=n.properties.find(e=>e&&e.name&&"template"===e.name.getText());if(n.properties.find(e=>e&&e.name&&"templateUrl"===e.name.getText())||!a)continue;if(!u.default.isPropertyAssignment(a))continue;let s;const c=a.initializer;if(u.default.isNoSubstitutionTemplateLiteral(c)&&(s=c.rawText),u.default.isTemplateExpression(c)&&(s=c.getText()),u.default.isStringLiteral(c)&&(s=c.text),!s)continue;const m=`inline-template-${e.basename(r)}-${++p}.component.html`,d=a.initializer.getStart(),f=a.initializer.getEnd();i.set(m,{range:[d,f],lineAndCharacter:{start:o.getLineAndCharacterOfPosition(d),end:o.getLineAndCharacterOfPosition(f)}}),l.push({text:s,filename:m})}return l}catch(e){return console.log(e),console.error("preprocess: ERROR could not parse @Component() metadata",r),a}},postprocess:function(t,n){const r=t[0];if(1===t.length)return r;const a=t.slice(1);return[...r,...a.flatMap((t,r)=>{const a=`inline-template-${e.basename(n)}-${++r}.component.html`,o=i.get(a);return o?t.map(e=>{if(e.line=e.line+o.lineAndCharacter.start.line,e.endLine=e.endLine+o.lineAndCharacter.start.line,e.fix){const t=o.range[0];e.fix.range=[t+e.fix.range[0],t+e.fix.range[1]]}return e}):[]})]},supportsAutofix:!0}};const l=e=>function({name:t,meta:n,defaultOptions:a,create:o}){return{meta:Object.assign(Object.assign({},n),{docs:Object.assign(Object.assign({},n.docs),{url:e(t)})}),defaultOptions:a,create(e){const t=r.ESLintUtils.applyDefault(a,e.options);return o(e,t)}}};l.withoutDocs=r.ESLintUtils.RuleCreator.withoutDocs;const p=l(e=>`https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/${e}.md`);function m(e){return d(e),e.parserServices}function d(e){var t,n;if(null==(t=e.parserServices)||!t.convertNodeSourceSpanToLoc||null==(n=e.parserServices)||!n.convertElementSourceSpanToLoc)throw new Error("You have used a rule which requires '@angular-eslint/template-parser' to be used as the 'parser' in your ESLint config.")}const f=Symbol("PROPERTY_READ");function g(e){var t;const{details:n}=null!=(t=e.keySpan)?t:{};return n?e instanceof a.TmplAstBoundEvent?function({keySpan:{details:e},name:t}){return t===`${e}Change`}(e)?e.name:n:n.replace("attr.",""):e.name}function y({attributes:e,inputs:t},n){const r=[...e,...t].find(e=>g(e)===n);if("string"==typeof(null==r?void 0:r.value))return r.value;if(!((null==r?void 0:r.value)instanceof a.ASTWithSource))return null;if(r.value.ast instanceof a.LiteralArray)return r.value.ast.expressions;if(r.value.ast instanceof a.LiteralMap){const{keys:e,values:t}=r.value.ast;return e.reduce((e,n,r)=>e.set(n.key,t[r]),new Map)}return r.value.ast instanceof a.LiteralPrimitive?r.value.ast.value:f}var S=p({name:"accessibility-alt-text",meta:{type:"suggestion",docs:{description:"Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes.",recommended:!1},schema:[],messages:{accessibilityAltText:"<{{element}}/> element must have a text alternative."}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=/^(img|area|object|input)$/]"(n){if(!function(e){return"img"===e.name?function(e){return e.attributes.some(({name:e})=>b(e))||e.inputs.some(({name:e})=>b(e))}(e):"object"===e.name?function(e){let t=!1,n=!1;for(const r of e.attributes)t="title"===r.name,n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r="title"===t.name,a=T(t.name);return!(!r&&!a)||e.children.length>0&&!!e.children[0].value}(e):"area"===e.name?A(e):function(e){return"image"!==y(e,"type")||A(e)}(e)}(n)){const r=t.convertElementSourceSpanToLoc(e,n);e.report({loc:r,messageId:"accessibilityAltText",data:{element:n.name}})}}}}});function A(e){let t=!1,n=!1;for(const r of e.attributes)t=b(r.name),n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r=b(t.name),a=T(t.name);return r||a}function T(e){return"aria-label"===e||"aria-labelledby"===e}function b(e){return"alt"===e}var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(e){var t={exports:{}};return e(t,t.exports),t.exports}var h=x(function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(n=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).ArrayExpression="ArrayExpression",n.ArrayPattern="ArrayPattern",n.ArrowFunctionExpression="ArrowFunctionExpression",n.AssignmentExpression="AssignmentExpression",n.AssignmentPattern="AssignmentPattern",n.AwaitExpression="AwaitExpression",n.BinaryExpression="BinaryExpression",n.BlockStatement="BlockStatement",n.BreakStatement="BreakStatement",n.CallExpression="CallExpression",n.CatchClause="CatchClause",n.ChainExpression="ChainExpression",n.ClassBody="ClassBody",n.ClassDeclaration="ClassDeclaration",n.ClassExpression="ClassExpression",n.ConditionalExpression="ConditionalExpression",n.ContinueStatement="ContinueStatement",n.DebuggerStatement="DebuggerStatement",n.Decorator="Decorator",n.DoWhileStatement="DoWhileStatement",n.EmptyStatement="EmptyStatement",n.ExportAllDeclaration="ExportAllDeclaration",n.ExportDefaultDeclaration="ExportDefaultDeclaration",n.ExportNamedDeclaration="ExportNamedDeclaration",n.ExportSpecifier="ExportSpecifier",n.ExpressionStatement="ExpressionStatement",n.ForInStatement="ForInStatement",n.ForOfStatement="ForOfStatement",n.ForStatement="ForStatement",n.FunctionDeclaration="FunctionDeclaration",n.FunctionExpression="FunctionExpression",n.Identifier="Identifier",n.IfStatement="IfStatement",n.ImportAttribute="ImportAttribute",n.ImportDeclaration="ImportDeclaration",n.ImportDefaultSpecifier="ImportDefaultSpecifier",n.ImportExpression="ImportExpression",n.ImportNamespaceSpecifier="ImportNamespaceSpecifier",n.ImportSpecifier="ImportSpecifier",n.JSXAttribute="JSXAttribute",n.JSXClosingElement="JSXClosingElement",n.JSXClosingFragment="JSXClosingFragment",n.JSXElement="JSXElement",n.JSXEmptyExpression="JSXEmptyExpression",n.JSXExpressionContainer="JSXExpressionContainer",n.JSXFragment="JSXFragment",n.JSXIdentifier="JSXIdentifier",n.JSXMemberExpression="JSXMemberExpression",n.JSXNamespacedName="JSXNamespacedName",n.JSXOpeningElement="JSXOpeningElement",n.JSXOpeningFragment="JSXOpeningFragment",n.JSXSpreadAttribute="JSXSpreadAttribute",n.JSXSpreadChild="JSXSpreadChild",n.JSXText="JSXText",n.LabeledStatement="LabeledStatement",n.Literal="Literal",n.LogicalExpression="LogicalExpression",n.MemberExpression="MemberExpression",n.MetaProperty="MetaProperty",n.MethodDefinition="MethodDefinition",n.NewExpression="NewExpression",n.ObjectExpression="ObjectExpression",n.ObjectPattern="ObjectPattern",n.PrivateIdentifier="PrivateIdentifier",n.Program="Program",n.Property="Property",n.PropertyDefinition="PropertyDefinition",n.RestElement="RestElement",n.ReturnStatement="ReturnStatement",n.SequenceExpression="SequenceExpression",n.SpreadElement="SpreadElement",n.StaticBlock="StaticBlock",n.Super="Super",n.SwitchCase="SwitchCase",n.SwitchStatement="SwitchStatement",n.TaggedTemplateExpression="TaggedTemplateExpression",n.TemplateElement="TemplateElement",n.TemplateLiteral="TemplateLiteral",n.ThisExpression="ThisExpression",n.ThrowStatement="ThrowStatement",n.TryStatement="TryStatement",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.VariableDeclaration="VariableDeclaration",n.VariableDeclarator="VariableDeclarator",n.WhileStatement="WhileStatement",n.WithStatement="WithStatement",n.YieldExpression="YieldExpression",n.TSAbstractKeyword="TSAbstractKeyword",n.TSAbstractMethodDefinition="TSAbstractMethodDefinition",n.TSAbstractPropertyDefinition="TSAbstractPropertyDefinition",n.TSAnyKeyword="TSAnyKeyword",n.TSArrayType="TSArrayType",n.TSAsExpression="TSAsExpression",n.TSAsyncKeyword="TSAsyncKeyword",n.TSBigIntKeyword="TSBigIntKeyword",n.TSBooleanKeyword="TSBooleanKeyword",n.TSCallSignatureDeclaration="TSCallSignatureDeclaration",n.TSClassImplements="TSClassImplements",n.TSConditionalType="TSConditionalType",n.TSConstructorType="TSConstructorType",n.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",n.TSDeclareFunction="TSDeclareFunction",n.TSDeclareKeyword="TSDeclareKeyword",n.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",n.TSEnumDeclaration="TSEnumDeclaration",n.TSEnumMember="TSEnumMember",n.TSExportAssignment="TSExportAssignment",n.TSExportKeyword="TSExportKeyword",n.TSExternalModuleReference="TSExternalModuleReference",n.TSFunctionType="TSFunctionType",n.TSInstantiationExpression="TSInstantiationExpression",n.TSImportEqualsDeclaration="TSImportEqualsDeclaration",n.TSImportType="TSImportType",n.TSIndexedAccessType="TSIndexedAccessType",n.TSIndexSignature="TSIndexSignature",n.TSInferType="TSInferType",n.TSInterfaceBody="TSInterfaceBody",n.TSInterfaceDeclaration="TSInterfaceDeclaration",n.TSInterfaceHeritage="TSInterfaceHeritage",n.TSIntersectionType="TSIntersectionType",n.TSIntrinsicKeyword="TSIntrinsicKeyword",n.TSLiteralType="TSLiteralType",n.TSMappedType="TSMappedType",n.TSMethodSignature="TSMethodSignature",n.TSModuleBlock="TSModuleBlock",n.TSModuleDeclaration="TSModuleDeclaration",n.TSNamedTupleMember="TSNamedTupleMember",n.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",n.TSNeverKeyword="TSNeverKeyword",n.TSNonNullExpression="TSNonNullExpression",n.TSNullKeyword="TSNullKeyword",n.TSNumberKeyword="TSNumberKeyword",n.TSObjectKeyword="TSObjectKeyword",n.TSOptionalType="TSOptionalType",n.TSParameterProperty="TSParameterProperty",n.TSPrivateKeyword="TSPrivateKeyword",n.TSPropertySignature="TSPropertySignature",n.TSProtectedKeyword="TSProtectedKeyword",n.TSPublicKeyword="TSPublicKeyword",n.TSQualifiedName="TSQualifiedName",n.TSReadonlyKeyword="TSReadonlyKeyword",n.TSRestType="TSRestType",n.TSStaticKeyword="TSStaticKeyword",n.TSStringKeyword="TSStringKeyword",n.TSSymbolKeyword="TSSymbolKeyword",n.TSTemplateLiteralType="TSTemplateLiteralType",n.TSThisType="TSThisType",n.TSTupleType="TSTupleType",n.TSTypeAliasDeclaration="TSTypeAliasDeclaration",n.TSTypeAnnotation="TSTypeAnnotation",n.TSTypeAssertion="TSTypeAssertion",n.TSTypeLiteral="TSTypeLiteral",n.TSTypeOperator="TSTypeOperator",n.TSTypeParameter="TSTypeParameter",n.TSTypeParameterDeclaration="TSTypeParameterDeclaration",n.TSTypeParameterInstantiation="TSTypeParameterInstantiation",n.TSTypePredicate="TSTypePredicate",n.TSTypeQuery="TSTypeQuery",n.TSTypeReference="TSTypeReference",n.TSUndefinedKeyword="TSUndefinedKeyword",n.TSUnionType="TSUnionType",n.TSUnknownKeyword="TSUnknownKeyword",n.TSVoidKeyword="TSVoidKeyword",(r=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",r.Identifier="Identifier",r.JSXIdentifier="JSXIdentifier",r.JSXText="JSXText",r.Keyword="Keyword",r.Null="Null",r.Numeric="Numeric",r.Punctuator="Punctuator",r.RegularExpression="RegularExpression",r.String="String",r.Template="Template",r.Block="Block",r.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var v={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var C={__proto__:null},F=x(function(e,t){var n=E&&E.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=E&&E.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=E&&E.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=a(h)}),D=x(function(e,t){var n=E&&E.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=E&&E.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return h.AST_NODE_TYPES}}),Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return h.AST_TOKEN_TYPES}}),r(v,t),r(C,t),r(F,t)});function B({parent:e},t){for(;e&&e.type!==D.AST_NODE_TYPES.Program;){if(t(e))return e;e=e.parent}return null}function I(e){if(B(e,N)||function(e){const t=y(e,"style");if("string"!=typeof t)return!1;const n=t.replace(/[\s'"]/g,"");return n.includes("display:none")||n.includes("visibility:hidden")}(e)||function(e){const t=y(e,"ngStyle");return t instanceof Map&&("none"===t.get("display")||"hidden"===t.get("visibility"))}(e)||function(e){return"none"===y(e,"style.display")||"true"===String(y(e,"style.display.none"))||"hidden"===y(e,"style.visibility")||"true"===String(y(e,"style.visibility.hidden"))}(e)||w(e,"aria-hidden")||w(e,"hidden"))return!0;if("INPUT"!==e.name.toUpperCase())return!1;const t=y(e,"type");return"string"==typeof t&&"HIDDEN"===t.toUpperCase()}function w(e,t){const n=y(e,t);return""===n||"true"===String(n)}function N(e){return e instanceof a.TmplAstElement&&I(e)}const O=new Set(["aria-label","innerHtml","innerHTML","innerText","outerHTML","title"]);var P=p({name:"accessibility-elements-content",meta:{type:"suggestion",docs:{description:"Ensures that the heading, anchor and button elements have content in it",recommended:!1},schema:[],messages:{accessibilityElementsContent:"<{{element}}> should have content"}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=/^(a|button|h1|h2|h3|h4|h5|h6)$/][children.length=0]"(n){if(I(n))return;const{attributes:r,inputs:a,name:o,sourceSpan:s}=n;if([...r,...a].map(({name:e})=>e).some(e=>O.has(e)))return;const u=t.convertNodeSourceSpanToLoc(s);e.report({loc:u,messageId:"accessibilityElementsContent",data:{element:o}})}}}});let L=null;function k(){var e;return null!=(e=L)?e:L=new Set(o.dom.keys())}let R=null,_=null,$=null,j=null;function q(){if(null===j){const e=[...o.roles.keys()];j=new Set(e.filter(e=>{const t=o.roles.get(e);return t&&!t.abstract&&"toolbar"!==e&&!t.superClass.some(e=>e.includes("widget"))}).concat("progressbar"))}return j}function K(e){return k().has(e.name)&&function(e){function t({attributes:t,name:n}){return e.name===n&&function(e,t){const n=[...t.attributes,...t.inputs];return e.every(e=>n.some(({name:n})=>"a"===t.name&&"routerLink"===n||e.name===n&&(!e.value||e.value===y(t,e.name))))}(null!=t?t:[],e)}return!!function(){if(null===_){const e=[...o.roles.keys()],t=[...o.elementRoles.entries()],n=new Set(e.filter(e=>{const t=o.roles.get(e);return t&&!t.abstract&&"progressbar"!==e&&t.superClass.some(e=>e.includes("widget"))}).concat("toolbar"));_=t.reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return _}().some(t)||!function(){if(null===$){const e=[...o.elementRoles.entries()];$=e.reduce((e,[t,n])=>e.concat([...n].every(e=>q().has(e))?t:[]),[])}return $}().some(t)&&function(){if(null===R){const{AXObjects:e,elementAXObjects:t}=require("axobject-query"),n=new Set(Array.from(e.keys()).filter(t=>"widget"===e.get(t).type));R=[...t.entries()].reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return R}().some(t)}(e)}const M=new Set(["none","presentation"]);function U(e){const t=y(e,"role");return"string"==typeof t&&M.has(t)}const X="accessibility-interactive-supports-focus";var J=p({name:X,meta:{type:"suggestion",docs:{description:"Ensures that elements with interactive handlers like `(click)` are focusable.",recommended:!1},schema:[],messages:{interactiveSupportsFocus:"Elements with interaction handlers must be focusable."}},defaultOptions:[],create:e=>({Element$1(t){const n=t.name;if(!k().has(n))return;const r=t.outputs.find(e=>"click"===e.name||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress"));if(!r||function(e){const t=[...e.attributes,...e.inputs].find(e=>"disabled"===g(e)),n=y(e,"disabled");return!((!t||void 0===n)&&"true"!==String(y(e,"aria-disabled")).toLowerCase())}(t)||I(t)||U(t))return;const a=[...t.attributes,...t.inputs].find(e=>"tabindex"===e.name);if(r&&!a&&!K(t)&&!function(e){return function(e){return q().has(y(e,"role"))}(e)}(t)&&!function(e){const t=[...e.attributes,...e.inputs].find(e=>"contenteditable"===g(e)),n=y(e,"contenteditable");return!!t&&(""===n||"true"===String(n).toLowerCase())}(t)){const n=m(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:n,messageId:"interactiveSupportsFocus"})}}})});function W(e,t){return function e({children:n}){return n.some(n=>n instanceof a.TmplAstElement&&(n.name===t||e(n)))}(e)}const Y={items:{type:"string"},type:"array",uniqueItems:!0},V=["button","input","meter","output","progress","select","textarea"],H=["for","htmlFor"],G=["label"];var z=p({name:"accessibility-label-for",meta:{deprecated:!0,replacedBy:["accessibility-label-has-associated-control"],type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{...Y},labelAttributes:{...Y},labelComponents:{...Y}},type:"object"}],messages:{accessibilityLabelFor:"A label element/component must be associated with a form element"}},defaultOptions:[{controlComponents:V,labelAttributes:H,labelComponents:G}],create(e,[t]){const n=m(e),{controlComponents:r,labelAttributes:a,labelComponents:o}=function({controlComponents:e,labelAttributes:t,labelComponents:n}){return{controlComponents:new Set([...V,...null!=e?e:[]]),labelAttributes:new Set([...H,...null!=t?t:[]]),labelComponents:new Set([...G,...null!=n?n:[]])}}(t);var s;return{[`Element$1[name=${s=[...o],RegExp(`^(${s.join("|")})$`)}]`](t){const o=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if([...a].some(e=>o.has(e))||function(e,t){return Boolean([...e].some(e=>W(t,e)))}(r,t))return;const s=n.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:s,messageId:"accessibilityLabelFor"})}}}});const Q="accessibility-label-has-associated-control",Z=["input","meter","output","progress","select","textarea"],ee=[{inputs:["for","htmlFor"],selector:"label"}];var te=p({name:Q,meta:{type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{items:{type:"string"},type:"array",uniqueItems:!0},labelComponents:{items:{additionalProperties:!1,properties:{inputs:{items:{type:"string"},type:"array",uniqueItems:!0},selector:{type:"string"}},required:["selector"],type:"object"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityLabelHasAssociatedControl:"A label component must be associated with a form element"}},defaultOptions:[{controlComponents:Z,labelComponents:ee}],create(e,[{controlComponents:t,labelComponents:n}]){const r=m(e),a=new Set([...Z,...null!=t?t:[]]),o=[...ee,...null!=n?n:[]],s=o.map(({selector:e})=>e);return{[`Element$1[name=${RegExp(`^(${s.join("|")})$`)}]`](t){var n;const s=o.find(({selector:e})=>e===t.name);if(!s)return;const u=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if((null==(n=s.inputs)?void 0:n.some(e=>u.has(e)))||function(e,t){return Boolean([...e].some(e=>W(t,e)))}(a,t))return;const i=r.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:i,messageId:"accessibilityLabelHasAssociatedControl"})}}}});function ne(e){return RegExp(`^(${e.join("|")})$`)}let re=null,ae=null;const oe="accessibility-role-has-required-aria";var se=p({name:oe,meta:{type:"suggestion",docs:{description:"Ensures elements with ARIA roles have all required properties for that role.",recommended:!1},hasSuggestions:!0,schema:[],messages:{roleHasRequiredAria:'The {{element}} with role="{{role}}" does not have required ARIA properties: {{missingProps}}',suggestRemoveRole:"Remove role `{{role}}`"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > TextAttribute[name='role']`](n){const{value:r,sourceSpan:a}=n,{attributes:s,inputs:u,name:i}=n.parent,c=[...s,...u],l=o.roles.get(r),p=Object.keys((null==l?void 0:l.requiredProps)||{});if(!p.length)return;if(function(e,t,n){var r,a;if(null===re||null===ae){const{AXObjectRoles:e,elementAXObjects:t}=require("axobject-query");re=t,ae=e}return Array.from(null!=(r=null==(a=re)?void 0:a.keys())?r:[]).some(r=>{var a,o,s;return r.name===e&&(null!=(a=r.attributes)?a:[]).every(e=>n.find(t=>e.name===t.name&&e.value===t.value))&&(null==(o=re)||null==(s=o.get(r))?void 0:s.find(e=>{var n,r;return null==(n=ae)||null==(r=n.get(e))?void 0:r.find(e=>e.name===t)}))})}(i,r,c))return;const m=p.filter(e=>!c.find(t=>t.name===e)).join(", ");if(m){const n=t.convertNodeSourceSpanToLoc(a);e.report({loc:n,messageId:"roleHasRequiredAria",data:{element:i,role:r,missingProps:m},suggest:[{messageId:"suggestRemoveRole",data:{element:i,role:r,missingProps:m},fix:e=>e.removeRange([(null==a?void 0:a.start.offset)-1,null==a?void 0:a.end.offset])}]})}}}}}),ue=p({name:"accessibility-table-scope",meta:{type:"suggestion",docs:{description:"Ensures that the `scope` attribute is only used on the `<th>` element",recommended:!1},fixable:"code",schema:[],messages:{accessibilityTableScope:"The `scope` attribute should only be on the `<th>` element"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()].filter(e=>"th"!==e))}] > :matches(BoundAttribute, TextAttribute)[name='scope']`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"accessibilityTableScope",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ie=p({name:"accessibility-valid-aria",meta:{type:"suggestion",docs:{description:"Ensures that correct ARIA attributes and respective values are used",recommended:!1},hasSuggestions:!0,schema:[],messages:{accessibilityValidAria:"The `{{attribute}}` is an invalid ARIA attribute",accessibilityValidAriaValue:"The `{{attribute}}` has an invalid value. Check the valid values at https://raw.githack.com/w3c/aria/stable/#roles",suggestRemoveInvalidAria:"Remove attribute `{{attribute}}`"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > :matches(BoundAttribute, TextAttribute)[name=/^aria-.+/]`](n){const{name:r,sourceSpan:s}=n,u=o.aria.get(r),i=t.convertNodeSourceSpanToLoc(s);if(!u)return void e.report({loc:i,messageId:"accessibilityValidAria",data:{attribute:r},suggest:[{messageId:"suggestRemoveInvalidAria",data:{attribute:r},fix:e=>e.removeRange([s.start.offset-1,s.end.offset])}]});const c=function(e){return e instanceof a.TmplAstBoundAttribute&&e.value instanceof a.ASTWithSource?e.value.ast:e}(n);(function(e){return!function(e){return e instanceof a.LiteralArray||e instanceof a.LiteralMap}(e)&&!function(e){return e instanceof a.LiteralPrimitive||e instanceof a.TmplAstTextAttribute}(e)})(c)||function({allowundefined:e,type:t,values:n},r){if(e&&le(r))return!0;switch(t){case"boolean":return ce(r);case"tristate":return ce(r)||le(r);case"id":case"idlist":return!0;case"integer":return a=r,!Number.isNaN(a)&&parseInt(Number(a))==a&&!Number.isNaN(parseInt(a,10));case"number":return function(e){return!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(e)}(r);case"string":return function(e){return"string"==typeof e}(r);case"token":case"tokenlist":{const e=ce(r)?JSON.parse(r):r;return Boolean(null==n?void 0:n.includes(e))}}var a}(u,c.value)||e.report({loc:i,messageId:"accessibilityValidAriaValue",data:{attribute:r}})}}}});function ce(e){return"boolean"==typeof e||"false"===e||"true"===e}function le(e){return null==e}const pe={alphabetical:!1,order:["STRUCTURAL_DIRECTIVE","TEMPLATE_REFERENCE","ATTRIBUTE_BINDING","INPUT_BINDING","TWO_WAY_BINDING","OUTPUT_BINDING"]};var me=p({name:"attributes-order",meta:{type:"layout",docs:{description:"Ensures that HTML attributes and Angular bindings are sorted based on an expected order",recommended:!1},fixable:"code",schema:[{type:"object",properties:{alphabetical:{type:"boolean",default:pe.alphabetical},order:{type:"array",items:{enum:pe.order},default:pe.order,minItems:pe.order.length,uniqueItems:!0}},additionalProperties:!1}],messages:{attributesOrder:"The element's attributes/bindings did not match the expected order: expected {{expected}} instead of {{actual}}"}},defaultOptions:[pe],create(e,[{alphabetical:t,order:n}]){const r=m(e);function a(e){const t=r.convertNodeSourceSpanToLoc(e.sourceSpan);switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return{start:{line:t.start.line,column:t.start.column-1},end:{line:t.end.line,column:t.end.column+1}};default:return t}}return{Element$1(r){const{attributes:o,inputs:s,outputs:u,references:i}=r,{extractedBananaBoxes:c,extractedInputs:l,extractedOutputs:p}=function(e,t){const n=e.filter(e=>!t.some(t=>xe(e,t))).map(ye),{extractedBananaBoxes:r,extractedOutputs:a}=t.reduce(({extractedBananaBoxes:t,extractedOutputs:n},r)=>{const a=e.find(e=>xe(e,r));return{extractedBananaBoxes:t.concat(a?Te(a):[]),extractedOutputs:n.concat(a?[]:Ae(r))}},{extractedBananaBoxes:[],extractedOutputs:[]});return{extractedBananaBoxes:r,extractedInputs:n,extractedOutputs:a}}(s.map(ye),u.map(Ae)),m=[...Ee(r),...o.map(ge),...i.map(be),...c,...l,...p];if(m.length<2)return;const d=[...m].sort(de),f=[...m].sort(function(e,t){return function(n,r){const a=fe(n,e)-fe(r,e);return t&&0===a?n.name>r.name?1:-1:a}}(n,t));let g;for(let e=0;e<d.length;e++){var y,S;d[e]!==f[e]&&(g=[null!=(y=null==(S=g)?void 0:S[0])?y:e,e])}if(g){const[t,n]=g,r=e.getSourceCode(),{start:o}=a(d[t]),{end:s}=a(d[n]),u={start:o,end:s},i=[ve(d[t]),Ce(d[n])];let c="",l=i[0];for(let e=t;e<=n;e++){const t=d[e],n=ve(t),a=Ce(t),o=f[e],s=ve(o),u=Ce(o);c+=r.text.slice(l,n),c+=r.text.slice(s,u),l=a}e.report({loc:u,messageId:"attributesOrder",data:{expected:f.slice(t,n+1).map(e=>`\`${he(e)}\``).join(", "),actual:d.slice(t,n+1).map(e=>`\`${he(e)}\``).join(", ")},fix:e=>e.replaceTextRange(i,c)})}}}}});function de(e,t){return e.sourceSpan.start.line===t.sourceSpan.start.line?e.sourceSpan.start.col-t.sourceSpan.start.col:e.sourceSpan.start.line-t.sourceSpan.start.line}function fe(e,t){return t.indexOf(e.orderType)}function ge(e){return{...e,orderType:"ATTRIBUTE_BINDING"}}function ye(e){return{...e,orderType:"INPUT_BINDING"}}function Se(e){return{...e,orderType:"STRUCTURAL_DIRECTIVE"}}function Ae(e){return{...e,orderType:"OUTPUT_BINDING"}}function Te(e){return{...e,orderType:"TWO_WAY_BINDING"}}function be(e){return{...e,orderType:"TEMPLATE_REFERENCE"}}function Ee(e){return function(e){return e instanceof a.TmplAstTemplate}(e.parent)?e.parent.templateAttrs.map(Se):[]}function xe(e,t){return e.sourceSpan.start===t.sourceSpan.start&&e.sourceSpan.end===t.sourceSpan.end}function he(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return`*${e.name}`;case"TEMPLATE_REFERENCE":return`#${e.name}`;case"INPUT_BINDING":return`[${e.name}]`;case"OUTPUT_BINDING":return`(${e.name})`;case"TWO_WAY_BINDING":return`[(${e.name})]`;default:return e.name}}function ve(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.start.offset-1;default:return e.sourceSpan.start.offset}}function Ce(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.end.offset+1;default:return e.sourceSpan.end.offset}}const Fe=/\[(.*)\]/;var De=p({name:"banana-in-box",meta:{type:"suggestion",docs:{description:"Ensures that the two-way data binding syntax is correct",recommended:"error"},fixable:"code",schema:[],messages:{bananaInBox:"Invalid binding syntax. Use [(expr)] instead"}},defaultOptions:[],create(e){const t=m(e),n=e.getSourceCode();return{BoundEvent({name:r,sourceSpan:a}){const o=r.match(Fe);if(!o)return;const s=t.convertNodeSourceSpanToLoc(a);e.report({messageId:"bananaInBox",loc:s,fix:e=>{const[,t]=o,a=`[(${t})]`,u=n.getIndexFromLoc(s.start);return e.replaceTextRange([u,u+r.length+2],a)}})}}}});const Be=["button","submit","reset"];var Ie=p({name:"button-has-type",meta:{type:"suggestion",docs:{description:"Ensures that a button has a valid type specified",recommended:!1},schema:[],messages:{missingType:"Type for <button> is missing",invalidType:'"{{type}}" can not be used as a type for <button>'}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=button]"(n){(function({inputs:e,attributes:t}){return[...e,...t].some(({name:e})=>"type"===e)})(n)||e.report({loc:t.convertNodeSourceSpanToLoc(n.sourceSpan),messageId:"missingType"});const r=function(e){const t=e.attributes.find(({name:e,value:t})=>"type"===e&&!Be.includes(t));if(t)return{sourceSpan:t.sourceSpan,value:t.value};for(const{name:t,value:n,sourceSpan:r}of e.inputs)if("type"===t&&n instanceof a.ASTWithSource&&n.ast instanceof a.LiteralPrimitive&&!Be.includes(n.ast.value))return{value:n.ast.value,sourceSpan:r};return null}(n);null!=r&&e.report({loc:t.convertNodeSourceSpanToLoc(r.sourceSpan),messageId:"invalidType",data:{type:r.value}})}}}}),we=p({name:"click-events-have-key-events",meta:{type:"suggestion",docs:{description:"Ensures that the click event is accompanied with at least one key event keyup, keydown or keypress.",recommended:!1},schema:[],messages:{clickEventsHaveKeyEvents:"click must be accompanied by either keyup, keydown or keypress event for accessibility."}},defaultOptions:[],create:e=>({Element$1(t){if(!k().has(t.name))return;if(U(t)||I(t)||K(t))return;let n=!1,r=!1;for(const e of t.outputs)n=n||"click"===e.name,r=r||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress");if(!n||r)return;const a=m(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:a,messageId:"clickEventsHaveKeyEvents"})}})}),Ne=p({name:"conditional-complexity",meta:{type:"suggestion",docs:{description:"The conditional complexity should not exceed a rational limit",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{minimum:1,type:"number"}},additionalProperties:!1}],messages:{conditionalComplexity:"The conditional complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){d(e);const n=e.getSourceCode();return{BoundAttribute(r){if(!r.value.source||r.value.ast instanceof a.Interpolation)return;const o=Le(Oe((Pe||(Pe=new a.Parser(new a.Lexer))).parseBinding(r.value.source,"",0).ast));if(o<=t)return;const{sourceSpan:{start:s,end:u}}=r.value;e.report({loc:{start:n.getLocFromIndex(s),end:n.getLocFromIndex(u)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:o}})},Interpolation({expressions:r}){for(const a of r){const r=Le(a);if(r<=t)continue;const{sourceSpan:{start:o,end:s}}=a;e.report({loc:{start:n.getLocFromIndex(o),end:n.getLocFromIndex(s)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:r}})}}}}});function Oe(e){return e instanceof a.BindingPipe?e.exp:e}let Pe=null;function Le(e){const t=Oe(e);if(!(t instanceof a.Binary||t instanceof a.Conditional))return 0;let n=1;return t instanceof a.Binary&&(t.left instanceof a.Binary&&(n+=Le(t.left)),t.right instanceof a.Binary&&(n+=Le(t.right))),t instanceof a.Conditional&&(n+=Le(t.condition)+Le(t.trueExp)+Le(t.falseExp)),n}var ke=p({name:"cyclomatic-complexity",meta:{type:"suggestion",docs:{description:"Checks cyclomatic complexity against a specified limit. It is a quantitative measure of the number of linearly independent paths through a program's source code",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{type:"number",minimum:1}},additionalProperties:!1}],messages:{cyclomaticComplexity:"The cyclomatic complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){let n=0;const r=m(e);return{'BoundAttribute[name=/^(ngForOf|ngIf|ngSwitchCase)$/], TextAttribute[name="ngSwitchDefault"]'({sourceSpan:a}){if(n+=1,n<=t)return;const o=r.convertNodeSourceSpanToLoc(a);e.report({messageId:"cyclomaticComplexity",loc:o,data:{maxComplexity:t,totalComplexity:n}})}}}});const Re={allowNullOrUndefined:!1};var _e=p({name:"eqeqeq",meta:{type:"suggestion",docs:{description:"Requires `===` and `!==` in place of `==` and `!=`",recommended:"error"},hasSuggestions:!0,fixable:"code",schema:[{type:"object",properties:{allowNullOrUndefined:{type:"boolean",default:Re.allowNullOrUndefined}},additionalProperties:!1}],messages:{eqeqeq:"Expected `{{expectedOperation}}` but received `{{actualOperation}}`",suggestStrictEquality:"Replace `{{actualOperation}}` with `{{expectedOperation}}`"}},defaultOptions:[Re],create(e,[{allowNullOrUndefined:t}]){d(e);const n=e.getSourceCode();return{"Binary[operation=/^(==|!=)$/]"(r){const{left:a,operation:o,right:s,sourceSpan:{start:u,end:i}}=r;if(t&&(Ue(a)||Ue(s)))return;const c={actualOperation:o,expectedOperation:`${o}=`};e.report({loc:{start:n.getLocFromIndex(u),end:n.getLocFromIndex(i)},messageId:"eqeqeq",data:c,...Me(a)||Me(s)?{fix:e=>je({node:r,left:a,right:s,start:u,end:i,fixer:e})}:{suggest:[{messageId:"suggestStrictEquality",fix:e=>je({node:r,left:a,right:s,start:u,end:i,fixer:e}),data:c}]}})}}}});function $e({span:{start:e,end:t}}){return t-e}const je=({node:e,left:t,right:n,start:r,end:a,fixer:o})=>{var s;const{source:u}=null!=(s=B(e,qe))?s:{};return u?o.insertTextAfterRange([r+$e(t)+1,a-$e(n)-1],"="):null};function qe(e){return e instanceof a.ASTWithSource}function Ke(e){return e instanceof a.LiteralPrimitive}function Me(e){return Ke(e)&&"string"==typeof e.value&&(t=e.value,!(!Number.isNaN(Number.parseFloat(String(t)))&&Number.isFinite(Number(t))));var t}function Ue(e){return Ke(e)&&null==e.value}const Xe=/[A-Za-z\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\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-\uAB67\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]/,Je=new RegExp(`[^${Xe}]`),We=new Set(["charset","class","color","colspan","fill","formControlName","height","href","id","lang","ngClass","ngProjectAs","routerLink","src","stroke","stroke-width","style","svgIcon","tabindex","target","type","viewBox","width","xmlns"]),Ye={checkAttributes:!0,checkId:!0,checkDuplicateId:!0,checkText:!0,ignoreAttributes:[...We]},Ve="https://angular.io/guide/i18n",He=`${Ve}#mark-element-attributes-for-translations`,Ge=`${Ve}#mark-plurals-and-alternates-for-translation`,ze=`${Ve}#mark-text-for-translations`,Qe=`${Ve}#manage-marked-text-with-custom-ids`,Ze=`${Ve}#define-unique-custom-ids`,et=`${Ve}-common-prepare#i18n-metadata-for-translation`;var tt=p({name:"i18n",meta:{type:"suggestion",docs:{description:"Ensures following best practices for i18n. Checks for missing i18n attributes on elements and attributes containing texts. Can also check for texts without i18n attribute, elements that do not use custom ID (@@) feature and duplicate custom IDs",recommended:!1},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{boundTextAllowedPattern:{type:"string"},checkAttributes:{type:"boolean",default:Ye.checkAttributes},checkDuplicateId:{type:"boolean",default:Ye.checkDuplicateId},checkId:{type:"boolean",default:Ye.checkId},checkText:{type:"boolean",default:Ye.checkText},ignoreAttributes:{type:"array",items:{type:"string"},default:[...We]},ignoreTags:{type:"array",items:{type:"string"}},requireDescription:{type:"boolean",default:Ye.requireDescription}},additionalProperties:!1}],messages:{i18nAttribute:`Attribute "{{attributeName}}" has no corresponding i18n attribute. See more at ${He}`,i18nAttributeOnIcuOrText:`Each element containing text node should have an i18n attribute. See more at ${Ge} and ${ze}`,i18nCustomIdOnAttribute:`Missing custom ID on attribute "i18n-{{attributeName}}". See more at ${Qe}`,i18nCustomIdOnElement:`Missing custom ID on element. See more at ${Qe}`,i18nDuplicateCustomId:`Duplicate custom ID "@@{{customId}}". See more at ${Ze}`,suggestAddI18nAttribute:"Add the `i18n` attribute",i18nMissingDescription:`Missing i18n description on element. See more at ${et}`}},defaultOptions:[Ye],create(e,[{boundTextAllowedPattern:t,checkAttributes:n,checkId:r,checkDuplicateId:o,checkText:s,ignoreAttributes:u,ignoreTags:i,requireDescription:c}]){const l=m(e),p=e.getSourceCode(),d=t?new RegExp(t):Je,f=new Set([...We,...null!=u?u:[]]),g=new Set(i),y=new Map;return{...(r||c)&&{"Element$1[i18n]"(t){!function({i18n:{description:t,customId:n},name:a,parent:o,sourceSpan:s}){if(g.has(a)||rt(o))return;const u=l.convertNodeSourceSpanToLoc(s);if(r)if(at(n))e.report({messageId:"i18nCustomIdOnElement",loc:u});else{var i;const e=null!=(i=y.get(n))?i:[];y.set(n,[...e,s])}c&&at(t)&&e.report({messageId:"i18nMissingDescription",loc:u})}(t)}},...(n||r||c)&&{[`Element$1 > TextAttribute[value=${Xe}]`](t){!function({i18n:t,keySpan:a,name:o,parent:{name:s},sourceSpan:u,value:i}){if(g.has(s))return;const m=l.convertNodeSourceSpanToLoc(null!=a?a:u);if(t){const{customId:n,description:a}=t;if(r)if(at(n))e.report({messageId:"i18nCustomIdOnAttribute",loc:m,data:{attributeName:o}});else{var d;const e=null!=(d=y.get(n))?d:[];y.set(n,[...e,u])}c&&at(a)&&e.report({messageId:"i18nMissingDescription",loc:m,data:{attributeName:o}})}t||!n||function(e,t,n,r){return e.has(n)||e.has(`${t}[${n}]`)||at(r)||function(e){return"false"===e||"true"===e}(r)||function(e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}(r)}(f,s,o,i)||e.report({messageId:"i18nAttribute",loc:m,data:{attributeName:o},fix:e=>{const{end:t}=l.convertNodeSourceSpanToLoc(u),n=p.getIndexFromLoc(t);return e.insertTextAfterRange([n,n],` i18n-${o}`)}})}(t)}},...s&&{[`BoundText, Icu$1, Text$3[value=${Xe}]`](t){!function(t){var n;const{parent:r,sourceSpan:o}=t;if(t instanceof a.TmplAstBoundText&&function(e,{value:{ast:{strings:t}}}){const n=t.join("").trim();return!Xe.test(n)||e.test(n)}(d,t)||nt(r)&&(r.i18n||g.has(r.name)))return;const s=l.convertNodeSourceSpanToLoc(o),u=e=>function(e,t,n,r,a){return nt(a)?B(a,rt)?[]:function(e,t,{start:n},r){const a=e.getIndexFromLoc(n)+r.length+1;return t.insertTextAfterRange([a,a]," i18n")}(e,n,t.convertNodeSourceSpanToLoc(a.sourceSpan),a.name):function(e,t,{start:n,end:r}){const a=e.getIndexFromLoc(n),o=e.getIndexFromLoc(r);return[t.insertTextBeforeRange([a,a],"<ng-container i18n>"),t.insertTextAfterRange([o,o],"</ng-container>")]}(e,n,r)}(p,l,e,s,r);e.report({messageId:"i18nAttributeOnIcuOrText",loc:s,...null!=r&&null!=(n=r.children)&&n.filter(nt).length?{suggest:[{messageId:"suggestAddI18nAttribute",fix:u}]}:{fix:u}})}(t)}},"Program:exit"(){!function(){if(o)for(const[t,n]of y){if(n.length<=1)break;for(const r of n){const n=l.convertNodeSourceSpanToLoc(r);e.report({messageId:"i18nDuplicateCustomId",loc:n,data:{customId:t}})}}y.clear()}()}}}});function nt(e){return e instanceof a.TmplAstElement}function rt(e){return Boolean(nt(e)&&e.i18n)}function at(e){return!e||0===e.trim().length}const ot="https://www.w3.org/WAI/WCAG21/Understanding/keyboard";var st=p({name:"mouse-events-have-key-events",meta:{type:"suggestion",docs:{description:`Ensures that the mouse events \`mouseout\` and \`mouseover\` are accompanied by \`focus\` and \`blur\` events respectively. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. See more at ${ot}`,recommended:!1},schema:[],messages:{mouseEventsHaveKeyEvents:`\`{{mouseEvent}}\` must be accompanied by \`{{keyEvent}}\` for accessibility (${ot})`}},defaultOptions:[],create(e){const t=m(e),n=ne([...k()]);return[["blur","mouseout"],["focus","mouseover"]].reduce((r,[a,o])=>({...r,[`Element$1[name=${n}]:has(BoundEvent[name='${o}']):not(:has(BoundEvent[name='${a}']))`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"mouseEventsHaveKeyEvents",data:{keyEvent:a,mouseEvent:o}})}}),{})}}),ut=p({name:"no-any",meta:{type:"suggestion",docs:{description:'The use of "$any" nullifies the compile-time benefits of Angular\'s type system',recommended:!1},hasSuggestions:!0,schema:[],messages:{noAny:'Avoid using "$any" in templates',suggestRemoveAny:"Remove $any"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{'Call[receiver.name="$any"]'({receiver:n,sourceSpan:{end:r,start:o}}){if(!(n instanceof a.PropertyRead))return;if(!(n.receiver instanceof a.ThisReceiver||n.receiver instanceof a.ImplicitReceiver))return;const s=n.nameSpan;e.report({messageId:"noAny",loc:{start:t.getLocFromIndex(o),end:t.getLocFromIndex(r)},suggest:[{messageId:"suggestRemoveAny",fix:e=>[e.removeRange([s.start,s.end+1]),e.removeRange([r-1,r])]}]})}}}}),it=p({name:"no-autofocus",meta:{type:"suggestion",docs:{description:"Ensures that the `autofocus` attribute is not used",recommended:!1},fixable:"code",schema:[],messages:{noAutofocus:"The `autofocus` attribute should not be used, as it reduces usability and accessibility for users"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > :matches(BoundAttribute, TextAttribute)[name="autofocus"]`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noAutofocus",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ct=p({name:"no-call-expression",meta:{type:"suggestion",docs:{description:"Disallows calling expressions in templates, except for output handlers",recommended:!1},schema:[],messages:{noCallExpression:"Avoid calling expressions in templates"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{'Call[receiver.name!="$any"]'(n){if(Boolean(B(n,lt)))return;const{sourceSpan:{start:r,end:a}}=n;e.report({loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(a)},messageId:"noCallExpression"})}}}});function lt(e){return e instanceof a.TmplAstBoundEvent}var pt=p({name:"no-distracting-elements",meta:{type:"suggestion",docs:{description:"Enforces that no distracting elements are used",recommended:!1},fixable:"code",schema:[],messages:{noDistractingElements:"Do not use <{{element}}> elements as they can create visual accessibility issues and are deprecated"}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=/^(blink|marquee)$/]"({name:n,sourceSpan:r}){const a=t.convertNodeSourceSpanToLoc(r);e.report({loc:a,messageId:"noDistractingElements",data:{element:n},fix:e=>e.removeRange([r.start.offset,r.end.offset])})}}}});const mt={allowTwoWayDataBinding:!0,ignore:[]};var dt=p({name:"no-duplicate-attributes",meta:{type:"problem",docs:{description:"Ensures that there are no duplicate input properties or output event listeners",recommended:!1},hasSuggestions:!0,schema:[{type:"object",properties:{allowTwoWayDataBinding:{type:"boolean",default:mt.allowTwoWayDataBinding,description:"Whether or not two-way data binding is allowed as an exception to the rule."},ignore:{type:"array",items:{type:"string"},uniqueItems:!0,default:mt.ignore,description:"Input or output properties for which duplicate presence is allowed as an exception to the rule."}},additionalProperties:!1}],messages:{noDuplicateAttributes:"Duplicate attribute `{{attributeName}}`",suggestRemoveAttribute:"Remove attribute `{{attributeName}}`"}},defaultOptions:[mt],create(e,[{allowTwoWayDataBinding:t,ignore:n}]){const r=m(e);return{Element$1({inputs:a,outputs:o,attributes:s}){const u=[...ft([...a,...s]),...ft(t?o.filter(e=>!a.some(t=>t.sourceSpan.start===e.sourceSpan.start&&t.sourceSpan.end===e.sourceSpan.end)):o)];(n&&n.length>0?u.filter(e=>!n.includes(g(e))):u).forEach(t=>{const n=r.convertNodeSourceSpanToLoc(t.sourceSpan),a={attributeName:g(t)};e.report({loc:n,messageId:"noDuplicateAttributes",data:a,suggest:[{messageId:"suggestRemoveAttribute",fix:e=>e.removeRange([n.start.column,n.end.column+1]),data:a}]})})}}}});function ft(e){return e.filter(t=>e.some(e=>e!==t&&g(e)===g(t)))}const gt={allowNgStyle:!1,allowBindToStyle:!1};var yt=p({name:"no-inline-styles",meta:{type:"suggestion",docs:{description:"Disallows the use of inline styles in HTML templates",recommended:!1},schema:[{type:"object",properties:{allowNgStyle:{type:"boolean",default:gt.allowNgStyle},allowBindToStyle:{type:"boolean",default:gt.allowBindToStyle}},additionalProperties:!1}],messages:{noInlineStyles:"<{{element}}/> element should not have inline styles via style attribute. Please use classes instead."}},defaultOptions:[gt],create(e,[{allowNgStyle:t,allowBindToStyle:n}]){const r=m(e);return{Element$1(a){let o=!1;if(t||n){const e=!t&&At(a),r=!n&&Tt(a);o=St(a)||e||r}else o=St(a)||At(a)||Tt(a);if(o){const t=r.convertElementSourceSpanToLoc(e,a);e.report({loc:t,messageId:"noInlineStyles",data:{element:a.name}})}}}}});function St(e){return e.attributes.some(({name:e})=>bt(e))||e.inputs.some(({name:e})=>bt(e))}function At(e){return e.inputs.some(({name:e})=>function(e){return"ngStyle"===e}(e))}function Tt(e){return e.inputs.some(({keySpan:e})=>function(e){return!(null==e||!e.details)&&e.details.includes("style.")}(e))}function bt(e){return"style"===e}var Et=p({name:"no-negated-async",meta:{type:"suggestion",docs:{description:"Ensures that async pipe results are not negated",recommended:"error"},hasSuggestions:!0,schema:[],messages:{noNegatedAsync:"Async pipe results should not be negated. Use `(observable | async) === false`, `(observable | async) === null`, or `(observable | async) === undefined` to check its value instead",suggestFalseComparison:"Compare with `false`",suggestNullComparison:"Compare with `null`",suggestUndefinedComparison:"Compare with `undefined`"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{':not(PrefixNot) > PrefixNot > BindingPipe[name="async"]'({parent:{sourceSpan:{end:n,start:r}}}){e.report({messageId:"noNegatedAsync",loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(n)},suggest:[{messageId:"suggestFalseComparison",textToInsert:" === false"},{messageId:"suggestNullComparison",textToInsert:" === null"},{messageId:"suggestUndefinedComparison",textToInsert:" === undefined"}].map(({messageId:e,textToInsert:t})=>({messageId:e,fix:e=>[e.removeRange([r,r+1]),e.insertTextAfterRange([n,n],t)]}))})}}}}),xt=p({name:"no-positive-tabindex",meta:{type:"suggestion",docs:{description:"Ensures that the `tabindex` attribute is not positive",recommended:!1},hasSuggestions:!0,schema:[],messages:{noPositiveTabindex:"The `tabindex` attribute should not be positive",suggestNonNegativeTabindex:'Use `tabindex="{{tabindex}}"`'}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > BoundAttribute[name="tabindex"][value.ast.value>0], TextAttribute[name="tabindex"][value>0]`]({valueSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noPositiveTabindex",suggest:["-1","0"].map(e=>({messageId:"suggestNonNegativeTabindex",fix:t=>t.replaceTextRange([n.start.offset,n.end.offset],e),data:{tabindex:e}}))})}}}}),ht=p({name:"use-track-by-function",meta:{type:"suggestion",docs:{description:"Ensures trackBy function is used",recommended:!1},schema:[],messages:{useTrackByFunction:"Missing trackBy function in ngFor directive"}},defaultOptions:[],create(e){const t=m(e);return{'BoundAttribute.inputs[name="ngForOf"]'({parent:{inputs:n},sourceSpan:r}){if(n.some(vt))return;const a=t.convertNodeSourceSpanToLoc(r);e.report({messageId:"useTrackByFunction",loc:a})},'BoundAttribute.templateAttrs[name="ngForOf"]'({parent:{templateAttrs:n}}){if(n.some(vt))return;const{start:r}=t.convertNodeSourceSpanToLoc(n[0].sourceSpan),{end:a}=t.convertNodeSourceSpanToLoc(n[n.length-1].sourceSpan),o={start:{...r,column:r.column-1},end:{...a,column:a.column+1}};e.report({messageId:"useTrackByFunction",loc:o})}}}});function vt(e){return e instanceof a.TmplAstBoundAttribute&&"ngForTrackBy"===e.name}module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/template/accessibility-alt-text":"error","@angular-eslint/template/accessibility-elements-content":"error","@angular-eslint/template/accessibility-interactive-supports-focus":"error","@angular-eslint/template/accessibility-label-for":"error","@angular-eslint/template/accessibility-label-has-associated-control":"error","@angular-eslint/template/accessibility-role-has-required-aria":"error","@angular-eslint/template/accessibility-table-scope":"error","@angular-eslint/template/accessibility-valid-aria":"error","@angular-eslint/template/attributes-order":"error","@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/button-has-type":"error","@angular-eslint/template/click-events-have-key-events":"error","@angular-eslint/template/conditional-complexity":"error","@angular-eslint/template/cyclomatic-complexity":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/i18n":"error","@angular-eslint/template/mouse-events-have-key-events":"error","@angular-eslint/template/no-any":"error","@angular-eslint/template/no-autofocus":"error","@angular-eslint/template/no-call-expression":"error","@angular-eslint/template/no-distracting-elements":"error","@angular-eslint/template/no-duplicate-attributes":"error","@angular-eslint/template/no-inline-styles":"error","@angular-eslint/template/no-negated-async":"error","@angular-eslint/template/no-positive-tabindex":"error","@angular-eslint/template/use-track-by-function":"error"}},base:{parser:"@angular-eslint/template-parser",plugins:["@angular-eslint/template"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/no-negated-async":"error"}},"process-inline-templates":{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module"},plugins:["@angular-eslint/template"],processor:"@angular-eslint/template/extract-inline-html"}},processors:c,rules:{"accessibility-alt-text":S,"accessibility-elements-content":P,[X]:J,"accessibility-label-for":z,[Q]:te,[oe]:se,"accessibility-table-scope":ue,"accessibility-valid-aria":ie,"attributes-order":me,"banana-in-box":De,"button-has-type":Ie,"conditional-complexity":Ne,"click-events-have-key-events":we,"cyclomatic-complexity":ke,eqeqeq:_e,i18n:tt,"mouse-events-have-key-events":st,"no-any":ut,"no-autofocus":it,"no-call-expression":ct,"no-distracting-elements":pt,"no-duplicate-attributes":dt,"no-inline-styles":yt,"no-negated-async":Et,"no-positive-tabindex":xt,"use-track-by-function":ht}};
1
+ var e=require("path"),t=require("@typescript-eslint/type-utils"),n=require("typescript"),r=require("@typescript-eslint/utils"),a=require("@angular-eslint/bundled-angular-compiler"),o=require("aria-query");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/s(n);const i=new Map;var c={"extract-inline-html":{preprocess:function(n,r){const a=[n];if(!function(e,t){return!![".component.ts",".page.ts",".dialog.ts",".modal.ts",".popover.ts",".bottomsheet.ts",".snackbar.ts"].some(e=>t.endsWith(e))||!(!e.includes("Component")||!e.includes("@angular/core"))}(n,r))return a;try{const o=u.default.createSourceFile(r,n,u.default.ScriptTarget.Latest,!0),s=o.statements.filter(e=>u.default.isClassDeclaration(e));if(!s||!s.length)return a;const c=[];for(const e of s){const n=t.getDecorators(e);if(n)for(const e of n)u.default.isCallExpression(e.expression)&&u.default.isIdentifier(e.expression.expression)&&"Component"===e.expression.expression.text&&c.push(e)}if(!c||!c.length)return a;const l=[n];let p=0;for(const t of c){if(!u.default.isDecorator(t)||!u.default.isCallExpression(t.expression)||1!==t.expression.arguments.length)continue;const n=t.expression.arguments[0];if(!u.default.isObjectLiteralExpression(n))continue;const a=n.properties.find(e=>e&&e.name&&"template"===e.name.getText());if(n.properties.find(e=>e&&e.name&&"templateUrl"===e.name.getText())||!a)continue;if(!u.default.isPropertyAssignment(a))continue;let s;const c=a.initializer;if(u.default.isNoSubstitutionTemplateLiteral(c)&&(s=c.rawText),u.default.isTemplateExpression(c)&&(s=c.getText()),u.default.isStringLiteral(c)&&(s=c.text),!s)continue;const m=`inline-template-${e.basename(r)}-${++p}.component.html`,d=a.initializer.getStart(),f=a.initializer.getEnd();i.set(m,{range:[d,f],lineAndCharacter:{start:o.getLineAndCharacterOfPosition(d),end:o.getLineAndCharacterOfPosition(f)}}),l.push({text:s,filename:m})}return l}catch(e){return console.log(e),console.error("preprocess: ERROR could not parse @Component() metadata",r),a}},postprocess:function(t,n){const r=t[0];if(1===t.length)return r;const a=t.slice(1);return[...r,...a.flatMap((t,r)=>{const a=`inline-template-${e.basename(n)}-${++r}.component.html`,o=i.get(a);return o?t.map(e=>{if(e.line=e.line+o.lineAndCharacter.start.line,e.endLine=e.endLine+o.lineAndCharacter.start.line,e.fix){const t=o.range[0];e.fix.range=[t+e.fix.range[0],t+e.fix.range[1]]}return e}):[]})]},supportsAutofix:!0}};const l=e=>function({name:t,meta:n,defaultOptions:a,create:o}){return{meta:Object.assign(Object.assign({},n),{docs:Object.assign(Object.assign({},n.docs),{url:e(t)})}),defaultOptions:a,create(e){const t=r.ESLintUtils.applyDefault(a,e.options);return o(e,t)}}};l.withoutDocs=r.ESLintUtils.RuleCreator.withoutDocs;const p=l(e=>`https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/${e}.md`);function m(e){return d(e),e.parserServices}function d(e){var t,n;if(null==(t=e.parserServices)||!t.convertNodeSourceSpanToLoc||null==(n=e.parserServices)||!n.convertElementSourceSpanToLoc)throw new Error("You have used a rule which requires '@angular-eslint/template-parser' to be used as the 'parser' in your ESLint config.")}const f=Symbol("PROPERTY_READ");function g(e){var t;const{details:n}=null!=(t=e.keySpan)?t:{};return n?e instanceof a.TmplAstBoundEvent?function({keySpan:{details:e},name:t}){return t===`${e}Change`}(e)?e.name:n:n.replace("attr.",""):e.name}function y({attributes:e,inputs:t},n){const r=[...e,...t].find(e=>g(e)===n);if("string"==typeof(null==r?void 0:r.value))return r.value;if(!((null==r?void 0:r.value)instanceof a.ASTWithSource))return null;if(r.value.ast instanceof a.LiteralArray)return r.value.ast.expressions;if(r.value.ast instanceof a.LiteralMap){const{keys:e,values:t}=r.value.ast;return e.reduce((e,n,r)=>e.set(n.key,t[r]),new Map)}return r.value.ast instanceof a.LiteralPrimitive?r.value.ast.value:f}var S=p({name:"accessibility-alt-text",meta:{type:"suggestion",docs:{description:"Enforces alternate text for elements which require the alt, aria-label, aria-labelledby attributes.",recommended:!1},schema:[],messages:{accessibilityAltText:"<{{element}}/> element must have a text alternative."}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=/^(img|area|object|input)$/]"(n){if(!function(e){return"img"===e.name?function(e){return e.attributes.some(({name:e})=>b(e))||e.inputs.some(({name:e})=>b(e))}(e):"object"===e.name?function(e){let t=!1,n=!1;for(const r of e.attributes)t="title"===r.name,n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r="title"===t.name,a=T(t.name);return!(!r&&!a)||e.children.length>0&&!!e.children[0].value}(e):"area"===e.name?A(e):function(e){return"image"!==y(e,"type")||A(e)}(e)}(n)){const r=t.convertElementSourceSpanToLoc(e,n);e.report({loc:r,messageId:"accessibilityAltText",data:{element:n.name}})}}}}});function A(e){let t=!1,n=!1;for(const r of e.attributes)t=b(r.name),n=T(r.name);if(t||n)return!0;let r=!1,a=!1;for(const t of e.inputs)r=b(t.name),a=T(t.name);return r||a}function T(e){return"aria-label"===e||"aria-labelledby"===e}function b(e){return"alt"===e}var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(e){var t={exports:{}};return e(t,t.exports),t.exports}var h=x(function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(n=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).ArrayExpression="ArrayExpression",n.ArrayPattern="ArrayPattern",n.ArrowFunctionExpression="ArrowFunctionExpression",n.AssignmentExpression="AssignmentExpression",n.AssignmentPattern="AssignmentPattern",n.AwaitExpression="AwaitExpression",n.BinaryExpression="BinaryExpression",n.BlockStatement="BlockStatement",n.BreakStatement="BreakStatement",n.CallExpression="CallExpression",n.CatchClause="CatchClause",n.ChainExpression="ChainExpression",n.ClassBody="ClassBody",n.ClassDeclaration="ClassDeclaration",n.ClassExpression="ClassExpression",n.ConditionalExpression="ConditionalExpression",n.ContinueStatement="ContinueStatement",n.DebuggerStatement="DebuggerStatement",n.Decorator="Decorator",n.DoWhileStatement="DoWhileStatement",n.EmptyStatement="EmptyStatement",n.ExportAllDeclaration="ExportAllDeclaration",n.ExportDefaultDeclaration="ExportDefaultDeclaration",n.ExportNamedDeclaration="ExportNamedDeclaration",n.ExportSpecifier="ExportSpecifier",n.ExpressionStatement="ExpressionStatement",n.ForInStatement="ForInStatement",n.ForOfStatement="ForOfStatement",n.ForStatement="ForStatement",n.FunctionDeclaration="FunctionDeclaration",n.FunctionExpression="FunctionExpression",n.Identifier="Identifier",n.IfStatement="IfStatement",n.ImportAttribute="ImportAttribute",n.ImportDeclaration="ImportDeclaration",n.ImportDefaultSpecifier="ImportDefaultSpecifier",n.ImportExpression="ImportExpression",n.ImportNamespaceSpecifier="ImportNamespaceSpecifier",n.ImportSpecifier="ImportSpecifier",n.JSXAttribute="JSXAttribute",n.JSXClosingElement="JSXClosingElement",n.JSXClosingFragment="JSXClosingFragment",n.JSXElement="JSXElement",n.JSXEmptyExpression="JSXEmptyExpression",n.JSXExpressionContainer="JSXExpressionContainer",n.JSXFragment="JSXFragment",n.JSXIdentifier="JSXIdentifier",n.JSXMemberExpression="JSXMemberExpression",n.JSXNamespacedName="JSXNamespacedName",n.JSXOpeningElement="JSXOpeningElement",n.JSXOpeningFragment="JSXOpeningFragment",n.JSXSpreadAttribute="JSXSpreadAttribute",n.JSXSpreadChild="JSXSpreadChild",n.JSXText="JSXText",n.LabeledStatement="LabeledStatement",n.Literal="Literal",n.LogicalExpression="LogicalExpression",n.MemberExpression="MemberExpression",n.MetaProperty="MetaProperty",n.MethodDefinition="MethodDefinition",n.NewExpression="NewExpression",n.ObjectExpression="ObjectExpression",n.ObjectPattern="ObjectPattern",n.PrivateIdentifier="PrivateIdentifier",n.Program="Program",n.Property="Property",n.PropertyDefinition="PropertyDefinition",n.RestElement="RestElement",n.ReturnStatement="ReturnStatement",n.SequenceExpression="SequenceExpression",n.SpreadElement="SpreadElement",n.StaticBlock="StaticBlock",n.Super="Super",n.SwitchCase="SwitchCase",n.SwitchStatement="SwitchStatement",n.TaggedTemplateExpression="TaggedTemplateExpression",n.TemplateElement="TemplateElement",n.TemplateLiteral="TemplateLiteral",n.ThisExpression="ThisExpression",n.ThrowStatement="ThrowStatement",n.TryStatement="TryStatement",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.VariableDeclaration="VariableDeclaration",n.VariableDeclarator="VariableDeclarator",n.WhileStatement="WhileStatement",n.WithStatement="WithStatement",n.YieldExpression="YieldExpression",n.TSAbstractKeyword="TSAbstractKeyword",n.TSAbstractMethodDefinition="TSAbstractMethodDefinition",n.TSAbstractPropertyDefinition="TSAbstractPropertyDefinition",n.TSAnyKeyword="TSAnyKeyword",n.TSArrayType="TSArrayType",n.TSAsExpression="TSAsExpression",n.TSAsyncKeyword="TSAsyncKeyword",n.TSBigIntKeyword="TSBigIntKeyword",n.TSBooleanKeyword="TSBooleanKeyword",n.TSCallSignatureDeclaration="TSCallSignatureDeclaration",n.TSClassImplements="TSClassImplements",n.TSConditionalType="TSConditionalType",n.TSConstructorType="TSConstructorType",n.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",n.TSDeclareFunction="TSDeclareFunction",n.TSDeclareKeyword="TSDeclareKeyword",n.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",n.TSEnumDeclaration="TSEnumDeclaration",n.TSEnumMember="TSEnumMember",n.TSExportAssignment="TSExportAssignment",n.TSExportKeyword="TSExportKeyword",n.TSExternalModuleReference="TSExternalModuleReference",n.TSFunctionType="TSFunctionType",n.TSInstantiationExpression="TSInstantiationExpression",n.TSImportEqualsDeclaration="TSImportEqualsDeclaration",n.TSImportType="TSImportType",n.TSIndexedAccessType="TSIndexedAccessType",n.TSIndexSignature="TSIndexSignature",n.TSInferType="TSInferType",n.TSInterfaceBody="TSInterfaceBody",n.TSInterfaceDeclaration="TSInterfaceDeclaration",n.TSInterfaceHeritage="TSInterfaceHeritage",n.TSIntersectionType="TSIntersectionType",n.TSIntrinsicKeyword="TSIntrinsicKeyword",n.TSLiteralType="TSLiteralType",n.TSMappedType="TSMappedType",n.TSMethodSignature="TSMethodSignature",n.TSModuleBlock="TSModuleBlock",n.TSModuleDeclaration="TSModuleDeclaration",n.TSNamedTupleMember="TSNamedTupleMember",n.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",n.TSNeverKeyword="TSNeverKeyword",n.TSNonNullExpression="TSNonNullExpression",n.TSNullKeyword="TSNullKeyword",n.TSNumberKeyword="TSNumberKeyword",n.TSObjectKeyword="TSObjectKeyword",n.TSOptionalType="TSOptionalType",n.TSParameterProperty="TSParameterProperty",n.TSPrivateKeyword="TSPrivateKeyword",n.TSPropertySignature="TSPropertySignature",n.TSProtectedKeyword="TSProtectedKeyword",n.TSPublicKeyword="TSPublicKeyword",n.TSQualifiedName="TSQualifiedName",n.TSReadonlyKeyword="TSReadonlyKeyword",n.TSRestType="TSRestType",n.TSStaticKeyword="TSStaticKeyword",n.TSStringKeyword="TSStringKeyword",n.TSSymbolKeyword="TSSymbolKeyword",n.TSTemplateLiteralType="TSTemplateLiteralType",n.TSThisType="TSThisType",n.TSTupleType="TSTupleType",n.TSTypeAliasDeclaration="TSTypeAliasDeclaration",n.TSTypeAnnotation="TSTypeAnnotation",n.TSTypeAssertion="TSTypeAssertion",n.TSTypeLiteral="TSTypeLiteral",n.TSTypeOperator="TSTypeOperator",n.TSTypeParameter="TSTypeParameter",n.TSTypeParameterDeclaration="TSTypeParameterDeclaration",n.TSTypeParameterInstantiation="TSTypeParameterInstantiation",n.TSTypePredicate="TSTypePredicate",n.TSTypeQuery="TSTypeQuery",n.TSTypeReference="TSTypeReference",n.TSUndefinedKeyword="TSUndefinedKeyword",n.TSUnionType="TSUnionType",n.TSUnknownKeyword="TSUnknownKeyword",n.TSVoidKeyword="TSVoidKeyword",(r=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",r.Identifier="Identifier",r.JSXIdentifier="JSXIdentifier",r.JSXText="JSXText",r.Keyword="Keyword",r.Null="Null",r.Numeric="Numeric",r.Punctuator="Punctuator",r.RegularExpression="RegularExpression",r.String="String",r.Template="Template",r.Block="Block",r.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var v={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var C={__proto__:null},F=x(function(e,t){var n=E&&E.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=E&&E.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=E&&E.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=a(h)}),D=x(function(e,t){var n=E&&E.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=E&&E.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return h.AST_NODE_TYPES}}),Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return h.AST_TOKEN_TYPES}}),r(v,t),r(C,t),r(F,t)});function B({parent:e},t){for(;e&&e.type!==D.AST_NODE_TYPES.Program;){if(t(e))return e;e=e.parent}return null}function I(e){if(B(e,N)||function(e){const t=y(e,"style");if("string"!=typeof t)return!1;const n=t.replace(/[\s'"]/g,"");return n.includes("display:none")||n.includes("visibility:hidden")}(e)||function(e){const t=y(e,"ngStyle");return t instanceof Map&&("none"===t.get("display")||"hidden"===t.get("visibility"))}(e)||function(e){return"none"===y(e,"style.display")||"true"===String(y(e,"style.display.none"))||"hidden"===y(e,"style.visibility")||"true"===String(y(e,"style.visibility.hidden"))}(e)||w(e,"aria-hidden")||w(e,"hidden"))return!0;if("INPUT"!==e.name.toUpperCase())return!1;const t=y(e,"type");return"string"==typeof t&&"HIDDEN"===t.toUpperCase()}function w(e,t){const n=y(e,t);return""===n||"true"===String(n)}function N(e){return e instanceof a.TmplAstElement&&I(e)}const O=["aria-label","innerHtml","innerHTML","innerText","outerHTML","title"];var P=p({name:"accessibility-elements-content",meta:{type:"suggestion",docs:{description:"Ensures that the heading, anchor and button elements have content in it",recommended:!1},schema:[{additionalProperties:!1,properties:{allowList:{items:{type:"string"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityElementsContent:"<{{element}}> should have content"}},defaultOptions:[{allowList:O}],create(e,[{allowList:t}]){const n=m(e);return{"Element$1[name=/^(a|button|h1|h2|h3|h4|h5|h6)$/][children.length=0]"(r){if(I(r))return;const{attributes:a,inputs:o,name:s,sourceSpan:u}=r,i=new Set([...O,...null!=t?t:[]]);if([...a,...o].map(({name:e})=>e).some(e=>i.has(e)))return;const c=n.convertNodeSourceSpanToLoc(u);e.report({loc:c,messageId:"accessibilityElementsContent",data:{element:s}})}}}});let L=null;function k(){var e;return null!=(e=L)?e:L=new Set(o.dom.keys())}let R=null,_=null,$=null,j=null;function q(){if(null===j){const e=[...o.roles.keys()];j=new Set(e.filter(e=>{const t=o.roles.get(e);return t&&!t.abstract&&"toolbar"!==e&&!t.superClass.some(e=>e.includes("widget"))}).concat("progressbar"))}return j}function K(e){return k().has(e.name)&&function(e){function t({attributes:t,name:n}){return e.name===n&&function(e,t){const n=[...t.attributes,...t.inputs];return e.every(e=>n.some(({name:n})=>"a"===t.name&&"routerLink"===n||e.name===n&&(!e.value||e.value===y(t,e.name))))}(null!=t?t:[],e)}return!!function(){if(null===_){const e=[...o.roles.keys()],t=[...o.elementRoles.entries()],n=new Set(e.filter(e=>{const t=o.roles.get(e);return t&&!t.abstract&&"progressbar"!==e&&t.superClass.some(e=>e.includes("widget"))}).concat("toolbar"));_=t.reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return _}().some(t)||!function(){if(null===$){const e=[...o.elementRoles.entries()];$=e.reduce((e,[t,n])=>e.concat([...n].every(e=>q().has(e))?t:[]),[])}return $}().some(t)&&function(){if(null===R){const{AXObjects:e,elementAXObjects:t}=require("axobject-query"),n=new Set(Array.from(e.keys()).filter(t=>"widget"===e.get(t).type));R=[...t.entries()].reduce((e,[t,r])=>e.concat([...r].every(e=>n.has(e))?t:[]),[])}return R}().some(t)}(e)}const M=new Set(["none","presentation"]);function U(e){const t=y(e,"role");return"string"==typeof t&&M.has(t)}const X="accessibility-interactive-supports-focus";var J=p({name:X,meta:{type:"suggestion",docs:{description:"Ensures that elements with interactive handlers like `(click)` are focusable.",recommended:!1},schema:[],messages:{interactiveSupportsFocus:"Elements with interaction handlers must be focusable."}},defaultOptions:[],create:e=>({Element$1(t){const n=t.name;if(!k().has(n))return;const r=t.outputs.find(e=>"click"===e.name||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress"));if(!r||function(e){const t=[...e.attributes,...e.inputs].find(e=>"disabled"===g(e)),n=y(e,"disabled");return!((!t||void 0===n)&&"true"!==String(y(e,"aria-disabled")).toLowerCase())}(t)||I(t)||U(t))return;const a=[...t.attributes,...t.inputs].find(e=>"tabindex"===e.name);if(r&&!a&&!K(t)&&!function(e){return function(e){return q().has(y(e,"role"))}(e)}(t)&&!function(e){const t=[...e.attributes,...e.inputs].find(e=>"contenteditable"===g(e)),n=y(e,"contenteditable");return!!t&&(""===n||"true"===String(n).toLowerCase())}(t)){const n=m(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:n,messageId:"interactiveSupportsFocus"})}}})});function W(e,t){return function e({children:n}){return n.some(n=>n instanceof a.TmplAstElement&&(n.name===t||e(n)))}(e)}const Y={items:{type:"string"},type:"array",uniqueItems:!0},V=["button","input","meter","output","progress","select","textarea"],H=["for","htmlFor"],G=["label"];var z=p({name:"accessibility-label-for",meta:{deprecated:!0,replacedBy:["accessibility-label-has-associated-control"],type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{...Y},labelAttributes:{...Y},labelComponents:{...Y}},type:"object"}],messages:{accessibilityLabelFor:"A label element/component must be associated with a form element"}},defaultOptions:[{controlComponents:V,labelAttributes:H,labelComponents:G}],create(e,[t]){const n=m(e),{controlComponents:r,labelAttributes:a,labelComponents:o}=function({controlComponents:e,labelAttributes:t,labelComponents:n}){return{controlComponents:new Set([...V,...null!=e?e:[]]),labelAttributes:new Set([...H,...null!=t?t:[]]),labelComponents:new Set([...G,...null!=n?n:[]])}}(t);var s;return{[`Element$1[name=${s=[...o],RegExp(`^(${s.join("|")})$`)}]`](t){const o=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if([...a].some(e=>o.has(e))||function(e,t){return Boolean([...e].some(e=>W(t,e)))}(r,t))return;const s=n.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:s,messageId:"accessibilityLabelFor"})}}}});const Q="accessibility-label-has-associated-control",Z=["input","meter","output","progress","select","textarea"],ee=[{inputs:["for","htmlFor"],selector:"label"}];var te=p({name:Q,meta:{type:"suggestion",docs:{description:"Ensures that a label element/component is associated with a form element",recommended:!1},schema:[{additionalProperties:!1,properties:{controlComponents:{items:{type:"string"},type:"array",uniqueItems:!0},labelComponents:{items:{additionalProperties:!1,properties:{inputs:{items:{type:"string"},type:"array",uniqueItems:!0},selector:{type:"string"}},required:["selector"],type:"object"},type:"array",uniqueItems:!0}},type:"object"}],messages:{accessibilityLabelHasAssociatedControl:"A label component must be associated with a form element"}},defaultOptions:[{controlComponents:Z,labelComponents:ee}],create(e,[{controlComponents:t,labelComponents:n}]){const r=m(e),a=new Set([...Z,...null!=t?t:[]]),o=[...ee,...null!=n?n:[]],s=o.map(({selector:e})=>e);return{[`Element$1[name=${RegExp(`^(${s.join("|")})$`)}]`](t){var n;const s=o.find(({selector:e})=>e===t.name);if(!s)return;const u=new Set([...t.attributes,...t.inputs].map(({name:e})=>e));if((null==(n=s.inputs)?void 0:n.some(e=>u.has(e)))||function(e,t){return Boolean([...e].some(e=>W(t,e)))}(a,t))return;const i=r.convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:i,messageId:"accessibilityLabelHasAssociatedControl"})}}}});function ne(e){return RegExp(`^(${e.join("|")})$`)}let re=null,ae=null;const oe="accessibility-role-has-required-aria";var se=p({name:oe,meta:{type:"suggestion",docs:{description:"Ensures elements with ARIA roles have all required properties for that role.",recommended:!1},hasSuggestions:!0,schema:[],messages:{roleHasRequiredAria:'The {{element}} with role="{{role}}" does not have required ARIA properties: {{missingProps}}',suggestRemoveRole:"Remove role `{{role}}`"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > TextAttribute[name='role']`](n){const{value:r,sourceSpan:a}=n,{attributes:s,inputs:u,name:i}=n.parent,c=[...s,...u],l=o.roles.get(r),p=Object.keys((null==l?void 0:l.requiredProps)||{});if(!p.length)return;if(function(e,t,n){var r,a;if(null===re||null===ae){const{AXObjectRoles:e,elementAXObjects:t}=require("axobject-query");re=t,ae=e}return Array.from(null!=(r=null==(a=re)?void 0:a.keys())?r:[]).some(r=>{var a,o,s;return r.name===e&&(null!=(a=r.attributes)?a:[]).every(e=>n.find(t=>e.name===t.name&&e.value===t.value))&&(null==(o=re)||null==(s=o.get(r))?void 0:s.find(e=>{var n,r;return null==(n=ae)||null==(r=n.get(e))?void 0:r.find(e=>e.name===t)}))})}(i,r,c))return;const m=p.filter(e=>!c.find(t=>t.name===e)).join(", ");if(m){const n=t.convertNodeSourceSpanToLoc(a);e.report({loc:n,messageId:"roleHasRequiredAria",data:{element:i,role:r,missingProps:m},suggest:[{messageId:"suggestRemoveRole",data:{element:i,role:r,missingProps:m},fix:e=>e.removeRange([(null==a?void 0:a.start.offset)-1,null==a?void 0:a.end.offset])}]})}}}}}),ue=p({name:"accessibility-table-scope",meta:{type:"suggestion",docs:{description:"Ensures that the `scope` attribute is only used on the `<th>` element",recommended:!1},fixable:"code",schema:[],messages:{accessibilityTableScope:"The `scope` attribute should only be on the `<th>` element"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()].filter(e=>"th"!==e))}] > :matches(BoundAttribute, TextAttribute)[name='scope']`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"accessibilityTableScope",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ie=p({name:"accessibility-valid-aria",meta:{type:"suggestion",docs:{description:"Ensures that correct ARIA attributes and respective values are used",recommended:!1},hasSuggestions:!0,schema:[],messages:{accessibilityValidAria:"The `{{attribute}}` is an invalid ARIA attribute",accessibilityValidAriaValue:"The `{{attribute}}` has an invalid value. Check the valid values at https://raw.githack.com/w3c/aria/stable/#roles",suggestRemoveInvalidAria:"Remove attribute `{{attribute}}`"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > :matches(BoundAttribute, TextAttribute)[name=/^aria-.+/]`](n){const{name:r,sourceSpan:s}=n,u=o.aria.get(r),i=t.convertNodeSourceSpanToLoc(s);if(!u)return void e.report({loc:i,messageId:"accessibilityValidAria",data:{attribute:r},suggest:[{messageId:"suggestRemoveInvalidAria",data:{attribute:r},fix:e=>e.removeRange([s.start.offset-1,s.end.offset])}]});const c=function(e){return e instanceof a.TmplAstBoundAttribute&&e.value instanceof a.ASTWithSource?e.value.ast:e}(n);(function(e){return!function(e){return e instanceof a.LiteralArray||e instanceof a.LiteralMap}(e)&&!function(e){return e instanceof a.LiteralPrimitive||e instanceof a.TmplAstTextAttribute}(e)})(c)||function({allowundefined:e,type:t,values:n},r){if(e&&le(r))return!0;switch(t){case"boolean":return ce(r);case"tristate":return ce(r)||le(r);case"id":case"idlist":return!0;case"integer":return a=r,!Number.isNaN(a)&&parseInt(Number(a))==a&&!Number.isNaN(parseInt(a,10));case"number":return function(e){return!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(e)}(r);case"string":return function(e){return"string"==typeof e}(r);case"token":case"tokenlist":{const e=ce(r)?JSON.parse(r):r;return Boolean(null==n?void 0:n.includes(e))}}var a}(u,c.value)||e.report({loc:i,messageId:"accessibilityValidAriaValue",data:{attribute:r}})}}}});function ce(e){return"boolean"==typeof e||"false"===e||"true"===e}function le(e){return null==e}const pe={alphabetical:!1,order:["STRUCTURAL_DIRECTIVE","TEMPLATE_REFERENCE","ATTRIBUTE_BINDING","INPUT_BINDING","TWO_WAY_BINDING","OUTPUT_BINDING"]};var me=p({name:"attributes-order",meta:{type:"layout",docs:{description:"Ensures that HTML attributes and Angular bindings are sorted based on an expected order",recommended:!1},fixable:"code",schema:[{type:"object",properties:{alphabetical:{type:"boolean",default:pe.alphabetical},order:{type:"array",items:{enum:pe.order},default:pe.order,minItems:pe.order.length,uniqueItems:!0}},additionalProperties:!1}],messages:{attributesOrder:"The element's attributes/bindings did not match the expected order: expected {{expected}} instead of {{actual}}"}},defaultOptions:[pe],create(e,[{alphabetical:t,order:n}]){const r=m(e);function a(e){const t=r.convertNodeSourceSpanToLoc(e.sourceSpan);switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return{start:{line:t.start.line,column:t.start.column-1},end:{line:t.end.line,column:t.end.column+1}};default:return t}}return{Element$1(r){const{attributes:o,inputs:s,outputs:u,references:i}=r,{extractedBananaBoxes:c,extractedInputs:l,extractedOutputs:p}=function(e,t){const n=e.filter(e=>!t.some(t=>xe(e,t))).map(ye),{extractedBananaBoxes:r,extractedOutputs:a}=t.reduce(({extractedBananaBoxes:t,extractedOutputs:n},r)=>{const a=e.find(e=>xe(e,r));return{extractedBananaBoxes:t.concat(a?Te(a):[]),extractedOutputs:n.concat(a?[]:Ae(r))}},{extractedBananaBoxes:[],extractedOutputs:[]});return{extractedBananaBoxes:r,extractedInputs:n,extractedOutputs:a}}(s.map(ye),u.map(Ae)),m=[...Ee(r),...o.map(ge),...i.map(be),...c,...l,...p];if(m.length<2)return;const d=[...m].sort(de),f=[...m].sort(function(e,t){return function(n,r){const a=fe(n,e)-fe(r,e);return t&&0===a?n.name>r.name?1:-1:a}}(n,t));let g;for(let e=0;e<d.length;e++){var y,S;d[e]!==f[e]&&(g=[null!=(y=null==(S=g)?void 0:S[0])?y:e,e])}if(g){const[t,n]=g,r=e.getSourceCode(),{start:o}=a(d[t]),{end:s}=a(d[n]),u={start:o,end:s},i=[ve(d[t]),Ce(d[n])];let c="",l=i[0];for(let e=t;e<=n;e++){const t=d[e],n=ve(t),a=Ce(t),o=f[e],s=ve(o),u=Ce(o);c+=r.text.slice(l,n),c+=r.text.slice(s,u),l=a}e.report({loc:u,messageId:"attributesOrder",data:{expected:f.slice(t,n+1).map(e=>`\`${he(e)}\``).join(", "),actual:d.slice(t,n+1).map(e=>`\`${he(e)}\``).join(", ")},fix:e=>e.replaceTextRange(i,c)})}}}}});function de(e,t){return e.sourceSpan.start.line===t.sourceSpan.start.line?e.sourceSpan.start.col-t.sourceSpan.start.col:e.sourceSpan.start.line-t.sourceSpan.start.line}function fe(e,t){return t.indexOf(e.orderType)}function ge(e){return{...e,orderType:"ATTRIBUTE_BINDING"}}function ye(e){return{...e,orderType:"INPUT_BINDING"}}function Se(e){return{...e,orderType:"STRUCTURAL_DIRECTIVE"}}function Ae(e){return{...e,orderType:"OUTPUT_BINDING"}}function Te(e){return{...e,orderType:"TWO_WAY_BINDING"}}function be(e){return{...e,orderType:"TEMPLATE_REFERENCE"}}function Ee(e){return function(e){return e instanceof a.TmplAstTemplate}(e.parent)?e.parent.templateAttrs.map(Se):[]}function xe(e,t){return e.sourceSpan.start===t.sourceSpan.start&&e.sourceSpan.end===t.sourceSpan.end}function he(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return`*${e.name}`;case"TEMPLATE_REFERENCE":return`#${e.name}`;case"INPUT_BINDING":return`[${e.name}]`;case"OUTPUT_BINDING":return`(${e.name})`;case"TWO_WAY_BINDING":return`[(${e.name})]`;default:return e.name}}function ve(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.start.offset-1;default:return e.sourceSpan.start.offset}}function Ce(e){switch(e.orderType){case"STRUCTURAL_DIRECTIVE":return e.sourceSpan.end.offset+1;default:return e.sourceSpan.end.offset}}const Fe=/\[(.*)\]/;var De=p({name:"banana-in-box",meta:{type:"suggestion",docs:{description:"Ensures that the two-way data binding syntax is correct",recommended:"error"},fixable:"code",schema:[],messages:{bananaInBox:"Invalid binding syntax. Use [(expr)] instead"}},defaultOptions:[],create(e){const t=m(e),n=e.getSourceCode();return{BoundEvent({name:r,sourceSpan:a}){const o=r.match(Fe);if(!o)return;const s=t.convertNodeSourceSpanToLoc(a);e.report({messageId:"bananaInBox",loc:s,fix:e=>{const[,t]=o,a=`[(${t})]`,u=n.getIndexFromLoc(s.start);return e.replaceTextRange([u,u+r.length+2],a)}})}}}});const Be=["button","submit","reset"];var Ie=p({name:"button-has-type",meta:{type:"suggestion",docs:{description:"Ensures that a button has a valid type specified",recommended:!1},schema:[],messages:{missingType:"Type for <button> is missing",invalidType:'"{{type}}" can not be used as a type for <button>'}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=button]"(n){(function({inputs:e,attributes:t}){return[...e,...t].some(({name:e})=>"type"===e)})(n)||e.report({loc:t.convertNodeSourceSpanToLoc(n.sourceSpan),messageId:"missingType"});const r=function(e){const t=e.attributes.find(({name:e,value:t})=>"type"===e&&!Be.includes(t));if(t)return{sourceSpan:t.sourceSpan,value:t.value};for(const{name:t,value:n,sourceSpan:r}of e.inputs)if("type"===t&&n instanceof a.ASTWithSource&&n.ast instanceof a.LiteralPrimitive&&!Be.includes(n.ast.value))return{value:n.ast.value,sourceSpan:r};return null}(n);null!=r&&e.report({loc:t.convertNodeSourceSpanToLoc(r.sourceSpan),messageId:"invalidType",data:{type:r.value}})}}}}),we=p({name:"click-events-have-key-events",meta:{type:"suggestion",docs:{description:"Ensures that the click event is accompanied with at least one key event keyup, keydown or keypress.",recommended:!1},schema:[],messages:{clickEventsHaveKeyEvents:"click must be accompanied by either keyup, keydown or keypress event for accessibility."}},defaultOptions:[],create:e=>({Element$1(t){if(!k().has(t.name))return;if(U(t)||I(t)||K(t))return;let n=!1,r=!1;for(const e of t.outputs)n=n||"click"===e.name,r=r||e.name.startsWith("keyup")||e.name.startsWith("keydown")||e.name.startsWith("keypress");if(!n||r)return;const a=m(e).convertNodeSourceSpanToLoc(t.sourceSpan);e.report({loc:a,messageId:"clickEventsHaveKeyEvents"})}})}),Ne=p({name:"conditional-complexity",meta:{type:"suggestion",docs:{description:"The conditional complexity should not exceed a rational limit",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{minimum:1,type:"number"}},additionalProperties:!1}],messages:{conditionalComplexity:"The conditional complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){d(e);const n=e.getSourceCode();return{BoundAttribute(r){if(!r.value.source||r.value.ast instanceof a.Interpolation)return;const o=Le(Oe((Pe||(Pe=new a.Parser(new a.Lexer))).parseBinding(r.value.source,"",0).ast));if(o<=t)return;const{sourceSpan:{start:s,end:u}}=r.value;e.report({loc:{start:n.getLocFromIndex(s),end:n.getLocFromIndex(u)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:o}})},Interpolation({expressions:r}){for(const a of r){const r=Le(a);if(r<=t)continue;const{sourceSpan:{start:o,end:s}}=a;e.report({loc:{start:n.getLocFromIndex(o),end:n.getLocFromIndex(s)},messageId:"conditionalComplexity",data:{maxComplexity:t,totalComplexity:r}})}}}}});function Oe(e){return e instanceof a.BindingPipe?e.exp:e}let Pe=null;function Le(e){const t=Oe(e);if(!(t instanceof a.Binary||t instanceof a.Conditional))return 0;let n=1;return t instanceof a.Binary&&(t.left instanceof a.Binary&&(n+=Le(t.left)),t.right instanceof a.Binary&&(n+=Le(t.right))),t instanceof a.Conditional&&(n+=Le(t.condition)+Le(t.trueExp)+Le(t.falseExp)),n}var ke=p({name:"cyclomatic-complexity",meta:{type:"suggestion",docs:{description:"Checks cyclomatic complexity against a specified limit. It is a quantitative measure of the number of linearly independent paths through a program's source code",recommended:!1},schema:[{type:"object",properties:{maxComplexity:{type:"number",minimum:1}},additionalProperties:!1}],messages:{cyclomaticComplexity:"The cyclomatic complexity {{totalComplexity}} exceeds the defined limit {{maxComplexity}}"}},defaultOptions:[{maxComplexity:5}],create(e,[{maxComplexity:t}]){let n=0;const r=m(e);return{'BoundAttribute[name=/^(ngForOf|ngIf|ngSwitchCase)$/], TextAttribute[name="ngSwitchDefault"]'({sourceSpan:a}){if(n+=1,n<=t)return;const o=r.convertNodeSourceSpanToLoc(a);e.report({messageId:"cyclomaticComplexity",loc:o,data:{maxComplexity:t,totalComplexity:n}})}}}});const Re={allowNullOrUndefined:!1};var _e=p({name:"eqeqeq",meta:{type:"suggestion",docs:{description:"Requires `===` and `!==` in place of `==` and `!=`",recommended:"error"},hasSuggestions:!0,fixable:"code",schema:[{type:"object",properties:{allowNullOrUndefined:{type:"boolean",default:Re.allowNullOrUndefined}},additionalProperties:!1}],messages:{eqeqeq:"Expected `{{expectedOperation}}` but received `{{actualOperation}}`",suggestStrictEquality:"Replace `{{actualOperation}}` with `{{expectedOperation}}`"}},defaultOptions:[Re],create(e,[{allowNullOrUndefined:t}]){d(e);const n=e.getSourceCode();return{"Binary[operation=/^(==|!=)$/]"(r){const{left:a,operation:o,right:s,sourceSpan:{start:u,end:i}}=r;if(t&&(Ue(a)||Ue(s)))return;const c={actualOperation:o,expectedOperation:`${o}=`};e.report({loc:{start:n.getLocFromIndex(u),end:n.getLocFromIndex(i)},messageId:"eqeqeq",data:c,...Me(a)||Me(s)?{fix:e=>je({node:r,left:a,right:s,start:u,end:i,fixer:e})}:{suggest:[{messageId:"suggestStrictEquality",fix:e=>je({node:r,left:a,right:s,start:u,end:i,fixer:e}),data:c}]}})}}}});function $e({span:{start:e,end:t}}){return t-e}const je=({node:e,left:t,right:n,start:r,end:a,fixer:o})=>{var s;const{source:u}=null!=(s=B(e,qe))?s:{};return u?o.insertTextAfterRange([r+$e(t)+1,a-$e(n)-1],"="):null};function qe(e){return e instanceof a.ASTWithSource}function Ke(e){return e instanceof a.LiteralPrimitive}function Me(e){return Ke(e)&&"string"==typeof e.value&&(t=e.value,!(!Number.isNaN(Number.parseFloat(String(t)))&&Number.isFinite(Number(t))));var t}function Ue(e){return Ke(e)&&null==e.value}const Xe=/[A-Za-z\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\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-\uAB67\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]/,Je=new RegExp(`[^${Xe}]`),We=new Set(["charset","class","color","colspan","fill","formControlName","height","href","id","lang","ngClass","ngProjectAs","routerLink","src","stroke","stroke-width","style","svgIcon","tabindex","target","type","viewBox","width","xmlns"]),Ye={checkAttributes:!0,checkId:!0,checkDuplicateId:!0,checkText:!0,ignoreAttributes:[...We]},Ve="https://angular.io/guide/i18n",He=`${Ve}#mark-element-attributes-for-translations`,Ge=`${Ve}#mark-plurals-and-alternates-for-translation`,ze=`${Ve}#mark-text-for-translations`,Qe=`${Ve}#manage-marked-text-with-custom-ids`,Ze=`${Ve}#define-unique-custom-ids`,et=`${Ve}-common-prepare#i18n-metadata-for-translation`;var tt=p({name:"i18n",meta:{type:"suggestion",docs:{description:"Ensures following best practices for i18n. Checks for missing i18n attributes on elements and attributes containing texts. Can also check for texts without i18n attribute, elements that do not use custom ID (@@) feature and duplicate custom IDs",recommended:!1},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{boundTextAllowedPattern:{type:"string"},checkAttributes:{type:"boolean",default:Ye.checkAttributes},checkDuplicateId:{type:"boolean",default:Ye.checkDuplicateId},checkId:{type:"boolean",default:Ye.checkId},checkText:{type:"boolean",default:Ye.checkText},ignoreAttributes:{type:"array",items:{type:"string"},default:[...We]},ignoreTags:{type:"array",items:{type:"string"}},requireDescription:{type:"boolean",default:Ye.requireDescription}},additionalProperties:!1}],messages:{i18nAttribute:`Attribute "{{attributeName}}" has no corresponding i18n attribute. See more at ${He}`,i18nAttributeOnIcuOrText:`Each element containing text node should have an i18n attribute. See more at ${Ge} and ${ze}`,i18nCustomIdOnAttribute:`Missing custom ID on attribute "i18n-{{attributeName}}". See more at ${Qe}`,i18nCustomIdOnElement:`Missing custom ID on element. See more at ${Qe}`,i18nDuplicateCustomId:`Duplicate custom ID "@@{{customId}}". See more at ${Ze}`,suggestAddI18nAttribute:"Add the `i18n` attribute",i18nMissingDescription:`Missing i18n description on element. See more at ${et}`}},defaultOptions:[Ye],create(e,[{boundTextAllowedPattern:t,checkAttributes:n,checkId:r,checkDuplicateId:o,checkText:s,ignoreAttributes:u,ignoreTags:i,requireDescription:c}]){const l=m(e),p=e.getSourceCode(),d=t?new RegExp(t):Je,f=new Set([...We,...null!=u?u:[]]),g=new Set(i),y=new Map;return{...(r||c)&&{"Element$1[i18n]"(t){!function({i18n:{description:t,customId:n},name:a,parent:o,sourceSpan:s}){if(g.has(a)||rt(o))return;const u=l.convertNodeSourceSpanToLoc(s);if(r)if(at(n))e.report({messageId:"i18nCustomIdOnElement",loc:u});else{var i;const e=null!=(i=y.get(n))?i:[];y.set(n,[...e,s])}c&&at(t)&&e.report({messageId:"i18nMissingDescription",loc:u})}(t)}},...(n||r||c)&&{[`Element$1 > TextAttribute[value=${Xe}]`](t){!function({i18n:t,keySpan:a,name:o,parent:{name:s},sourceSpan:u,value:i}){if(g.has(s))return;const m=l.convertNodeSourceSpanToLoc(null!=a?a:u);if(t){const{customId:n,description:a}=t;if(r)if(at(n))e.report({messageId:"i18nCustomIdOnAttribute",loc:m,data:{attributeName:o}});else{var d;const e=null!=(d=y.get(n))?d:[];y.set(n,[...e,u])}c&&at(a)&&e.report({messageId:"i18nMissingDescription",loc:m,data:{attributeName:o}})}t||!n||function(e,t,n,r){return e.has(n)||e.has(`${t}[${n}]`)||at(r)||function(e){return"false"===e||"true"===e}(r)||function(e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}(r)}(f,s,o,i)||e.report({messageId:"i18nAttribute",loc:m,data:{attributeName:o},fix:e=>{const{end:t}=l.convertNodeSourceSpanToLoc(u),n=p.getIndexFromLoc(t);return e.insertTextAfterRange([n,n],` i18n-${o}`)}})}(t)}},...s&&{[`BoundText, Icu$1, Text$3[value=${Xe}]`](t){!function(t){var n;const{parent:r,sourceSpan:o}=t;if(t instanceof a.TmplAstBoundText&&function(e,{value:{ast:{strings:t}}}){const n=t.join("").trim();return!Xe.test(n)||e.test(n)}(d,t)||nt(r)&&(r.i18n||g.has(r.name)))return;const s=l.convertNodeSourceSpanToLoc(o),u=e=>function(e,t,n,r,a){return nt(a)?B(a,rt)?[]:function(e,t,{start:n},r){const a=e.getIndexFromLoc(n)+r.length+1;return t.insertTextAfterRange([a,a]," i18n")}(e,n,t.convertNodeSourceSpanToLoc(a.sourceSpan),a.name):function(e,t,{start:n,end:r}){const a=e.getIndexFromLoc(n),o=e.getIndexFromLoc(r);return[t.insertTextBeforeRange([a,a],"<ng-container i18n>"),t.insertTextAfterRange([o,o],"</ng-container>")]}(e,n,r)}(p,l,e,s,r);e.report({messageId:"i18nAttributeOnIcuOrText",loc:s,...null!=r&&null!=(n=r.children)&&n.filter(nt).length?{suggest:[{messageId:"suggestAddI18nAttribute",fix:u}]}:{fix:u}})}(t)}},"Program:exit"(){!function(){if(o)for(const[t,n]of y){if(n.length<=1)break;for(const r of n){const n=l.convertNodeSourceSpanToLoc(r);e.report({messageId:"i18nDuplicateCustomId",loc:n,data:{customId:t}})}}y.clear()}()}}}});function nt(e){return e instanceof a.TmplAstElement}function rt(e){return Boolean(nt(e)&&e.i18n)}function at(e){return!e||0===e.trim().length}const ot="https://www.w3.org/WAI/WCAG21/Understanding/keyboard";var st=p({name:"mouse-events-have-key-events",meta:{type:"suggestion",docs:{description:`Ensures that the mouse events \`mouseout\` and \`mouseover\` are accompanied by \`focus\` and \`blur\` events respectively. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users. See more at ${ot}`,recommended:!1},schema:[],messages:{mouseEventsHaveKeyEvents:`\`{{mouseEvent}}\` must be accompanied by \`{{keyEvent}}\` for accessibility (${ot})`}},defaultOptions:[],create(e){const t=m(e),n=ne([...k()]);return[["blur","mouseout"],["focus","mouseover"]].reduce((r,[a,o])=>({...r,[`Element$1[name=${n}]:has(BoundEvent[name='${o}']):not(:has(BoundEvent[name='${a}']))`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"mouseEventsHaveKeyEvents",data:{keyEvent:a,mouseEvent:o}})}}),{})}}),ut=p({name:"no-any",meta:{type:"suggestion",docs:{description:'The use of "$any" nullifies the compile-time benefits of Angular\'s type system',recommended:!1},hasSuggestions:!0,schema:[],messages:{noAny:'Avoid using "$any" in templates',suggestRemoveAny:"Remove $any"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{'Call[receiver.name="$any"]'({receiver:n,sourceSpan:{end:r,start:o}}){if(!(n instanceof a.PropertyRead))return;if(!(n.receiver instanceof a.ThisReceiver||n.receiver instanceof a.ImplicitReceiver))return;const s=n.nameSpan;e.report({messageId:"noAny",loc:{start:t.getLocFromIndex(o),end:t.getLocFromIndex(r)},suggest:[{messageId:"suggestRemoveAny",fix:e=>[e.removeRange([s.start,s.end+1]),e.removeRange([r-1,r])]}]})}}}}),it=p({name:"no-autofocus",meta:{type:"suggestion",docs:{description:"Ensures that the `autofocus` attribute is not used",recommended:!1},fixable:"code",schema:[],messages:{noAutofocus:"The `autofocus` attribute should not be used, as it reduces usability and accessibility for users"}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > :matches(BoundAttribute, TextAttribute)[name="autofocus"]`]({sourceSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noAutofocus",fix:e=>e.removeRange([n.start.offset-1,n.end.offset])})}}}}),ct=p({name:"no-call-expression",meta:{type:"suggestion",docs:{description:"Disallows calling expressions in templates, except for output handlers",recommended:!1},schema:[],messages:{noCallExpression:"Avoid calling expressions in templates"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{'Call[receiver.name!="$any"]'(n){if(Boolean(B(n,lt)))return;const{sourceSpan:{start:r,end:a}}=n;e.report({loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(a)},messageId:"noCallExpression"})}}}});function lt(e){return e instanceof a.TmplAstBoundEvent}var pt=p({name:"no-distracting-elements",meta:{type:"suggestion",docs:{description:"Enforces that no distracting elements are used",recommended:!1},fixable:"code",schema:[],messages:{noDistractingElements:"Do not use <{{element}}> elements as they can create visual accessibility issues and are deprecated"}},defaultOptions:[],create(e){const t=m(e);return{"Element$1[name=/^(blink|marquee)$/]"({name:n,sourceSpan:r}){const a=t.convertNodeSourceSpanToLoc(r);e.report({loc:a,messageId:"noDistractingElements",data:{element:n},fix:e=>e.removeRange([r.start.offset,r.end.offset])})}}}});const mt={allowTwoWayDataBinding:!0,ignore:[]};var dt=p({name:"no-duplicate-attributes",meta:{type:"problem",docs:{description:"Ensures that there are no duplicate input properties or output event listeners",recommended:!1},hasSuggestions:!0,schema:[{type:"object",properties:{allowTwoWayDataBinding:{type:"boolean",default:mt.allowTwoWayDataBinding,description:"Whether or not two-way data binding is allowed as an exception to the rule."},ignore:{type:"array",items:{type:"string"},uniqueItems:!0,default:mt.ignore,description:"Input or output properties for which duplicate presence is allowed as an exception to the rule."}},additionalProperties:!1}],messages:{noDuplicateAttributes:"Duplicate attribute `{{attributeName}}`",suggestRemoveAttribute:"Remove attribute `{{attributeName}}`"}},defaultOptions:[mt],create(e,[{allowTwoWayDataBinding:t,ignore:n}]){const r=m(e);return{Element$1({inputs:a,outputs:o,attributes:s}){const u=[...ft([...a,...s]),...ft(t?o.filter(e=>!a.some(t=>t.sourceSpan.start===e.sourceSpan.start&&t.sourceSpan.end===e.sourceSpan.end)):o)];(n&&n.length>0?u.filter(e=>!n.includes(g(e))):u).forEach(t=>{const n=r.convertNodeSourceSpanToLoc(t.sourceSpan),a={attributeName:g(t)};e.report({loc:n,messageId:"noDuplicateAttributes",data:a,suggest:[{messageId:"suggestRemoveAttribute",fix:e=>e.removeRange([n.start.column,n.end.column+1]),data:a}]})})}}}});function ft(e){return e.filter(t=>e.some(e=>e!==t&&g(e)===g(t)))}const gt={allowNgStyle:!1,allowBindToStyle:!1};var yt=p({name:"no-inline-styles",meta:{type:"suggestion",docs:{description:"Disallows the use of inline styles in HTML templates",recommended:!1},schema:[{type:"object",properties:{allowNgStyle:{type:"boolean",default:gt.allowNgStyle},allowBindToStyle:{type:"boolean",default:gt.allowBindToStyle}},additionalProperties:!1}],messages:{noInlineStyles:"<{{element}}/> element should not have inline styles via style attribute. Please use classes instead."}},defaultOptions:[gt],create(e,[{allowNgStyle:t,allowBindToStyle:n}]){const r=m(e);return{Element$1(a){let o=!1;if(t||n){const e=!t&&At(a),r=!n&&Tt(a);o=St(a)||e||r}else o=St(a)||At(a)||Tt(a);if(o){const t=r.convertElementSourceSpanToLoc(e,a);e.report({loc:t,messageId:"noInlineStyles",data:{element:a.name}})}}}}});function St(e){return e.attributes.some(({name:e})=>bt(e))||e.inputs.some(({name:e})=>bt(e))}function At(e){return e.inputs.some(({name:e})=>function(e){return"ngStyle"===e}(e))}function Tt(e){return e.inputs.some(({keySpan:e})=>function(e){return!(null==e||!e.details)&&e.details.includes("style.")}(e))}function bt(e){return"style"===e}var Et=p({name:"no-negated-async",meta:{type:"suggestion",docs:{description:"Ensures that async pipe results are not negated",recommended:"error"},hasSuggestions:!0,schema:[],messages:{noNegatedAsync:"Async pipe results should not be negated. Use `(observable | async) === false`, `(observable | async) === null`, or `(observable | async) === undefined` to check its value instead",suggestFalseComparison:"Compare with `false`",suggestNullComparison:"Compare with `null`",suggestUndefinedComparison:"Compare with `undefined`"}},defaultOptions:[],create(e){d(e);const t=e.getSourceCode();return{':not(PrefixNot) > PrefixNot > BindingPipe[name="async"]'({parent:{sourceSpan:{end:n,start:r}}}){e.report({messageId:"noNegatedAsync",loc:{start:t.getLocFromIndex(r),end:t.getLocFromIndex(n)},suggest:[{messageId:"suggestFalseComparison",textToInsert:" === false"},{messageId:"suggestNullComparison",textToInsert:" === null"},{messageId:"suggestUndefinedComparison",textToInsert:" === undefined"}].map(({messageId:e,textToInsert:t})=>({messageId:e,fix:e=>[e.removeRange([r,r+1]),e.insertTextAfterRange([n,n],t)]}))})}}}}),xt=p({name:"no-positive-tabindex",meta:{type:"suggestion",docs:{description:"Ensures that the `tabindex` attribute is not positive",recommended:!1},hasSuggestions:!0,schema:[],messages:{noPositiveTabindex:"The `tabindex` attribute should not be positive",suggestNonNegativeTabindex:'Use `tabindex="{{tabindex}}"`'}},defaultOptions:[],create(e){const t=m(e);return{[`Element$1[name=${ne([...k()])}] > BoundAttribute[name="tabindex"][value.ast.value>0], TextAttribute[name="tabindex"][value>0]`]({valueSpan:n}){const r=t.convertNodeSourceSpanToLoc(n);e.report({loc:r,messageId:"noPositiveTabindex",suggest:["-1","0"].map(e=>({messageId:"suggestNonNegativeTabindex",fix:t=>t.replaceTextRange([n.start.offset,n.end.offset],e),data:{tabindex:e}}))})}}}}),ht=p({name:"use-track-by-function",meta:{type:"suggestion",docs:{description:"Ensures trackBy function is used",recommended:!1},schema:[],messages:{useTrackByFunction:"Missing trackBy function in ngFor directive"}},defaultOptions:[],create(e){const t=m(e);return{'BoundAttribute.inputs[name="ngForOf"]'({parent:{inputs:n},sourceSpan:r}){if(n.some(vt))return;const a=t.convertNodeSourceSpanToLoc(r);e.report({messageId:"useTrackByFunction",loc:a})},'BoundAttribute.templateAttrs[name="ngForOf"]'({parent:{templateAttrs:n}}){if(n.some(vt))return;const{start:r}=t.convertNodeSourceSpanToLoc(n[0].sourceSpan),{end:a}=t.convertNodeSourceSpanToLoc(n[n.length-1].sourceSpan),o={start:{...r,column:r.column-1},end:{...a,column:a.column+1}};e.report({messageId:"useTrackByFunction",loc:o})}}}});function vt(e){return e instanceof a.TmplAstBoundAttribute&&"ngForTrackBy"===e.name}module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/template/accessibility-alt-text":"error","@angular-eslint/template/accessibility-elements-content":"error","@angular-eslint/template/accessibility-interactive-supports-focus":"error","@angular-eslint/template/accessibility-label-for":"error","@angular-eslint/template/accessibility-label-has-associated-control":"error","@angular-eslint/template/accessibility-role-has-required-aria":"error","@angular-eslint/template/accessibility-table-scope":"error","@angular-eslint/template/accessibility-valid-aria":"error","@angular-eslint/template/attributes-order":"error","@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/button-has-type":"error","@angular-eslint/template/click-events-have-key-events":"error","@angular-eslint/template/conditional-complexity":"error","@angular-eslint/template/cyclomatic-complexity":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/i18n":"error","@angular-eslint/template/mouse-events-have-key-events":"error","@angular-eslint/template/no-any":"error","@angular-eslint/template/no-autofocus":"error","@angular-eslint/template/no-call-expression":"error","@angular-eslint/template/no-distracting-elements":"error","@angular-eslint/template/no-duplicate-attributes":"error","@angular-eslint/template/no-inline-styles":"error","@angular-eslint/template/no-negated-async":"error","@angular-eslint/template/no-positive-tabindex":"error","@angular-eslint/template/use-track-by-function":"error"}},base:{parser:"@angular-eslint/template-parser",plugins:["@angular-eslint/template"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/template/banana-in-box":"error","@angular-eslint/template/eqeqeq":"error","@angular-eslint/template/no-negated-async":"error"}},"process-inline-templates":{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module"},plugins:["@angular-eslint/template"],processor:"@angular-eslint/template/extract-inline-html"}},processors:c,rules:{"accessibility-alt-text":S,"accessibility-elements-content":P,[X]:J,"accessibility-label-for":z,[Q]:te,[oe]:se,"accessibility-table-scope":ue,"accessibility-valid-aria":ie,"attributes-order":me,"banana-in-box":De,"button-has-type":Ie,"conditional-complexity":Ne,"click-events-have-key-events":we,"cyclomatic-complexity":ke,eqeqeq:_e,i18n:tt,"mouse-events-have-key-events":st,"no-any":ut,"no-autofocus":it,"no-call-expression":ct,"no-distracting-elements":pt,"no-duplicate-attributes":dt,"no-inline-styles":yt,"no-negated-async":Et,"no-positive-tabindex":xt,"use-track-by-function":ht}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin-template",
3
- "version": "14.2.1-alpha.10+fabdaf8",
3
+ "version": "14.2.1-alpha.13+6c1eb81",
4
4
  "description": "ESLint plugin for Angular Templates",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,19 +17,19 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "14.2.1-alpha.10+fabdaf8",
20
+ "@angular-eslint/bundled-angular-compiler": "14.2.1-alpha.13+6c1eb81",
21
21
  "@typescript-eslint/type-utils": "5.43.0",
22
22
  "@typescript-eslint/utils": "5.43.0",
23
23
  "aria-query": "5.1.3",
24
24
  "axobject-query": "3.1.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@angular-eslint/utils": "14.2.1-alpha.10+fabdaf8",
27
+ "@angular-eslint/utils": "14.2.1-alpha.13+6c1eb81",
28
28
  "@types/aria-query": "5.0.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "eslint": "^7.0.0 || ^8.0.0",
32
32
  "typescript": "*"
33
33
  },
34
- "gitHead": "fabdaf8a9d0dc754b26f544c9fb4f5a307b66787"
34
+ "gitHead": "6c1eb81522f199ce101516bc670c975dd2a3cc3a"
35
35
  }